diff --git a/test/built-ins/ShadowRealm/prototype/evaluate/returns-proxy-callable-object.js b/test/built-ins/ShadowRealm/prototype/evaluate/returns-proxy-callable-object.js index db194c6809..035a44b48f 100644 --- a/test/built-ins/ShadowRealm/prototype/evaluate/returns-proxy-callable-object.js +++ b/test/built-ins/ShadowRealm/prototype/evaluate/returns-proxy-callable-object.js @@ -22,4 +22,11 @@ new Proxy(fn, {}); assert.sameValue(typeof proxyCallable, 'function', 'wrapped proxy callable object is typeof function'); assert.sameValue(proxyCallable(), 42, 'wrappedpfn() returns 42'); -assert.sameValue(proxyCallable instanceof Proxy, false, 'the wrapped function "hides" the proxy instance'); +assert.sameValue((new Proxy(proxyCallable, {}))(), 42, 'wrapped functions can be proxied'); + +const getSecret = r.evaluate(`(obj) => { return obj.secret }`); +const secretObj = { "secret": 496 }; +const dispatchToUnderlying = { + apply: (target, this_, args) => { return target(args); } +}; +assert.throws(TypeError, () => (new Proxy(getSecret, dispatchToUnderlying))(secretObj), 'Proxying a wrapped function and invoking it still performs boundary checks');