Remove unnecessary eval to access realm globals

This commit is contained in:
legendecas 2021-10-08 14:12:15 +08:00 committed by Rick Waldron
parent 3f6708fa04
commit 619afdeab7
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ features: [cross-realm, class]
const realm = $262.createRealm();
const C = realm.global.eval('(class {})');
const TE = realm.global.eval('TypeError');
const TE = realm.global.TypeError;
assert.throws(TE, function() {
C();

View File

@ -32,7 +32,7 @@ assert.sameValue(
);
var other = $262.createRealm().global;
var OtherShadowRealm = other.eval('ShadowRealm');
var OtherShadowRealm = other.ShadowRealm;
var realm = Reflect.construct(OtherShadowRealm, []);
var fn = r.evaluate('() => {}');