Replace createNewGlobal with $262.createRealm().global in sm/Iterator

This commit is contained in:
André Bargull 2025-04-30 14:15:55 +02:00 committed by Philip Chimento
parent d77f35a4ec
commit 4ea90c4681
10 changed files with 10 additions and 10 deletions

View File

@ -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);

View File

@ -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));

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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],

View File

@ -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],

View File

@ -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();

View File

@ -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();

View File

@ -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);