mirror of https://github.com/tc39/test262.git
Check the function proto of all wrap points for Shadow Realm (#3269)
This commit is contained in:
parent
8d420cef41
commit
d351cfd445
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue