From aadf3d924d971bcc6739392843b4171035076979 Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Sat, 20 Mar 2021 22:47:53 +0100 Subject: [PATCH] =?UTF-8?q?Further=20fixes=20to=20create=C2=A0sync=C2=A0it?= =?UTF-8?q?erators=20in=C2=A0the=C2=A0correct=C2=A0realm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was missed in 9260316576a184c2c48af7aa211f7a68aae8cc6c. --- lib/constructs/interface.js | 2 +- test/__snapshots__/test.js.snap | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/constructs/interface.js b/lib/constructs/interface.js index 922cc194..aed285d3 100644 --- a/lib/constructs/interface.js +++ b/lib/constructs/interface.js @@ -1353,7 +1353,7 @@ class Interface { // Don't bother checking "length" attribute as interfaces that support indexed properties must implement one. // "Has value iterator" implies "supports indexed properties". if (this.supportsIndexedProperties) { - this.addProperty(this.defaultWhence, Symbol.iterator, "Array.prototype[Symbol.iterator]"); + this.addProperty(this.defaultWhence, Symbol.iterator, 'ctorRegistry["%Array%"].prototype[Symbol.iterator]'); } } diff --git a/test/__snapshots__/test.js.snap b/test/__snapshots__/test.js.snap index 0fa3e033..520cc660 100644 --- a/test/__snapshots__/test.js.snap +++ b/test/__snapshots__/test.js.snap @@ -3117,7 +3117,7 @@ exports._internalSetup = (wrapper, globalObject) => { esValue[implSymbol][\\"length\\"] = V; }, - [Symbol.iterator]: Array.prototype[Symbol.iterator], + [Symbol.iterator]: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], keys: ctorRegistry[\\"%Array%\\"].prototype.keys, values: ctorRegistry[\\"%Array%\\"].prototype.values, entries: ctorRegistry[\\"%Array%\\"].prototype.entries, @@ -8000,7 +8000,11 @@ exports.install = (globalObject, globalNames) => { item: { enumerable: true }, length: { enumerable: true }, [Symbol.toStringTag]: { value: \\"URLList\\", configurable: true }, - [Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true }, + [Symbol.iterator]: { + value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], + configurable: true, + writable: true + }, keys: { value: ctorRegistry[\\"%Array%\\"].prototype.keys, configurable: true, enumerable: true, writable: true }, values: { value: ctorRegistry[\\"%Array%\\"].prototype.values, configurable: true, enumerable: true, writable: true }, entries: { value: ctorRegistry[\\"%Array%\\"].prototype.entries, configurable: true, enumerable: true, writable: true }, @@ -8790,7 +8794,7 @@ exports.install = (globalObject, globalNames) => { namedItem: { enumerable: true }, length: { enumerable: true }, [Symbol.toStringTag]: { value: \\"URLSearchParamsCollection\\", configurable: true }, - [Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true } + [Symbol.iterator]: { value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], configurable: true, writable: true } }); ctorRegistry[interfaceName] = URLSearchParamsCollection; @@ -9086,7 +9090,7 @@ exports.install = (globalObject, globalNames) => { } Object.defineProperties(URLSearchParamsCollection2.prototype, { [Symbol.toStringTag]: { value: \\"URLSearchParamsCollection2\\", configurable: true }, - [Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true } + [Symbol.iterator]: { value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], configurable: true, writable: true } }); ctorRegistry[interfaceName] = URLSearchParamsCollection2; @@ -13025,7 +13029,7 @@ exports._internalSetup = (wrapper, globalObject) => { esValue[implSymbol][\\"length\\"] = V; }, - [Symbol.iterator]: Array.prototype[Symbol.iterator], + [Symbol.iterator]: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], keys: ctorRegistry[\\"%Array%\\"].prototype.keys, values: ctorRegistry[\\"%Array%\\"].prototype.values, entries: ctorRegistry[\\"%Array%\\"].prototype.entries, @@ -17892,7 +17896,11 @@ exports.install = (globalObject, globalNames) => { item: { enumerable: true }, length: { enumerable: true }, [Symbol.toStringTag]: { value: \\"URLList\\", configurable: true }, - [Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true }, + [Symbol.iterator]: { + value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], + configurable: true, + writable: true + }, keys: { value: ctorRegistry[\\"%Array%\\"].prototype.keys, configurable: true, enumerable: true, writable: true }, values: { value: ctorRegistry[\\"%Array%\\"].prototype.values, configurable: true, enumerable: true, writable: true }, entries: { value: ctorRegistry[\\"%Array%\\"].prototype.entries, configurable: true, enumerable: true, writable: true }, @@ -18682,7 +18690,7 @@ exports.install = (globalObject, globalNames) => { namedItem: { enumerable: true }, length: { enumerable: true }, [Symbol.toStringTag]: { value: \\"URLSearchParamsCollection\\", configurable: true }, - [Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true } + [Symbol.iterator]: { value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], configurable: true, writable: true } }); ctorRegistry[interfaceName] = URLSearchParamsCollection; @@ -18978,7 +18986,7 @@ exports.install = (globalObject, globalNames) => { } Object.defineProperties(URLSearchParamsCollection2.prototype, { [Symbol.toStringTag]: { value: \\"URLSearchParamsCollection2\\", configurable: true }, - [Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true } + [Symbol.iterator]: { value: ctorRegistry[\\"%Array%\\"].prototype[Symbol.iterator], configurable: true, writable: true } }); ctorRegistry[interfaceName] = URLSearchParamsCollection2;