Skip to content

Commit aadf3d9

Browse files
authored
Further fixes to create sync iterators in the correct realm
This was missed in 9260316.
1 parent b5ed275 commit aadf3d9

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

lib/constructs/interface.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ class Interface {
13531353
// Don't bother checking "length" attribute as interfaces that support indexed properties must implement one.
13541354
// "Has value iterator" implies "supports indexed properties".
13551355
if (this.supportsIndexedProperties) {
1356-
this.addProperty(this.defaultWhence, Symbol.iterator, "Array.prototype[Symbol.iterator]");
1356+
this.addProperty(this.defaultWhence, Symbol.iterator, 'ctorRegistry["%Array%"].prototype[Symbol.iterator]');
13571357
}
13581358
}
13591359

test/__snapshots__/test.js.snap

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3117,7 +3117,7 @@ exports._internalSetup = (wrapper, globalObject) => {
31173117

31183118
esValue[implSymbol][\\"length\\"] = V;
31193119
},
3120-
[Symbol.iterator]: Array.prototype[Symbol.iterator],
3120+
[Symbol.iterator]: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator],
31213121
keys: ctorRegistry[\\"%Array%\\"].prototype.keys,
31223122
values: ctorRegistry[\\"%Array%\\"].prototype.values,
31233123
entries: ctorRegistry[\\"%Array%\\"].prototype.entries,
@@ -8000,7 +8000,11 @@ exports.install = (globalObject, globalNames) => {
80008000
item: { enumerable: true },
80018001
length: { enumerable: true },
80028002
[Symbol.toStringTag]: { value: \\"URLList\\", configurable: true },
8003-
[Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true },
8003+
[Symbol.iterator]: {
8004+
value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator],
8005+
configurable: true,
8006+
writable: true
8007+
},
80048008
keys: { value: ctorRegistry[\\"%Array%\\"].prototype.keys, configurable: true, enumerable: true, writable: true },
80058009
values: { value: ctorRegistry[\\"%Array%\\"].prototype.values, configurable: true, enumerable: true, writable: true },
80068010
entries: { value: ctorRegistry[\\"%Array%\\"].prototype.entries, configurable: true, enumerable: true, writable: true },
@@ -8790,7 +8794,7 @@ exports.install = (globalObject, globalNames) => {
87908794
namedItem: { enumerable: true },
87918795
length: { enumerable: true },
87928796
[Symbol.toStringTag]: { value: \\"URLSearchParamsCollection\\", configurable: true },
8793-
[Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true }
8797+
[Symbol.iterator]: { value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], configurable: true, writable: true }
87948798
});
87958799
ctorRegistry[interfaceName] = URLSearchParamsCollection;
87968800

@@ -9086,7 +9090,7 @@ exports.install = (globalObject, globalNames) => {
90869090
}
90879091
Object.defineProperties(URLSearchParamsCollection2.prototype, {
90889092
[Symbol.toStringTag]: { value: \\"URLSearchParamsCollection2\\", configurable: true },
9089-
[Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true }
9093+
[Symbol.iterator]: { value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], configurable: true, writable: true }
90909094
});
90919095
ctorRegistry[interfaceName] = URLSearchParamsCollection2;
90929096

@@ -13025,7 +13029,7 @@ exports._internalSetup = (wrapper, globalObject) => {
1302513029

1302613030
esValue[implSymbol][\\"length\\"] = V;
1302713031
},
13028-
[Symbol.iterator]: Array.prototype[Symbol.iterator],
13032+
[Symbol.iterator]: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator],
1302913033
keys: ctorRegistry[\\"%Array%\\"].prototype.keys,
1303013034
values: ctorRegistry[\\"%Array%\\"].prototype.values,
1303113035
entries: ctorRegistry[\\"%Array%\\"].prototype.entries,
@@ -17892,7 +17896,11 @@ exports.install = (globalObject, globalNames) => {
1789217896
item: { enumerable: true },
1789317897
length: { enumerable: true },
1789417898
[Symbol.toStringTag]: { value: \\"URLList\\", configurable: true },
17895-
[Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true },
17899+
[Symbol.iterator]: {
17900+
value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator],
17901+
configurable: true,
17902+
writable: true
17903+
},
1789617904
keys: { value: ctorRegistry[\\"%Array%\\"].prototype.keys, configurable: true, enumerable: true, writable: true },
1789717905
values: { value: ctorRegistry[\\"%Array%\\"].prototype.values, configurable: true, enumerable: true, writable: true },
1789817906
entries: { value: ctorRegistry[\\"%Array%\\"].prototype.entries, configurable: true, enumerable: true, writable: true },
@@ -18682,7 +18690,7 @@ exports.install = (globalObject, globalNames) => {
1868218690
namedItem: { enumerable: true },
1868318691
length: { enumerable: true },
1868418692
[Symbol.toStringTag]: { value: \\"URLSearchParamsCollection\\", configurable: true },
18685-
[Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true }
18693+
[Symbol.iterator]: { value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], configurable: true, writable: true }
1868618694
});
1868718695
ctorRegistry[interfaceName] = URLSearchParamsCollection;
1868818696

@@ -18978,7 +18986,7 @@ exports.install = (globalObject, globalNames) => {
1897818986
}
1897918987
Object.defineProperties(URLSearchParamsCollection2.prototype, {
1898018988
[Symbol.toStringTag]: { value: \\"URLSearchParamsCollection2\\", configurable: true },
18981-
[Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true }
18989+
[Symbol.iterator]: { value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], configurable: true, writable: true }
1898218990
});
1898318991
ctorRegistry[interfaceName] = URLSearchParamsCollection2;
1898418992

0 commit comments

Comments
 (0)