diff --git a/test/built-ins/ShadowRealm/prototype/evaluate/wrapped-function-proto-from-caller-realm.js b/test/built-ins/ShadowRealm/prototype/evaluate/wrapped-function-proto-from-caller-realm.js index 9f509a24469..111e947b777 100644 --- a/test/built-ins/ShadowRealm/prototype/evaluate/wrapped-function-proto-from-caller-realm.js +++ b/test/built-ins/ShadowRealm/prototype/evaluate/wrapped-function-proto-from-caller-realm.js @@ -35,5 +35,10 @@ var other = $262.createRealm().global; var OtherShadowRealm = other.ShadowRealm; var realm = Reflect.construct(OtherShadowRealm, []); -var fn = realm.evaluate('() => {}'); + +var checkArgWrapperFn = realm.evaluate('(x) => { return Object.getPrototypeOf(x) === Function.prototype }') +assert.sameValue(checkArgWrapperFn(() => {}), true, 'callable arguments passed into WrappedFunction should be wrapped in target realm'); + +var fn = realm.evaluate('() => { return () => { return 1 } }'); assert.sameValue(Object.getPrototypeOf(fn), Function.prototype, 'WrappedFunction should be derived from the caller realm'); +assert.sameValue(Object.getPrototypeOf(fn()), Function.prototype, 'callable results from WrappedFunction should be wrapped in caller realm');