mirror of https://github.com/tc39/test262.git
Fix ShadowRealm.prototype.evaluate wraps value in the builtin function realm
This commit is contained in:
parent
4cb032dc32
commit
37e2c66420
|
@ -33,6 +33,7 @@ assert.sameValue(
|
|||
|
||||
var other = $262.createRealm().global;
|
||||
var OtherShadowRealm = other.ShadowRealm;
|
||||
var OtherFunctionPrototype = other.Function.prototype;
|
||||
|
||||
var realm = Reflect.construct(OtherShadowRealm, []);
|
||||
|
||||
|
@ -40,5 +41,5 @@ var checkArgWrapperFn = realm.evaluate('(x) => { return Object.getPrototypeOf(x)
|
|||
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');
|
||||
assert.sameValue(Object.getPrototypeOf(fn), OtherFunctionPrototype, 'WrappedFunction should be derived from the caller realm');
|
||||
assert.sameValue(Object.getPrototypeOf(fn()), OtherFunctionPrototype, 'callable results from WrappedFunction should be wrapped in caller realm');
|
||||
|
|
Loading…
Reference in New Issue