diff --git a/lib/constructs/interface.js b/lib/constructs/interface.js index 719808aa..82b431d7 100644 --- a/lib/constructs/interface.js +++ b/lib/constructs/interface.js @@ -1373,6 +1373,26 @@ class Interface { const props = [...classProps].map(([name, body]) => `${name}: ${body}`); this.str += `Object.defineProperties(${this.name}, { ${props.join(", ")} });`; } + + // This code can't currently be generated as the operation, parameters + // and overloads code doesn't currently support symbol properties. + // This method is also made non-enumerable to match the other 'utils' symbol properties. + this.str += ` + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(${this.name}.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + `; } generateOnInstance() { diff --git a/lib/output/utils.js b/lib/output/utils.js index a63606f8..39628069 100644 --- a/lib/output/utils.js +++ b/lib/output/utils.js @@ -11,6 +11,7 @@ const wrapperSymbol = Symbol("wrapper"); const implSymbol = Symbol("impl"); const sameObjectCaches = Symbol("SameObject caches"); const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry"); +const inspectCustomSymbol = Symbol.for("nodejs.util.inspect.custom"); function getSameObject(wrapper, prop, creator) { if (!wrapper[sameObjectCaches]) { @@ -91,6 +92,7 @@ module.exports = exports = { implSymbol, getSameObject, ctorRegistrySymbol, + inspectCustomSymbol, wrapperForImpl, implForWrapper, tryWrapperForImpl, diff --git a/test/__snapshots__/test.js.snap b/test/__snapshots__/test.js.snap index 0eaf40cd..88f796ff 100644 --- a/test/__snapshots__/test.js.snap +++ b/test/__snapshots__/test.js.snap @@ -231,6 +231,21 @@ exports.install = function install(globalObject) { u8aUnion: { enumerable: true }, [Symbol.toStringTag]: { value: \\"BufferSourceTypes\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(BufferSourceTypes.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -375,6 +390,21 @@ exports.install = function install(globalObject) { attr: { enumerable: true }, [Symbol.toStringTag]: { value: \\"CEReactions\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(CEReactions.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -777,6 +807,21 @@ exports.install = function install(globalObject) { hasFeature: { enumerable: true }, [Symbol.toStringTag]: { value: \\"DOMImplementation\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(DOMImplementation.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -964,6 +1009,21 @@ exports.install = function install(globalObject) { op: { enumerable: true }, [Symbol.toStringTag]: { value: \\"DictionaryConvert\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(DictionaryConvert.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -1096,6 +1156,21 @@ exports.install = function install(globalObject) { attr: { enumerable: true }, [Symbol.toStringTag]: { value: \\"Enum\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Enum.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -1294,6 +1369,21 @@ exports.install = function install(globalObject) { } Object.defineProperties(Global.prototype, { [Symbol.toStringTag]: { value: \\"Global\\", configurable: true } }); Object.defineProperties(Global, { staticOp: { enumerable: true }, staticAttr: { enumerable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Global.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -1379,6 +1469,21 @@ exports.install = function install(globalObject) { Object.defineProperties(HTMLConstructor.prototype, { [Symbol.toStringTag]: { value: \\"HTMLConstructor\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(HTMLConstructor.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -1475,6 +1580,21 @@ exports.install = function install(globalObject) { length: { enumerable: true }, [Symbol.toStringTag]: { value: \\"LegacyArrayClass\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(LegacyArrayClass.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -1635,6 +1755,21 @@ exports.install = function install(globalObject) { mixedInConst: { value: 43, enumerable: true }, ifaceMixinConst: { value: 42, enumerable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(MixedIn.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -2030,6 +2165,21 @@ exports.install = function install(globalObject) { incompatible3: { enumerable: true }, [Symbol.toStringTag]: { value: \\"Overloads\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Overloads.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -2172,6 +2322,21 @@ exports.install = function install(globalObject) { promiseConsumer: { enumerable: true }, [Symbol.toStringTag]: { value: \\"PromiseTypes\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(PromiseTypes.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -2446,6 +2611,21 @@ exports.install = function install(globalObject) { withUnderscore: { enumerable: true }, [Symbol.toStringTag]: { value: \\"Reflect\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Reflect.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -2769,6 +2949,21 @@ exports.install = function install(globalObject) { frozenArrayConsumer: { enumerable: true }, [Symbol.toStringTag]: { value: \\"SeqAndRec\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(SeqAndRec.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -2903,6 +3098,21 @@ exports.install = function install(globalObject) { [Symbol.toStringTag]: { value: \\"Static\\", configurable: true } }); Object.defineProperties(Static, { def: { enumerable: true }, abc: { enumerable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Static.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -3101,6 +3311,21 @@ exports.install = function install(globalObject) { length: { enumerable: true }, [Symbol.toStringTag]: { value: \\"Storage\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Storage.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -3370,6 +3595,21 @@ exports.install = function install(globalObject) { toString: { enumerable: true }, [Symbol.toStringTag]: { value: \\"StringifierAttribute\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(StringifierAttribute.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -3466,6 +3706,21 @@ exports.install = function install(globalObject) { toString: { enumerable: true }, [Symbol.toStringTag]: { value: \\"StringifierDefaultOperation\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(StringifierDefaultOperation.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -3572,6 +3827,21 @@ exports.install = function install(globalObject) { toString: { enumerable: true }, [Symbol.toStringTag]: { value: \\"StringifierNamedOperation\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(StringifierNamedOperation.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -3666,6 +3936,21 @@ exports.install = function install(globalObject) { toString: { enumerable: true }, [Symbol.toStringTag]: { value: \\"StringifierOperation\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(StringifierOperation.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -4183,6 +4468,21 @@ exports.install = function install(globalObject) { time: { enumerable: true }, [Symbol.toStringTag]: { value: \\"TypedefsAndUnions\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(TypedefsAndUnions.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -4569,6 +4869,21 @@ exports.install = function install(globalObject) { hash: { enumerable: true }, [Symbol.toStringTag]: { value: \\"URL\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(URL.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -4694,6 +5009,21 @@ exports.install = function install(globalObject) { entries: { value: Array.prototype.entries, configurable: true, enumerable: true, writable: true }, forEach: { value: Array.prototype.forEach, configurable: true, enumerable: true, writable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(URLList.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -5299,6 +5629,21 @@ exports.install = function install(globalObject) { [Symbol.toStringTag]: { value: \\"URLSearchParams\\", configurable: true }, [Symbol.iterator]: { value: URLSearchParams.prototype.entries, configurable: true, writable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(URLSearchParams.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -5449,6 +5794,21 @@ exports.install = function install(globalObject) { [Symbol.toStringTag]: { value: \\"URLSearchParamsCollection\\", configurable: true }, [Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(URLSearchParamsCollection.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -5733,6 +6093,21 @@ exports.install = function install(globalObject) { [Symbol.toStringTag]: { value: \\"URLSearchParamsCollection2\\", configurable: true }, [Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(URLSearchParamsCollection2.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -6119,6 +6494,21 @@ exports.install = function install(globalObject) { static: { enumerable: true }, const: { value: 42, enumerable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(UnderscoredProperties.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -6301,6 +6691,21 @@ exports.install = function install(globalObject) { Object.defineProperties(Unforgeable.prototype, { [Symbol.toStringTag]: { value: \\"Unforgeable\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Unforgeable.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -6404,6 +6809,21 @@ exports.install = function install(globalObject) { Object.defineProperties(UnforgeableMap.prototype, { [Symbol.toStringTag]: { value: \\"UnforgeableMap\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(UnforgeableMap.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -6717,6 +7137,21 @@ exports.install = function install(globalObject) { configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Unscopable.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -6957,6 +7392,21 @@ exports.install = function install(globalObject) { overloaded2: { enumerable: true }, [Symbol.toStringTag]: { value: \\"Variadic\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Variadic.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -7041,6 +7491,21 @@ exports.install = function install(globalObject) { Object.defineProperties(ZeroArgConstructor.prototype, { [Symbol.toStringTag]: { value: \\"ZeroArgConstructor\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(ZeroArgConstructor.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -7288,6 +7753,21 @@ exports.install = function install(globalObject) { u8aUnion: { enumerable: true }, [Symbol.toStringTag]: { value: \\"BufferSourceTypes\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(BufferSourceTypes.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -7416,6 +7896,21 @@ exports.install = function install(globalObject) { attr: { enumerable: true }, [Symbol.toStringTag]: { value: \\"CEReactions\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(CEReactions.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -7803,6 +8298,21 @@ exports.install = function install(globalObject) { hasFeature: { enumerable: true }, [Symbol.toStringTag]: { value: \\"DOMImplementation\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(DOMImplementation.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -7990,6 +8500,21 @@ exports.install = function install(globalObject) { op: { enumerable: true }, [Symbol.toStringTag]: { value: \\"DictionaryConvert\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(DictionaryConvert.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -8122,6 +8647,21 @@ exports.install = function install(globalObject) { attr: { enumerable: true }, [Symbol.toStringTag]: { value: \\"Enum\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Enum.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -8320,6 +8860,21 @@ exports.install = function install(globalObject) { } Object.defineProperties(Global.prototype, { [Symbol.toStringTag]: { value: \\"Global\\", configurable: true } }); Object.defineProperties(Global, { staticOp: { enumerable: true }, staticAttr: { enumerable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Global.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -8404,6 +8959,21 @@ exports.install = function install(globalObject) { Object.defineProperties(HTMLConstructor.prototype, { [Symbol.toStringTag]: { value: \\"HTMLConstructor\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(HTMLConstructor.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -8500,6 +9070,21 @@ exports.install = function install(globalObject) { length: { enumerable: true }, [Symbol.toStringTag]: { value: \\"LegacyArrayClass\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(LegacyArrayClass.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -8660,6 +9245,21 @@ exports.install = function install(globalObject) { mixedInConst: { value: 43, enumerable: true }, ifaceMixinConst: { value: 42, enumerable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(MixedIn.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -9055,6 +9655,21 @@ exports.install = function install(globalObject) { incompatible3: { enumerable: true }, [Symbol.toStringTag]: { value: \\"Overloads\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Overloads.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -9197,6 +9812,21 @@ exports.install = function install(globalObject) { promiseConsumer: { enumerable: true }, [Symbol.toStringTag]: { value: \\"PromiseTypes\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(PromiseTypes.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -9456,6 +10086,21 @@ exports.install = function install(globalObject) { withUnderscore: { enumerable: true }, [Symbol.toStringTag]: { value: \\"Reflect\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Reflect.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -9779,6 +10424,21 @@ exports.install = function install(globalObject) { frozenArrayConsumer: { enumerable: true }, [Symbol.toStringTag]: { value: \\"SeqAndRec\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(SeqAndRec.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -9913,6 +10573,21 @@ exports.install = function install(globalObject) { [Symbol.toStringTag]: { value: \\"Static\\", configurable: true } }); Object.defineProperties(Static, { def: { enumerable: true }, abc: { enumerable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Static.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -10111,6 +10786,21 @@ exports.install = function install(globalObject) { length: { enumerable: true }, [Symbol.toStringTag]: { value: \\"Storage\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Storage.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -10380,6 +11070,21 @@ exports.install = function install(globalObject) { toString: { enumerable: true }, [Symbol.toStringTag]: { value: \\"StringifierAttribute\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(StringifierAttribute.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -10476,6 +11181,21 @@ exports.install = function install(globalObject) { toString: { enumerable: true }, [Symbol.toStringTag]: { value: \\"StringifierDefaultOperation\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(StringifierDefaultOperation.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -10582,6 +11302,21 @@ exports.install = function install(globalObject) { toString: { enumerable: true }, [Symbol.toStringTag]: { value: \\"StringifierNamedOperation\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(StringifierNamedOperation.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -10676,6 +11411,21 @@ exports.install = function install(globalObject) { toString: { enumerable: true }, [Symbol.toStringTag]: { value: \\"StringifierOperation\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(StringifierOperation.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -11193,6 +11943,21 @@ exports.install = function install(globalObject) { time: { enumerable: true }, [Symbol.toStringTag]: { value: \\"TypedefsAndUnions\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(TypedefsAndUnions.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -11579,6 +12344,21 @@ exports.install = function install(globalObject) { hash: { enumerable: true }, [Symbol.toStringTag]: { value: \\"URL\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(URL.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -11704,6 +12484,21 @@ exports.install = function install(globalObject) { entries: { value: Array.prototype.entries, configurable: true, enumerable: true, writable: true }, forEach: { value: Array.prototype.forEach, configurable: true, enumerable: true, writable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(URLList.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -12309,6 +13104,21 @@ exports.install = function install(globalObject) { [Symbol.toStringTag]: { value: \\"URLSearchParams\\", configurable: true }, [Symbol.iterator]: { value: URLSearchParams.prototype.entries, configurable: true, writable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(URLSearchParams.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -12459,6 +13269,21 @@ exports.install = function install(globalObject) { [Symbol.toStringTag]: { value: \\"URLSearchParamsCollection\\", configurable: true }, [Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(URLSearchParamsCollection.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -12743,6 +13568,21 @@ exports.install = function install(globalObject) { [Symbol.toStringTag]: { value: \\"URLSearchParamsCollection2\\", configurable: true }, [Symbol.iterator]: { value: Array.prototype[Symbol.iterator], configurable: true, writable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(URLSearchParamsCollection2.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -13129,6 +13969,21 @@ exports.install = function install(globalObject) { static: { enumerable: true }, const: { value: 42, enumerable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(UnderscoredProperties.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -13311,6 +14166,21 @@ exports.install = function install(globalObject) { Object.defineProperties(Unforgeable.prototype, { [Symbol.toStringTag]: { value: \\"Unforgeable\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Unforgeable.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -13414,6 +14284,21 @@ exports.install = function install(globalObject) { Object.defineProperties(UnforgeableMap.prototype, { [Symbol.toStringTag]: { value: \\"UnforgeableMap\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(UnforgeableMap.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -13727,6 +14612,21 @@ exports.install = function install(globalObject) { configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Unscopable.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -13967,6 +14867,21 @@ exports.install = function install(globalObject) { overloaded2: { enumerable: true }, [Symbol.toStringTag]: { value: \\"Variadic\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(Variadic.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); } @@ -14051,6 +14966,21 @@ exports.install = function install(globalObject) { Object.defineProperties(ZeroArgConstructor.prototype, { [Symbol.toStringTag]: { value: \\"ZeroArgConstructor\\", configurable: true } }); + + if (utils.hasOwn(Impl.implementation.prototype, utils.inspectCustomSymbol)) { + Object.defineProperty(ZeroArgConstructor.prototype, utils.inspectCustomSymbol, { + value(depth, ctx) { + if (!exports.is(this)) { + throw new TypeError(\\"Illegal invocation\\"); + } + return this[impl][utils.inspectCustomSymbol](...arguments); + }, + writable: true, + enumerable: false, + configurable: true + }); + } + if (globalObject[ctorRegistry] === undefined) { globalObject[ctorRegistry] = Object.create(null); }