mirror of https://github.com/tc39/test262.git
fixup!
This commit is contained in:
parent
fc3878f0a4
commit
e9cea2125c
|
@ -14,14 +14,19 @@ assert.sameValue(
|
|||
);
|
||||
|
||||
var other = $262.createRealm().global;
|
||||
var OtherTypeError = other.eval('TypeError');
|
||||
var OtherShadowRealm = other.eval('ShadowRealm');
|
||||
var OtherTypeError = other.TypeError;
|
||||
var OtherSyntaxError = other.SyntaxError;
|
||||
var OtherShadowRealm = other.ShadowRealm;
|
||||
|
||||
var realm = Reflect.construct(OtherShadowRealm, []);
|
||||
|
||||
assert.throws(OtherTypeError, () => realm.evaluate('globalThis'), 'throws a TypeError if return value can not be wrapped');
|
||||
assert.throws(OtherTypeError, () => realm.evaluate('throw new Error()'), 'throws a TypeError if completion is abrupt');
|
||||
|
||||
assert.throws(OtherTypeError, () => realm.evaluate(1), 'throws a TypeError if sourceText is not a string');
|
||||
assert.throws(OtherSyntaxError, () => realm.evaluate('...'), 'throws a SyntaxError if the sourceText is not valid');
|
||||
|
||||
const bogus = {};
|
||||
assert.throws(OtherTypeError, function() {
|
||||
realm.evaluate.call(bogus, '');
|
||||
realm.evaluate.call(bogus, 'This is invalid code and should not be evaluated');
|
||||
}, 'throws a TypeError if this is not a ShadowRealm object');
|
|
@ -17,5 +17,5 @@ const r = new ShadowRealm();
|
|||
const bogus = {};
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
r.evaluate.call(bogus, '');
|
||||
r.evaluate.call(bogus, 'This is invalid code and should not be evaluated');
|
||||
}, 'throws a TypeError if this is not a ShadowRealm object');
|
||||
|
|
Loading…
Reference in New Issue