diff --git a/packages/exo/test/test-heap-classes.js b/packages/exo/test/test-heap-classes.js index 77b031a270..d41352e986 100644 --- a/packages/exo/test/test-heap-classes.js +++ b/packages/exo/test/test-heap-classes.js @@ -180,12 +180,13 @@ test('missing interface', t => { ); const greeterMaker = makeExo('greeterMaker', undefined, { makeSayHello() { - return () => 'hello'; + const helloFunc = () => 'hello'; + return harden(helloFunc); }, }); t.throws(() => greeterMaker.makeSayHello(), { message: - 'In "makeSayHello" method of (greeterMaker): result: "[Symbol(passStyle)]" property expected: "[Function ]"', + 'In "makeSayHello" method of (greeterMaker): result: Remotables must be explicitly declared: "[Function helloFunc]"', }); t.is(greeterMaker[GET_INTERFACE_GUARD]?.(), undefined); }); diff --git a/packages/pass-style/src/remotable.js b/packages/pass-style/src/remotable.js index 788ae19d12..d4c17986fa 100644 --- a/packages/pass-style/src/remotable.js +++ b/packages/pass-style/src/remotable.js @@ -87,7 +87,11 @@ const checkRemotableProtoOf = (original, check) => { // }} // const proto = getPrototypeOf(original); - if (proto === objectPrototype || proto === null) { + if ( + proto === objectPrototype || + proto === null || + proto === Function.prototype + ) { return ( reject && reject`Remotables must be explicitly declared: ${q(original)}` );