summaryrefslogtreecommitdiff
path: root/deps/v8/test/test262/harness-adapt.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/test262/harness-adapt.js')
-rw-r--r--deps/v8/test/test262/harness-adapt.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/deps/v8/test/test262/harness-adapt.js b/deps/v8/test/test262/harness-adapt.js
index d93d7e1610..35d6f63ac6 100644
--- a/deps/v8/test/test262/harness-adapt.js
+++ b/deps/v8/test/test262/harness-adapt.js
@@ -90,6 +90,18 @@ function $DONE(arg){
quit(0);
};
-var $ = {
- evalScript(script) { return Realm.eval(Realm.current(), script); }
-};
+function RealmOperators(realm) {
+ let $ = {
+ evalScript(script) {
+ return Realm.eval(realm, script);
+ },
+ createRealm() {
+ return RealmOperators(Realm.createAllowCrossRealmAccess());
+ },
+ global: Realm.eval(realm, 'this')
+ };
+ $.global.$ = $;
+ return $;
+}
+
+var $ = RealmOperators(Realm.current());