diff --git a/lib/constructs/interface.js b/lib/constructs/interface.js index a8bda9c2..43d8a467 100644 --- a/lib/constructs/interface.js +++ b/lib/constructs/interface.js @@ -582,7 +582,7 @@ class Interface { generateExport() { this.str += ` exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -666,7 +666,7 @@ class Interface { conditions.push(supportsPropertyName(O, P)); } if (overrideBuiltins) { - conditions.push(`!utils.hasOwn(${O}, ${P})`); + conditions.push(`!Object.hasOwn(${O}, ${P})`); } else { // TODO: create a named properties object. conditions.push(`!(${P} in ${O})`); @@ -987,33 +987,7 @@ class Interface { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } `; @@ -1065,7 +1039,7 @@ class Interface { } if (!overrideBuiltins) { needFallback = true; - this.str += "if (!utils.hasOwn(target, P)) {"; + this.str += "if (!Object.hasOwn(target, P)) {"; } if (!hasNamedSetter) { diff --git a/lib/output/utils.js b/lib/output/utils.js index 3af17706..2feb60c6 100644 --- a/lib/output/utils.js +++ b/lib/output/utils.js @@ -5,7 +5,7 @@ function isObject(value) { return (typeof value === "object" && value !== null) || typeof value === "function"; } -const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); +const call = Function.call.bind(Function.call); // Like `Object.assign`, but using `[[GetOwnProperty]]` and `[[DefineOwnProperty]]` // instead of `[[Get]]` and `[[Set]]` and only allowing objects @@ -34,7 +34,7 @@ const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry"); const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype); function initCtorRegistry(globalObject) { - if (hasOwn(globalObject, ctorRegistrySymbol)) { + if (Object.hasOwn(globalObject, ctorRegistrySymbol)) { return globalObject[ctorRegistrySymbol]; } @@ -137,6 +137,56 @@ function iteratorResult([key, value], kind) { return { value: result, done: false }; } +function ordinarySetWithOwnDescriptor(target, property, value, receiver, ownDesc) { + if (ownDesc === undefined) { + const parent = Reflect.getPrototypeOf(target); + if (parent !== null) { + return Reflect.set(parent, property, value, receiver); + } + ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; + } + if (isDataDescriptor(ownDesc)) { + if (!ownDesc.writable) { + return false; + } + if (!isObject(receiver)) { + return false; + } + const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, property); + if (existingDesc !== undefined) { + if (isAccessorDescriptor(existingDesc)) { + return false; + } + if (existingDesc.writable === false) { + return false; + } + const valueDesc = { value }; + return Reflect.defineOwnProperty(receiver, property, valueDesc); + } + + return Reflect.defineOwnProperty( + receiver, + property, + { value, writable: true, enumerable: true, configurable: true } + ); + } + + const setter = ownDesc.set; + if (setter === undefined) { + return false; + } + call(setter, receiver, value); + return true; +} + +function isDataDescriptor(desc) { + return Object.hasOwn(desc, "value") || Object.hasOwn(desc, "writable"); +} + +function isAccessorDescriptor(desc) { + return Object.hasOwn(desc, "get") || Object.hasOwn(desc, "set"); +} + const supportsPropertyIndex = Symbol("supports property index"); const supportedPropertyIndices = Symbol("supported property indices"); const supportsPropertyName = Symbol("supports property name"); @@ -156,7 +206,6 @@ const asyncIteratorEOI = Symbol("async iterator end of iteration"); module.exports = exports = { isObject, - hasOwn, define, newObjectInRealm, wrapperSymbol, @@ -186,5 +235,6 @@ module.exports = exports = { asyncIteratorReturn, asyncIteratorInit, asyncIteratorEOI, - iteratorResult + iteratorResult, + ordinarySetWithOwnDescriptor }; diff --git a/test/__snapshots__/test.js.snap b/test/__snapshots__/test.js.snap index a8e798dd..150ecab2 100644 --- a/test/__snapshots__/test.js.snap +++ b/test/__snapshots__/test.js.snap @@ -174,7 +174,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "AsyncIterablePairArgs"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -464,7 +464,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "AsyncIterablePairNoArgs"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -686,7 +686,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "AsyncIterableValueArgs"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -881,7 +881,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "AsyncIterableValueNoArgs"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -1069,7 +1069,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "AsyncIterableWithReturn"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -1284,7 +1284,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "BufferSourceTypes"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -1558,7 +1558,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "CEReactions"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -1874,33 +1874,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -1909,7 +1883,7 @@ class ProxyHandler { } const globalObject = this._globalObject; - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { if (desc.get || desc.set) { return false; } @@ -2059,7 +2033,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "DOMImplementation"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -2298,7 +2272,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "DOMRect"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -2669,7 +2643,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "DictionaryConvert"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -2807,7 +2781,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Enum"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -3006,7 +2980,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "EventTarget"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -3153,7 +3127,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Global"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -3386,7 +3360,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "HTMLCollection"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -3680,33 +3654,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -3719,7 +3667,7 @@ class ProxyHandler { if (utils.isArrayIndexPropName(P)) { return false; } - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { const creating = !(target[implSymbol].namedItem(P) !== null); if (!creating) { return false; @@ -3769,7 +3717,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "HTMLConstructor"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -3880,7 +3828,7 @@ const HTMLCollection = require("./HTMLCollection.js"); const interfaceName = "HTMLFormControlsCollection"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -4139,33 +4087,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -4178,7 +4100,7 @@ class ProxyHandler { if (utils.isArrayIndexPropName(P)) { return false; } - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { const creating = !(target[implSymbol].namedItem(P) !== null); if (!creating) { return false; @@ -4227,7 +4149,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "LegacyLenientAttributes"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -4432,7 +4354,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "LegacyNoInterfaceObject"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -4579,7 +4501,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "LegacyUnforgeable"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -4809,7 +4731,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "LegacyUnforgeableMap"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -5054,33 +4976,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -5090,7 +4986,7 @@ class ProxyHandler { const globalObject = this._globalObject; if (!["a"].includes(P)) { - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { if (desc.get || desc.set) { return false; } @@ -5150,7 +5046,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "MixedIn"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -5426,7 +5322,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Overloads"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -5863,7 +5759,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "PromiseTypes"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -6122,7 +6018,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Reflect"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -6456,7 +6352,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Replaceable"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -6630,7 +6526,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "SeqAndRec"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -6954,7 +6850,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Static"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -7122,7 +7018,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Storage"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -7459,33 +7355,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -7494,7 +7364,7 @@ class ProxyHandler { } const globalObject = this._globalObject; - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { if (desc.get || desc.set) { return false; } @@ -7549,7 +7419,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "StringifierAttribute"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -7684,7 +7554,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "StringifierDefaultOperation"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -7806,7 +7676,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "StringifierNamedOperation"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -7940,7 +7810,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "StringifierOperation"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -8064,7 +7934,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "TypedefsAndUnions"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -8624,7 +8494,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "URL"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -9154,7 +9024,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "URLList"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -9409,33 +9279,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -9490,7 +9334,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "URLSearchParams"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -9964,7 +9808,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "URLSearchParamsCollection"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -10260,33 +10104,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -10299,7 +10117,7 @@ class ProxyHandler { if (utils.isArrayIndexPropName(P)) { return false; } - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { const creating = !(target[implSymbol].namedItem(P) !== null); if (!creating) { return false; @@ -10350,7 +10168,7 @@ const URLSearchParamsCollection = require("./URLSearchParamsCollection.js"); const interfaceName = "URLSearchParamsCollection2"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -10600,33 +10418,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -10639,7 +10431,7 @@ class ProxyHandler { if (utils.isArrayIndexPropName(P)) { return false; } - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { if (desc.get || desc.set) { return false; } @@ -10702,7 +10494,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "UnderscoredProperties"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -10904,7 +10696,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Unscopable"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -11079,7 +10871,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Variadic"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -11354,7 +11146,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "ZeroArgConstructor"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -11550,7 +11342,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "AsyncIterablePairArgs"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -11840,7 +11632,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "AsyncIterablePairNoArgs"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -12062,7 +11854,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "AsyncIterableValueArgs"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -12257,7 +12049,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "AsyncIterableValueNoArgs"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -12445,7 +12237,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "AsyncIterableWithReturn"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -12660,7 +12452,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "BufferSourceTypes"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -12933,7 +12725,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "CEReactions"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -13219,33 +13011,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -13254,7 +13020,7 @@ class ProxyHandler { } const globalObject = this._globalObject; - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { if (desc.get || desc.set) { return false; } @@ -13394,7 +13160,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "DOMImplementation"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -13633,7 +13399,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "DOMRect"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -14004,7 +13770,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "DictionaryConvert"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -14142,7 +13908,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Enum"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -14341,7 +14107,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "EventTarget"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -14488,7 +14254,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Global"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -14721,7 +14487,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "HTMLCollection"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -15015,33 +14781,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -15054,7 +14794,7 @@ class ProxyHandler { if (utils.isArrayIndexPropName(P)) { return false; } - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { const creating = !(target[implSymbol].namedItem(P) !== null); if (!creating) { return false; @@ -15103,7 +14843,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "HTMLConstructor"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -15214,7 +14954,7 @@ const HTMLCollection = require("./HTMLCollection.js"); const interfaceName = "HTMLFormControlsCollection"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -15473,33 +15213,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -15512,7 +15226,7 @@ class ProxyHandler { if (utils.isArrayIndexPropName(P)) { return false; } - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { const creating = !(target[implSymbol].namedItem(P) !== null); if (!creating) { return false; @@ -15561,7 +15275,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "LegacyLenientAttributes"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -15766,7 +15480,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "LegacyNoInterfaceObject"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -15913,7 +15627,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "LegacyUnforgeable"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -16143,7 +15857,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "LegacyUnforgeableMap"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -16388,33 +16102,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -16424,7 +16112,7 @@ class ProxyHandler { const globalObject = this._globalObject; if (!["a"].includes(P)) { - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { if (desc.get || desc.set) { return false; } @@ -16484,7 +16172,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "MixedIn"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -16760,7 +16448,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Overloads"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -17197,7 +16885,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "PromiseTypes"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -17455,7 +17143,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Reflect"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -17775,7 +17463,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Replaceable"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -17949,7 +17637,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "SeqAndRec"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -18273,7 +17961,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Static"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -18441,7 +18129,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Storage"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -18778,33 +18466,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -18813,7 +18475,7 @@ class ProxyHandler { } const globalObject = this._globalObject; - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { if (desc.get || desc.set) { return false; } @@ -18868,7 +18530,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "StringifierAttribute"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -19003,7 +18665,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "StringifierDefaultOperation"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -19125,7 +18787,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "StringifierNamedOperation"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -19259,7 +18921,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "StringifierOperation"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -19383,7 +19045,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "TypedefsAndUnions"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -19943,7 +19605,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "URL"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -20473,7 +20135,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "URLList"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -20728,33 +20390,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -20809,7 +20445,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "URLSearchParams"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -21283,7 +20919,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "URLSearchParamsCollection"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -21579,33 +21215,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -21618,7 +21228,7 @@ class ProxyHandler { if (utils.isArrayIndexPropName(P)) { return false; } - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { const creating = !(target[implSymbol].namedItem(P) !== null); if (!creating) { return false; @@ -21669,7 +21279,7 @@ const URLSearchParamsCollection = require("./URLSearchParamsCollection.js"); const interfaceName = "URLSearchParamsCollection2"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -21919,33 +21529,7 @@ class ProxyHandler { if (ownDesc === undefined) { ownDesc = Reflect.getOwnPropertyDescriptor(target, P); } - if (ownDesc === undefined) { - const parent = Reflect.getPrototypeOf(target); - if (parent !== null) { - return Reflect.set(parent, P, V, receiver); - } - ownDesc = { writable: true, enumerable: true, configurable: true, value: undefined }; - } - if (!ownDesc.writable) { - return false; - } - if (!utils.isObject(receiver)) { - return false; - } - const existingDesc = Reflect.getOwnPropertyDescriptor(receiver, P); - let valueDesc; - if (existingDesc !== undefined) { - if (existingDesc.get || existingDesc.set) { - return false; - } - if (!existingDesc.writable) { - return false; - } - valueDesc = { value: V }; - } else { - valueDesc = { writable: true, enumerable: true, configurable: true, value: V }; - } - return Reflect.defineProperty(receiver, P, valueDesc); + return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc); } defineProperty(target, P, desc) { @@ -21958,7 +21542,7 @@ class ProxyHandler { if (utils.isArrayIndexPropName(P)) { return false; } - if (!utils.hasOwn(target, P)) { + if (!Object.hasOwn(target, P)) { if (desc.get || desc.set) { return false; } @@ -22021,7 +21605,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "UnderscoredProperties"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -22223,7 +21807,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Unscopable"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -22398,7 +21982,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "Variadic"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; @@ -22673,7 +22257,7 @@ const ctorRegistrySymbol = utils.ctorRegistrySymbol; const interfaceName = "ZeroArgConstructor"; exports.is = value => { - return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; + return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; }; exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation;