From 4ea90c46813f4c3d3fc26f754c3ff7403334d8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 30 Apr 2025 14:15:55 +0200 Subject: [PATCH] Replace createNewGlobal with $262.createRealm().global in sm/Iterator --- test/staging/sm/Iterator/from/wrap-functions-on-other-global.js | 2 +- test/staging/sm/Iterator/from/wrap-new-global.js | 2 +- .../sm/Iterator/prototype/every/error-from-correct-realm.js | 2 +- .../sm/Iterator/prototype/find/error-from-correct-realm.js | 2 +- .../sm/Iterator/prototype/forEach/error-from-correct-realm.js | 2 +- .../sm/Iterator/prototype/iterator-helpers-from-other-global.js | 2 +- .../sm/Iterator/prototype/lazy-methods-from-other-global.js | 2 +- .../sm/Iterator/prototype/reduce/error-from-correct-realm.js | 2 +- .../sm/Iterator/prototype/some/error-from-correct-realm.js | 2 +- .../sm/Iterator/prototype/toArray/create-in-current-realm.js | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/staging/sm/Iterator/from/wrap-functions-on-other-global.js b/test/staging/sm/Iterator/from/wrap-functions-on-other-global.js index 4f17a15190..919a2cbff2 100644 --- a/test/staging/sm/Iterator/from/wrap-functions-on-other-global.js +++ b/test/staging/sm/Iterator/from/wrap-functions-on-other-global.js @@ -29,7 +29,7 @@ const iter = { throw: (value) => ({done: true, value}), }; const thisWrap = Iterator.from(iter); -const otherGlobal = createNewGlobal({newCompartment: true}); +const otherGlobal = $262.createRealm().global; const otherWrap = otherGlobal.Iterator.from(iter); checkIterResult(thisWrap.next.call(otherWrap), false, 0); diff --git a/test/staging/sm/Iterator/from/wrap-new-global.js b/test/staging/sm/Iterator/from/wrap-new-global.js index 3f5134f8c8..aaa73b0272 100644 --- a/test/staging/sm/Iterator/from/wrap-new-global.js +++ b/test/staging/sm/Iterator/from/wrap-new-global.js @@ -13,7 +13,7 @@ description: | pending esid: pending ---*/ -const otherGlobal = createNewGlobal({newCompartment: true}); +const otherGlobal = $262.createRealm().global; const iter = [1, 2, 3].values(); assert.sameValue(iter, Iterator.from(iter)); diff --git a/test/staging/sm/Iterator/prototype/every/error-from-correct-realm.js b/test/staging/sm/Iterator/prototype/every/error-from-correct-realm.js index b7b9b03761..d174490334 100644 --- a/test/staging/sm/Iterator/prototype/every/error-from-correct-realm.js +++ b/test/staging/sm/Iterator/prototype/every/error-from-correct-realm.js @@ -14,7 +14,7 @@ description: | esid: pending ---*/ -const otherGlobal = createNewGlobal({newCompartment: true}); +const otherGlobal = $262.createRealm().global; assert.sameValue(TypeError !== otherGlobal.TypeError, true); const iter = [].values(); diff --git a/test/staging/sm/Iterator/prototype/find/error-from-correct-realm.js b/test/staging/sm/Iterator/prototype/find/error-from-correct-realm.js index 5926af39e8..669f53c4e9 100644 --- a/test/staging/sm/Iterator/prototype/find/error-from-correct-realm.js +++ b/test/staging/sm/Iterator/prototype/find/error-from-correct-realm.js @@ -14,7 +14,7 @@ description: | esid: pending ---*/ -const otherGlobal = createNewGlobal({newCompartment: true}); +const otherGlobal = $262.createRealm().global; assert.sameValue(TypeError !== otherGlobal.TypeError, true); const iter = [].values(); diff --git a/test/staging/sm/Iterator/prototype/forEach/error-from-correct-realm.js b/test/staging/sm/Iterator/prototype/forEach/error-from-correct-realm.js index 19b769dc69..d7055f7511 100644 --- a/test/staging/sm/Iterator/prototype/forEach/error-from-correct-realm.js +++ b/test/staging/sm/Iterator/prototype/forEach/error-from-correct-realm.js @@ -14,7 +14,7 @@ description: | esid: pending ---*/ -const otherGlobal = createNewGlobal({newCompartment: true}); +const otherGlobal = $262.createRealm().global; assert.sameValue(TypeError !== otherGlobal.TypeError, true); const iter = [].values(); diff --git a/test/staging/sm/Iterator/prototype/iterator-helpers-from-other-global.js b/test/staging/sm/Iterator/prototype/iterator-helpers-from-other-global.js index ff97cebad3..741a5643d8 100644 --- a/test/staging/sm/Iterator/prototype/iterator-helpers-from-other-global.js +++ b/test/staging/sm/Iterator/prototype/iterator-helpers-from-other-global.js @@ -31,7 +31,7 @@ function checkIterResult({done, value}, expectedDone, expectedValue) { assert.sameValue(Array.isArray(value) ? value[1] : value, expectedValue); } -const otherGlobal = createNewGlobal({newCompartment: true}); +const otherGlobal = $262.createRealm().global; const methods = [ ["map", x => x], diff --git a/test/staging/sm/Iterator/prototype/lazy-methods-from-other-global.js b/test/staging/sm/Iterator/prototype/lazy-methods-from-other-global.js index c2622560d8..99a6b8815d 100644 --- a/test/staging/sm/Iterator/prototype/lazy-methods-from-other-global.js +++ b/test/staging/sm/Iterator/prototype/lazy-methods-from-other-global.js @@ -12,7 +12,7 @@ description: | esid: pending ---*/ -const otherIteratorProto = createNewGlobal({newCompartment: true}).Iterator.prototype; +const otherIteratorProto = $262.createRealm().global.Iterator.prototype; const methods = [ ["map", x => x], diff --git a/test/staging/sm/Iterator/prototype/reduce/error-from-correct-realm.js b/test/staging/sm/Iterator/prototype/reduce/error-from-correct-realm.js index fd97e9b199..a097d016e6 100644 --- a/test/staging/sm/Iterator/prototype/reduce/error-from-correct-realm.js +++ b/test/staging/sm/Iterator/prototype/reduce/error-from-correct-realm.js @@ -14,7 +14,7 @@ description: | esid: pending ---*/ -const otherGlobal = createNewGlobal({newCompartment: true}); +const otherGlobal = $262.createRealm().global; assert.sameValue(TypeError !== otherGlobal.TypeError, true); const iter = [].values(); diff --git a/test/staging/sm/Iterator/prototype/some/error-from-correct-realm.js b/test/staging/sm/Iterator/prototype/some/error-from-correct-realm.js index 0289b360a0..b80ac9add4 100644 --- a/test/staging/sm/Iterator/prototype/some/error-from-correct-realm.js +++ b/test/staging/sm/Iterator/prototype/some/error-from-correct-realm.js @@ -14,7 +14,7 @@ description: | esid: pending ---*/ -const otherGlobal = createNewGlobal({newCompartment: true}); +const otherGlobal = $262.createRealm().global; assert.sameValue(TypeError !== otherGlobal.TypeError, true); const iter = [].values(); diff --git a/test/staging/sm/Iterator/prototype/toArray/create-in-current-realm.js b/test/staging/sm/Iterator/prototype/toArray/create-in-current-realm.js index 52c96d500d..92b55a82f3 100644 --- a/test/staging/sm/Iterator/prototype/toArray/create-in-current-realm.js +++ b/test/staging/sm/Iterator/prototype/toArray/create-in-current-realm.js @@ -14,7 +14,7 @@ description: | esid: pending ---*/ -const otherGlobal = createNewGlobal({newCompartment: true}); +const otherGlobal = $262.createRealm().global; let array = [1, 2, 3].values().toArray(); assert.sameValue(array instanceof Array, true);