From 72239add06c964c4bc02343538e05dba25e74f34 Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Tue, 23 Mar 2021 09:20:00 +0100 Subject: [PATCH] =?UTF-8?q?Create=C2=A0errors=20in=C2=A0correct=C2=A0realm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constructs/async-iterable.js | 2 +- lib/constructs/attribute.js | 8 +- lib/constructs/callback-function.js | 6 +- lib/constructs/callback-interface.js | 11 +- lib/constructs/dictionary.js | 12 +- lib/constructs/enumeration.js | 4 +- lib/constructs/interface.js | 16 +- lib/constructs/iterable.js | 10 +- lib/constructs/operation.js | 4 +- lib/output/utils.js | 20 +- lib/parameters.js | 7 +- lib/types.js | 16 +- test/__snapshots__/test.js.snap | 3778 ++++++++++++++++---------- 13 files changed, 2408 insertions(+), 1486 deletions(-) diff --git a/lib/constructs/async-iterable.js b/lib/constructs/async-iterable.js index 7ba3cefa..d19c132a 100644 --- a/lib/constructs/async-iterable.js +++ b/lib/constructs/async-iterable.js @@ -38,7 +38,7 @@ class AsyncIterable { this.interface.addMethod(this.interface.defaultWhence, key, [], ` if (!exports.is(this)) { - throw new TypeError("'${key}' called on an object that is not a valid instance of ${this.interface.name}."); + throw new ctorRegistry["%TypeError%"]("'${key}' called on an object that is not a valid instance of ${this.interface.name}."); } ${conv.body} diff --git a/lib/constructs/attribute.js b/lib/constructs/attribute.js index b209ffe2..9a530a70 100644 --- a/lib/constructs/attribute.js +++ b/lib/constructs/attribute.js @@ -35,11 +35,11 @@ class Attribute { const async = this.idl.idlType.generic === "Promise"; const promiseHandlingBefore = async ? `try {` : ``; - const promiseHandlingAfter = async ? `} catch (e) { return Promise.reject(e); }` : ``; + const promiseHandlingAfter = async ? `} catch (e) { return ctorRegistry["%Promise%"].reject(e); }` : ``; let brandCheck = ` if (!exports.is(esValue)) { - throw new TypeError("'$KEYWORD$ ${this.idl.name}' called on an object that is not a valid instance of ${this.interface.name}."); + throw new ctorRegistry["%TypeError%"]("'$KEYWORD$ ${this.idl.name}' called on an object that is not a valid instance of ${this.interface.name}."); } `; let getterBody = `return utils.tryWrapperForImpl(esValue[implSymbol]["${this.idl.name}"]);`; @@ -150,7 +150,7 @@ class Attribute { setterBody = ` const Q = esValue["${this.idl.name}"]; if (!utils.isObject(Q)) { - throw new TypeError("Property '${this.idl.name}' is not an object"); + throw new ctorRegistry["%TypeError%"]("Property '${this.idl.name}' is not an object"); } `; @@ -180,7 +180,7 @@ class Attribute { addMethod("toString", [], ` const esValue = this; if (!exports.is(esValue)) { - throw new TypeError("'toString' called on an object that is not a valid instance of ${this.interface.name}."); + throw new ctorRegistry["%TypeError%"]("'toString' called on an object that is not a valid instance of ${this.interface.name}."); } ${getterBody} diff --git a/lib/constructs/callback-function.js b/lib/constructs/callback-function.js index a90102a7..1a9e87d6 100644 --- a/lib/constructs/callback-function.js +++ b/lib/constructs/callback-function.js @@ -25,7 +25,7 @@ class CallbackFunction { "" : ` if (typeof value !== "function") { - throw new TypeError(context + " is not a function"); + throw new ctorRegistry["%TypeError%"](context + " is not a function"); } `; @@ -109,7 +109,7 @@ class CallbackFunction { } this.str += ` - exports.convert = (value, { context = "The provided value" } = {}) => { + exports.convert = (value, { context = "The provided value", ctorRegistry = { "%TypeError%": TypeError, "%Number%": Number, "%Promise%": Promise, "%String%": String } } = {}) => { ${assertCallable} function invokeTheCallbackFunction(${inputArgs}) { const thisArg = utils.tryWrapperForImpl(this); @@ -144,7 +144,7 @@ class CallbackFunction { if (isAsync) { this.str += ` } catch (err) { - return Promise.reject(err); + return ctorRegistry["%Promise%"].reject(err); } `; } diff --git a/lib/constructs/callback-interface.js b/lib/constructs/callback-interface.js index 0c5e6cd5..35ea2ede 100644 --- a/lib/constructs/callback-interface.js +++ b/lib/constructs/callback-interface.js @@ -94,9 +94,9 @@ class CallbackInterface { } this.str += ` - exports.convert = function convert(value, { context = "The provided value" } = {}) { + exports.convert = (value, { context = "The provided value", ctorRegistry = { "%TypeError%": TypeError, "%Number%": Number, "%Promise%": Promise, "%String%": String } } = {}) => { if (!utils.isObject(value)) { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry["%TypeError%"](\`\${context} is not an object.\`); } function callTheUserObjectsOperation(${argNames.join(", ")}) { @@ -115,7 +115,7 @@ class CallbackInterface { if (typeof O !== "function") { X = O[${utils.stringifyPropertyName(opName)}]; if (typeof X !== "function") { - throw new TypeError(\`\${context} does not correctly implement ${name}.\`) + throw new ctorRegistry["%TypeError%"](\`\${context} does not correctly implement ${name}.\`) } thisArg = O; } @@ -151,7 +151,7 @@ class CallbackInterface { if (isAsync) { this.str += ` } catch (err) { - return Promise.reject(err); + return ctorRegistry["%Promise%"].reject(err); } `; } @@ -215,8 +215,9 @@ class CallbackInterface { return; } + const ctorRegistry = utils.initCtorRegistry(globalObject); const ${name} = () => { - throw new TypeError("Illegal invocation"); + throw new ctorRegistry["%TypeError%"]("Illegal invocation"); }; `; diff --git a/lib/constructs/dictionary.js b/lib/constructs/dictionary.js index 1db90c05..802e642e 100644 --- a/lib/constructs/dictionary.js +++ b/lib/constructs/dictionary.js @@ -55,7 +55,7 @@ class Dictionary { if (field.required) { str += ` else { - throw new TypeError("${field.name} is required in '${this.name}'"); + throw new ctorRegistry["%TypeError%"]("${field.name} is required in '${this.name}'"); } `; } else if (field.default) { @@ -76,12 +76,12 @@ class Dictionary { generate() { this.str += ` - exports._convertInherit = (obj, ret, { context = "The provided value" } = {}) => { + exports._convertInherit = (obj, ret, { context = "The provided value", ctorRegistry } = {}) => { `; if (this.idl.inheritance) { this.str += ` - ${this.idl.inheritance}._convertInherit(obj, ret, { context }); + ${this.idl.inheritance}._convertInherit(obj, ret, { context, ctorRegistry }); `; } @@ -89,13 +89,13 @@ class Dictionary { ${this._generateConversions()} }; - exports.convert = function convert(obj, { context = "The provided value" } = {}) { + exports.convert = (obj, { context = "The provided value", ctorRegistry = { "%TypeError%": TypeError, "%Number%": Number, "%Promise%": Promise, "%String%": String } } = {}) => { if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry["%TypeError%"](\`\${context} is not an object.\`); } const ret = Object.create(null); - exports._convertInherit(obj, ret, { context }); + exports._convertInherit(obj, ret, { context, ctorRegistry }); return ret; }; `; diff --git a/lib/constructs/enumeration.js b/lib/constructs/enumeration.js index 20e13af0..211ab29f 100644 --- a/lib/constructs/enumeration.js +++ b/lib/constructs/enumeration.js @@ -18,10 +18,10 @@ class Enumeration { const enumerationValues = new Set(${JSON.stringify([...values])}); exports.enumerationValues = enumerationValues; - exports.convert = function convert(value, { context = "The provided value" } = {}) { + exports.convert = (value, { context = "The provided value", ctorRegistry = { "%TypeError%": TypeError } } = {}) => { const string = \`\${value}\`; if (!enumerationValues.has(string)) { - throw new TypeError(\`\${context} '\${string}' is not a valid enumeration value for ${this.name}\`); + throw new ctorRegistry["%TypeError%"](\`\${context} '\${string}' is not a valid enumeration value for ${this.name}\`); } return string; }; diff --git a/lib/constructs/interface.js b/lib/constructs/interface.js index 3f20d12d..9fc0fb73 100644 --- a/lib/constructs/interface.js +++ b/lib/constructs/interface.js @@ -434,12 +434,12 @@ class Interface { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject(new TypeError("next() called on a value that is not a ${this.name} async iterator object")); + return ctorRegistry["%Promise%"].reject(new ctorRegistry["%TypeError%"]("next() called on a value that is not a ${this.name} async iterator object")); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry["%Promise%"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -481,12 +481,12 @@ class Interface { return(value) { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject(new TypeError("return() called on a value that is not a ${this.name} async iterator object")); + return ctorRegistry["%Promise%"].reject(new ctorRegistry["%TypeError%"]("return() called on a value that is not a ${this.name} async iterator object")); } const returnSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value, done: true }); + return ctorRegistry["%Promise%"].resolve({ value, done: true }); } internal.isFinished = true; @@ -516,7 +516,7 @@ class Interface { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - throw new TypeError("next() called on a value that is not a ${this.name} iterator object"); + throw new ctorRegistry["%TypeError%"]("next() called on a value that is not a ${this.name} iterator object"); } const { target, kind, index } = internal; @@ -600,11 +600,11 @@ class Interface { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; - exports.convert = (value, { context = "The provided value" } = {}) => { + exports.convert = (value, { context = "The provided value", ctorRegistry = { "%TypeError%": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type '${this.name}'.\`); + throw new ctorRegistry["%TypeError%"](\`\${context} is not of type '${this.name}'.\`); }; `; @@ -1358,7 +1358,7 @@ class Interface { `; } else { body = ` - throw new TypeError("Illegal constructor"); + throw new ctorRegistry["%TypeError%"]("Illegal constructor"); `; } diff --git a/lib/constructs/iterable.js b/lib/constructs/iterable.js index 6cddb05e..3c6f2958 100644 --- a/lib/constructs/iterable.js +++ b/lib/constructs/iterable.js @@ -25,7 +25,7 @@ class Iterable { generateFunction(key, kind) { this.interface.addMethod(this.interface.defaultWhence, key, [], ` if (!exports.is(this)) { - throw new TypeError("'${key}' called on an object that is not a valid instance of ${this.interface.name}."); + throw new ctorRegistry["%TypeError%"]("'${key}' called on an object that is not a valid instance of ${this.interface.name}."); } return exports.createDefaultIterator(globalObject, this, "${kind}"); `); @@ -42,14 +42,14 @@ class Iterable { this.interface.addProperty(whence, Symbol.iterator, `${this.interface.name}.prototype.entries`); this.interface.addMethod(whence, "forEach", ["callback"], ` if (!exports.is(this)) { - throw new TypeError("'forEach' called on an object that is not a valid instance of ${this.interface.name}."); + throw new ctorRegistry["%TypeError%"]("'forEach' called on an object that is not a valid instance of ${this.interface.name}."); } if (arguments.length < 1) { - throw new TypeError("Failed to execute 'forEach' on '${this.name}': 1 argument required, " + - "but only 0 present."); + throw new ctorRegistry["%TypeError%"]("Failed to execute 'forEach' on '${this.name}': 1 argument required, but only 0 present."); } callback = ${requires.addRelative("Function")}.convert(callback, { - context: "Failed to execute 'forEach' on '${this.name}': The callback provided as parameter 1" + context: "Failed to execute 'forEach' on '${this.name}': The callback provided as parameter 1", + ctorRegistry }); const thisArg = arguments[1]; let pairs = Array.from(this[implSymbol]); diff --git a/lib/constructs/operation.js b/lib/constructs/operation.js index 56b613be..cf1947fc 100644 --- a/lib/constructs/operation.js +++ b/lib/constructs/operation.js @@ -97,7 +97,7 @@ class Operation { const whence = this.getWhence(); const async = this.isAsync(); const promiseHandlingBefore = async ? `try {` : ``; - const promiseHandlingAfter = async ? `} catch (e) { return Promise.reject(e); }` : ``; + const promiseHandlingAfter = async ? `} catch (e) { return ctorRegistry["%Promise%"].reject(e); }` : ``; const hasCallWithGlobal = this.hasCallWithGlobal(); const type = this.static ? "static operation" : "regular operation"; @@ -115,7 +115,7 @@ class Operation { str += ` const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError("'${this.name}' called on an object that is not a valid instance of ${this.interface.name}."); + throw new ctorRegistry["%TypeError%"]("'${this.name}' called on an object that is not a valid instance of ${this.interface.name}."); } `; } diff --git a/lib/output/utils.js b/lib/output/utils.js index d6ddefd0..9d879587 100644 --- a/lib/output/utils.js +++ b/lib/output/utils.js @@ -24,7 +24,14 @@ const sameObjectCaches = Symbol("SameObject caches"); const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry"); // This only contains the intrinsic names that are referenced from the `ctorRegistry`: -const intrinsicConstructors = ["Array"]; +const intrinsicConstructors = [ + "Array", + // Number and String are used by `webidl-conversions` + "Number", + "Promise", + "String", + "TypeError" +]; function initCtorRegistry(globalObject) { if (hasOwn(globalObject, ctorRegistrySymbol)) { @@ -45,6 +52,16 @@ function initCtorRegistry(globalObject) { return ctorRegistry; } +// The result is used as the `globals` property of the `options` parameter for `webidl-conversions`: +function conversionGlobalsFromCtorRegistry(ctorRegistry) { + const globals = Object.create(null); + for (const intrinsic of intrinsicConstructors) { + globals[intrinsic] = ctorRegistry[`%${intrinsic}%`]; + } + + return globals; +} + function getSameObject(wrapper, prop, creator) { if (!wrapper[sameObjectCaches]) { wrapper[sameObjectCaches] = Object.create(null); @@ -148,6 +165,7 @@ module.exports = exports = { getSameObject, ctorRegistrySymbol, initCtorRegistry, + conversionGlobalsFromCtorRegistry, wrapperForImpl, implForWrapper, tryWrapperForImpl, diff --git a/lib/parameters.js b/lib/parameters.js index 0197441f..5c073b3e 100644 --- a/lib/parameters.js +++ b/lib/parameters.js @@ -113,8 +113,7 @@ module.exports.generateOverloadConversions = function (ctx, typeOfOp, name, pare const plural = minArgs > 1 ? "s" : ""; str += ` if (arguments.length < ${minArgs}) { - throw new TypeError("${errPrefix}${minArgs} argument${plural} required, but only " + arguments.length + - " present."); + throw new ctorRegistry["%TypeError%"](\`${errPrefix}${minArgs} argument${plural} required, but only \${arguments.length} present.\`); } `; } @@ -127,7 +126,7 @@ module.exports.generateOverloadConversions = function (ctx, typeOfOp, name, pare .filter(o => o.typeList.length === numArgs); if (S.length === 0) { switchCases.push(` - throw new TypeError("${errPrefix}only " + arguments.length + " arguments present."); + throw new ctorRegistry["%TypeError%"](\`${errPrefix}only \${arguments.length} arguments present.\`); `); continue; } @@ -303,7 +302,7 @@ module.exports.generateOverloadConversions = function (ctx, typeOfOp, name, pare } else if (any.length) { possibilities.push(`{ ${continued(any[0], i)} }`); } else { - possibilities.push(`throw new TypeError("${errPrefix}No such overload");`); + possibilities.push(`throw new ctorRegistry["%TypeError%"]("${errPrefix}No such overload");`); } caseSrc += possibilities.join(" else "); diff --git a/lib/types.js b/lib/types.js index 13446014..74b07c34 100644 --- a/lib/types.js +++ b/lib/types.js @@ -147,7 +147,7 @@ function generateTypeConversion( conversions[idlType.idlType] ) { // string or number type compatible with webidl-conversions - generateGeneric(`conversions["${idlType.idlType}"]`); + generateGeneric(`conversions["${idlType.idlType}"]`, "globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry)"); } else if (resolvedTypes.has(ctx.typeOf(idlType.idlType))) { // callback functions, callback interfaces, dictionaries, enumerations, and interfaces let fn; @@ -158,7 +158,7 @@ function generateTypeConversion( } else { fn = `exports.convert`; } - generateGeneric(fn); + generateGeneric(fn, "ctorRegistry"); } else { // unknown // Try to get the impl anyway. @@ -337,7 +337,7 @@ function generateTypeConversion( code += conv.body; requires.merge(conv.requires); } else { - code += `throw new TypeError(${errPrefix} + " is not of any supported type.")`; + code += `throw new ctorRegistry["%TypeError%"](${errPrefix} + " is not of any supported type.")`; } code += "}"; output.push(code); @@ -359,7 +359,7 @@ function generateTypeConversion( str += ` if (!utils.isObject(${name})) { - throw new TypeError(${errPrefix} + " is not an iterable object."); + throw new ctorRegistry["%TypeError%"](${errPrefix} + " is not an iterable object."); } else { const V = []; const tmp = ${name}; @@ -394,7 +394,7 @@ function generateTypeConversion( str += ` if (!utils.isObject(${name})) { - throw new TypeError(${errPrefix} + " is not an object."); + throw new ctorRegistry["%TypeError%"](${errPrefix} + " is not an object."); } else { const result = Object.create(null); for (const key of Reflect.ownKeys(${name})) { @@ -414,7 +414,7 @@ function generateTypeConversion( } function generatePromise() { - str += `${name} = new Promise(resolve => resolve(${name}));`; + str += `${name} = new ctorRegistry["%Promise%"](resolve => resolve(${name}));`; } function generateFrozenArray() { @@ -422,12 +422,12 @@ function generateTypeConversion( str += `${name} = Object.freeze(${name});`; } - function generateGeneric(conversionFn) { + function generateGeneric(conversionFn, globalsParam) { const enforceRange = utils.getExtAttr(extAttrs, "EnforceRange"); const clamp = utils.getExtAttr(extAttrs, "Clamp"); const nullToEmptyString = utils.getExtAttr(extAttrs, "LegacyNullToEmptyString"); - let optString = `context: ${errPrefix},`; + let optString = `context: ${errPrefix}, ${globalsParam},`; if (clamp) { optString += "clamp: true,"; } diff --git a/test/__snapshots__/test.js.snap b/test/__snapshots__/test.js.snap index c2f16237..9dea2b4e 100644 --- a/test/__snapshots__/test.js.snap +++ b/test/__snapshots__/test.js.snap @@ -6,9 +6,15 @@ exports[`generation built-in types Function 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (typeof value !== \\"function\\") { - throw new TypeError(context + \\" is not a function\\"); + throw new ctorRegistry[\\"%TypeError%\\"](context + \\" is not a function\\"); } function invokeTheCallbackFunction(...args) { @@ -21,7 +27,10 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { callResult = Reflect.apply(value, thisArg, args); - callResult = conversions[\\"any\\"](callResult, { context: context }); + callResult = conversions[\\"any\\"](callResult, { + context: context, + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); return callResult; } @@ -33,7 +42,10 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { let callResult = Reflect.construct(value, args); - callResult = conversions[\\"any\\"](callResult, { context: context }); + callResult = conversions[\\"any\\"](callResult, { + context: context, + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); return callResult; }; @@ -52,9 +64,15 @@ exports[`generation built-in types VoidFunction 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (typeof value !== \\"function\\") { - throw new TypeError(context + \\" is not a function\\"); + throw new ctorRegistry[\\"%TypeError%\\"](context + \\" is not a function\\"); } function invokeTheCallbackFunction() { @@ -82,9 +100,15 @@ exports[`generation with processors AsyncCallbackFunction.webidl 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (typeof value !== \\"function\\") { - throw new TypeError(context + \\" is not a function\\"); + throw new ctorRegistry[\\"%TypeError%\\"](context + \\" is not a function\\"); } function invokeTheCallbackFunction() { @@ -94,17 +118,17 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { try { callResult = Reflect.apply(value, thisArg, []); - callResult = new Promise(resolve => resolve(callResult)); + callResult = new ctorRegistry[\\"%Promise%\\"](resolve => resolve(callResult)); return callResult; } catch (err) { - return Promise.reject(err); + return ctorRegistry[\\"%Promise%\\"].reject(err); } } invokeTheCallbackFunction.construct = () => { let callResult = Reflect.construct(value, []); - callResult = new Promise(resolve => resolve(callResult)); + callResult = new ctorRegistry[\\"%Promise%\\"](resolve => resolve(callResult)); return callResult; }; @@ -122,9 +146,15 @@ exports[`generation with processors AsyncCallbackInterface.webidl 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = function convert(value, { context = \\"The provided value\\" } = {}) { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (!utils.isObject(value)) { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not an object.\`); } function callTheUserObjectsOperation() { @@ -136,17 +166,17 @@ exports.convert = function convert(value, { context = \\"The provided value\\" } if (typeof O !== \\"function\\") { X = O[\\"asyncMethod\\"]; if (typeof X !== \\"function\\") { - throw new TypeError(\`\${context} does not correctly implement AsyncCallbackInterface.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} does not correctly implement AsyncCallbackInterface.\`); } thisArg = O; } let callResult = Reflect.apply(X, thisArg, []); - callResult = new Promise(resolve => resolve(callResult)); + callResult = new ctorRegistry[\\"%Promise%\\"](resolve => resolve(callResult)); return callResult; } catch (err) { - return Promise.reject(err); + return ctorRegistry[\\"%Promise%\\"].reject(err); } } @@ -178,11 +208,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'AsyncIterablePairArgs'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'AsyncIterablePairArgs'.\`); }; exports.createDefaultAsyncIterator = (globalObject, target, kind) => { @@ -263,19 +293,22 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class AsyncIterablePairArgs { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } keys() { if (!exports.is(this)) { - throw new TypeError(\\"'keys' called on an object that is not a valid instance of AsyncIterablePairArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'keys' called on an object that is not a valid instance of AsyncIterablePairArgs.\\" + ); } const args = []; if (arguments[0] !== undefined) { args[0] = arguments[0]; args[0] = conversions[\\"boolean\\"](args[0], { - context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 1\\" + context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[0] = false; @@ -284,14 +317,16 @@ exports.install = (globalObject, globalNames) => { if (arguments[1] !== undefined) { args[1] = arguments[1]; args[1] = conversions[\\"DOMString\\"](args[1], { - context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 2\\" + context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[1] = undefined; } args[2] = arguments[2]; args[2] = Dictionary.convert(args[2], { - context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 3\\" + context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 3\\", + ctorRegistry }); const asyncIterator = exports.createDefaultAsyncIterator(globalObject, this, \\"key\\"); @@ -303,14 +338,17 @@ exports.install = (globalObject, globalNames) => { values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of AsyncIterablePairArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of AsyncIterablePairArgs.\\" + ); } const args = []; if (arguments[0] !== undefined) { args[0] = arguments[0]; args[0] = conversions[\\"boolean\\"](args[0], { - context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 1\\" + context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[0] = false; @@ -319,14 +357,16 @@ exports.install = (globalObject, globalNames) => { if (arguments[1] !== undefined) { args[1] = arguments[1]; args[1] = conversions[\\"DOMString\\"](args[1], { - context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 2\\" + context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[1] = undefined; } args[2] = arguments[2]; args[2] = Dictionary.convert(args[2], { - context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 3\\" + context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 3\\", + ctorRegistry }); const asyncIterator = exports.createDefaultAsyncIterator(globalObject, this, \\"value\\"); @@ -338,14 +378,17 @@ exports.install = (globalObject, globalNames) => { entries() { if (!exports.is(this)) { - throw new TypeError(\\"'entries' called on an object that is not a valid instance of AsyncIterablePairArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'entries' called on an object that is not a valid instance of AsyncIterablePairArgs.\\" + ); } const args = []; if (arguments[0] !== undefined) { args[0] = arguments[0]; args[0] = conversions[\\"boolean\\"](args[0], { - context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 1\\" + context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[0] = false; @@ -354,14 +397,16 @@ exports.install = (globalObject, globalNames) => { if (arguments[1] !== undefined) { args[1] = arguments[1]; args[1] = conversions[\\"DOMString\\"](args[1], { - context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 2\\" + context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[1] = undefined; } args[2] = arguments[2]; args[2] = Dictionary.convert(args[2], { - context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 3\\" + context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 3\\", + ctorRegistry }); const asyncIterator = exports.createDefaultAsyncIterator(globalObject, this, \\"key+value\\"); @@ -393,14 +438,16 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"next() called on a value that is not a AsyncIterablePairArgs async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a AsyncIterablePairArgs async iterator object\\" + ) ); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -458,11 +505,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'AsyncIterablePairNoArgs'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'AsyncIterablePairNoArgs'.\`); }; exports.createDefaultAsyncIterator = (globalObject, target, kind) => { @@ -543,12 +590,14 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class AsyncIterablePairNoArgs { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } keys() { if (!exports.is(this)) { - throw new TypeError(\\"'keys' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'keys' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\" + ); } const args = []; @@ -562,7 +611,9 @@ exports.install = (globalObject, globalNames) => { values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\" + ); } const args = []; @@ -576,7 +627,9 @@ exports.install = (globalObject, globalNames) => { entries() { if (!exports.is(this)) { - throw new TypeError(\\"'entries' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'entries' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\" + ); } const args = []; @@ -610,14 +663,16 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"next() called on a value that is not a AsyncIterablePairNoArgs async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a AsyncIterablePairNoArgs async iterator object\\" + ) ); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -676,11 +731,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'AsyncIterableValueArgs'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'AsyncIterableValueArgs'.\`); }; exports.createDefaultAsyncIterator = (globalObject, target, kind) => { @@ -761,19 +816,22 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class AsyncIterableValueArgs { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of AsyncIterableValueArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of AsyncIterableValueArgs.\\" + ); } const args = []; if (arguments[0] !== undefined) { args[0] = arguments[0]; args[0] = URL.convert(args[0], { - context: \\"Failed to execute 'values' on 'AsyncIterableValueArgs': parameter 1\\" + context: \\"Failed to execute 'values' on 'AsyncIterableValueArgs': parameter 1\\", + ctorRegistry }); } else { args[0] = undefined; @@ -806,14 +864,16 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"next() called on a value that is not a AsyncIterableValueArgs async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a AsyncIterableValueArgs async iterator object\\" + ) ); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -871,11 +931,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'AsyncIterableValueNoArgs'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'AsyncIterableValueNoArgs'.\`); }; exports.createDefaultAsyncIterator = (globalObject, target, kind) => { @@ -956,12 +1016,14 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class AsyncIterableValueNoArgs { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of AsyncIterableValueNoArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of AsyncIterableValueNoArgs.\\" + ); } const args = []; @@ -993,14 +1055,16 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"next() called on a value that is not a AsyncIterableValueNoArgs async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a AsyncIterableValueNoArgs async iterator object\\" + ) ); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -1059,11 +1123,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'AsyncIterableWithReturn'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'AsyncIterableWithReturn'.\`); }; exports.createDefaultAsyncIterator = (globalObject, target, kind) => { @@ -1144,18 +1208,21 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class AsyncIterableWithReturn { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of AsyncIterableWithReturn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of AsyncIterableWithReturn.\\" + ); } const args = []; args[0] = arguments[0]; args[0] = Dictionary.convert(args[0], { - context: \\"Failed to execute 'values' on 'AsyncIterableWithReturn': parameter 1\\" + context: \\"Failed to execute 'values' on 'AsyncIterableWithReturn': parameter 1\\", + ctorRegistry }); const asyncIterator = exports.createDefaultAsyncIterator(globalObject, this, \\"value\\"); @@ -1185,14 +1252,16 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"next() called on a value that is not a AsyncIterableWithReturn async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a AsyncIterableWithReturn async iterator object\\" + ) ); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -1222,14 +1291,16 @@ exports.install = (globalObject, globalNames) => { return(value) { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"return() called on a value that is not a AsyncIterableWithReturn async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"return() called on a value that is not a AsyncIterableWithReturn async iterator object\\" + ) ); } const returnSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value, done: true }); } internal.isFinished = true; @@ -1273,11 +1344,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'BufferSourceTypes'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'BufferSourceTypes'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -1347,20 +1418,20 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class BufferSourceTypes { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } bs(source) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'bs' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'bs' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'bs' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'bs' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -1369,7 +1440,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'bs' on 'BufferSourceTypes': parameter 1\\" + \\" is not of any supported type.\\" ); } @@ -1381,21 +1452,22 @@ exports.install = (globalObject, globalNames) => { ab(ab) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'ab' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'ab' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'ab' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'ab' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"ArrayBuffer\\"](curArg, { - context: \\"Failed to execute 'ab' on 'BufferSourceTypes': parameter 1\\" + context: \\"Failed to execute 'ab' on 'BufferSourceTypes': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -1405,14 +1477,14 @@ exports.install = (globalObject, globalNames) => { abv(abv) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'abv' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'abv' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'abv' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'abv' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -1420,7 +1492,7 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[0]; if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'abv' on 'BufferSourceTypes': parameter 1\\" + \\" is not of any supported type.\\" ); } @@ -1432,21 +1504,22 @@ exports.install = (globalObject, globalNames) => { u8a(u8) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'u8a' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'u8a' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'u8a' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'u8a' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"Uint8Array\\"](curArg, { - context: \\"Failed to execute 'u8a' on 'BufferSourceTypes': parameter 1\\" + context: \\"Failed to execute 'u8a' on 'BufferSourceTypes': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -1456,14 +1529,14 @@ exports.install = (globalObject, globalNames) => { abUnion(ab) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'abUnion' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'abUnion' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'abUnion' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'abUnion' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -1472,7 +1545,8 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'abUnion' on 'BufferSourceTypes': parameter 1\\" + context: \\"Failed to execute 'abUnion' on 'BufferSourceTypes': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); @@ -1483,14 +1557,14 @@ exports.install = (globalObject, globalNames) => { u8aUnion(ab) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'u8aUnion' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'u8aUnion' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'u8aUnion' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'u8aUnion' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -1499,7 +1573,8 @@ exports.install = (globalObject, globalNames) => { if (ArrayBuffer.isView(curArg) && curArg.constructor.name === \\"Uint8Array\\") { } else { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'u8aUnion' on 'BufferSourceTypes': parameter 1\\" + context: \\"Failed to execute 'u8aUnion' on 'BufferSourceTypes': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); @@ -1547,11 +1622,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'CEReactions'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'CEReactions'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -1634,13 +1709,15 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class CEReactions { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } method() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'method' called on an object that is not a valid instance of CEReactions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'method' called on an object that is not a valid instance of CEReactions.\\" + ); } CEReactions.preSteps(globalObject); @@ -1655,7 +1732,9 @@ exports.install = (globalObject, globalNames) => { try { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'promiseOperation' called on an object that is not a valid instance of CEReactions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'promiseOperation' called on an object that is not a valid instance of CEReactions.\\" + ); } CEReactions.preSteps(globalObject); @@ -1665,7 +1744,7 @@ exports.install = (globalObject, globalNames) => { CEReactions.postSteps(globalObject); } } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } @@ -1673,7 +1752,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get attr' called on an object that is not a valid instance of CEReactions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get attr' called on an object that is not a valid instance of CEReactions.\\" + ); } CEReactions.preSteps(globalObject); @@ -1688,11 +1769,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set attr' called on an object that is not a valid instance of CEReactions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set attr' called on an object that is not a valid instance of CEReactions.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'attr' property on 'CEReactions': The provided value\\" + context: \\"Failed to set the 'attr' property on 'CEReactions': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); CEReactions.preSteps(globalObject); @@ -1708,7 +1792,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get promiseAttribute' called on an object that is not a valid instance of CEReactions.\\" ); } @@ -1720,7 +1804,7 @@ exports.install = (globalObject, globalNames) => { CEReactions.postSteps(globalObject); } } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } } @@ -1831,7 +1915,8 @@ class ProxyHandler { let namedValue = V; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'CEReactions': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'CEReactions': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); CEReactions.preSteps(globalObject); @@ -1897,7 +1982,8 @@ class ProxyHandler { let namedValue = desc.value; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'CEReactions': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'CEReactions': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); CEReactions.preSteps(globalObject); @@ -1957,12 +2043,12 @@ const URLCallback = require(\\"./URLCallback.js\\"); const URLHandlerNonNull = require(\\"./URLHandlerNonNull.js\\"); const VoidFunction = require(\\"./VoidFunction.js\\"); -exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {}) => { +exports._convertInherit = (obj, ret, { context = \\"The provided value\\", ctorRegistry } = {}) => { { const key = \\"function\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = Function.convert(value, { context: context + \\" has member 'function' that\\" }); + value = Function.convert(value, { context: context + \\" has member 'function' that\\", ctorRegistry }); ret[key] = value; } @@ -1972,7 +2058,7 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} const key = \\"urlCallback\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = URLCallback.convert(value, { context: context + \\" has member 'urlCallback' that\\" }); + value = URLCallback.convert(value, { context: context + \\" has member 'urlCallback' that\\", ctorRegistry }); ret[key] = value; } @@ -1985,7 +2071,7 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} if (!utils.isObject(value)) { value = null; } else { - value = URLHandlerNonNull.convert(value, { context: context + \\" has member 'urlHandler' that\\" }); + value = URLHandlerNonNull.convert(value, { context: context + \\" has member 'urlHandler' that\\", ctorRegistry }); } ret[key] = value; } @@ -1995,7 +2081,10 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} const key = \\"urlHandlerNonNull\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = URLHandlerNonNull.convert(value, { context: context + \\" has member 'urlHandlerNonNull' that\\" }); + value = URLHandlerNonNull.convert(value, { + context: context + \\" has member 'urlHandlerNonNull' that\\", + ctorRegistry + }); ret[key] = value; } @@ -2005,20 +2094,26 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} const key = \\"voidFunction\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = VoidFunction.convert(value, { context: context + \\" has member 'voidFunction' that\\" }); + value = VoidFunction.convert(value, { context: context + \\" has member 'voidFunction' that\\", ctorRegistry }); ret[key] = value; } } }; -exports.convert = function convert(obj, { context = \\"The provided value\\" } = {}) { +exports.convert = ( + obj, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (obj !== undefined && typeof obj !== \\"object\\" && typeof obj !== \\"function\\") { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not an object.\`); } const ret = Object.create(null); - exports._convertInherit(obj, ret, { context }); + exports._convertInherit(obj, ret, { context, ctorRegistry }); return ret; }; " @@ -2041,11 +2136,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'DOMImplementation'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'DOMImplementation'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -2115,43 +2210,44 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class DOMImplementation { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } createDocumentType(qualifiedName, publicId, systemId) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'createDocumentType' called on an object that is not a valid instance of DOMImplementation.\\" ); } if (arguments.length < 3) { - throw new TypeError( - \\"Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 1\\" + context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 2\\" + context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[2]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 3\\" + context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 3\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -2161,14 +2257,14 @@ exports.install = (globalObject, globalNames) => { createDocument(namespace, qualifiedName) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'createDocument' called on an object that is not a valid instance of DOMImplementation.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'createDocument' called on an object that is not a valid instance of DOMImplementation.\\" + ); } if (arguments.length < 2) { - throw new TypeError( - \\"Failed to execute 'createDocument' on 'DOMImplementation': 2 arguments required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'createDocument' on 'DOMImplementation': 2 arguments required, but only \${arguments.length} present.\` ); } const args = []; @@ -2178,7 +2274,8 @@ exports.install = (globalObject, globalNames) => { curArg = null; } else { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'createDocument' on 'DOMImplementation': parameter 1\\" + context: \\"Failed to execute 'createDocument' on 'DOMImplementation': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); @@ -2187,6 +2284,7 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'createDocument' on 'DOMImplementation': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), treatNullAsEmptyString: true }); args.push(curArg); @@ -2210,7 +2308,7 @@ exports.install = (globalObject, globalNames) => { createHTMLDocument() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'createHTMLDocument' called on an object that is not a valid instance of DOMImplementation.\\" ); } @@ -2219,7 +2317,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[0]; if (curArg !== undefined) { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'createHTMLDocument' on 'DOMImplementation': parameter 1\\" + context: \\"Failed to execute 'createHTMLDocument' on 'DOMImplementation': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); @@ -2230,7 +2329,9 @@ exports.install = (globalObject, globalNames) => { hasFeature() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'hasFeature' called on an object that is not a valid instance of DOMImplementation.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'hasFeature' called on an object that is not a valid instance of DOMImplementation.\\" + ); } return esValue[implSymbol].hasFeature(); @@ -2274,11 +2375,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'DOMRect'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'DOMRect'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -2353,7 +2454,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[0]; if (curArg !== undefined) { curArg = conversions[\\"unrestricted double\\"](curArg, { - context: \\"Failed to construct 'DOMRect': parameter 1\\" + context: \\"Failed to construct 'DOMRect': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = 0; @@ -2364,7 +2466,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[1]; if (curArg !== undefined) { curArg = conversions[\\"unrestricted double\\"](curArg, { - context: \\"Failed to construct 'DOMRect': parameter 2\\" + context: \\"Failed to construct 'DOMRect': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = 0; @@ -2375,7 +2478,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[2]; if (curArg !== undefined) { curArg = conversions[\\"unrestricted double\\"](curArg, { - context: \\"Failed to construct 'DOMRect': parameter 3\\" + context: \\"Failed to construct 'DOMRect': parameter 3\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = 0; @@ -2386,7 +2490,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[3]; if (curArg !== undefined) { curArg = conversions[\\"unrestricted double\\"](curArg, { - context: \\"Failed to construct 'DOMRect': parameter 4\\" + context: \\"Failed to construct 'DOMRect': parameter 4\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = 0; @@ -2400,7 +2505,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get x' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get x' called on an object that is not a valid instance of DOMRect.\\"); } return esValue[implSymbol][\\"x\\"]; @@ -2410,11 +2515,12 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set x' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set x' called on an object that is not a valid instance of DOMRect.\\"); } V = conversions[\\"unrestricted double\\"](V, { - context: \\"Failed to set the 'x' property on 'DOMRect': The provided value\\" + context: \\"Failed to set the 'x' property on 'DOMRect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"x\\"] = V; @@ -2424,7 +2530,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get y' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get y' called on an object that is not a valid instance of DOMRect.\\"); } return esValue[implSymbol][\\"y\\"]; @@ -2434,11 +2540,12 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set y' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set y' called on an object that is not a valid instance of DOMRect.\\"); } V = conversions[\\"unrestricted double\\"](V, { - context: \\"Failed to set the 'y' property on 'DOMRect': The provided value\\" + context: \\"Failed to set the 'y' property on 'DOMRect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"y\\"] = V; @@ -2448,7 +2555,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get width' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get width' called on an object that is not a valid instance of DOMRect.\\" + ); } return esValue[implSymbol][\\"width\\"]; @@ -2458,11 +2567,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set width' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set width' called on an object that is not a valid instance of DOMRect.\\" + ); } V = conversions[\\"unrestricted double\\"](V, { - context: \\"Failed to set the 'width' property on 'DOMRect': The provided value\\" + context: \\"Failed to set the 'width' property on 'DOMRect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"width\\"] = V; @@ -2472,7 +2584,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get height' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get height' called on an object that is not a valid instance of DOMRect.\\" + ); } return esValue[implSymbol][\\"height\\"]; @@ -2482,11 +2596,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set height' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set height' called on an object that is not a valid instance of DOMRect.\\" + ); } V = conversions[\\"unrestricted double\\"](V, { - context: \\"Failed to set the 'height' property on 'DOMRect': The provided value\\" + context: \\"Failed to set the 'height' property on 'DOMRect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"height\\"] = V; @@ -2496,7 +2613,10 @@ exports.install = (globalObject, globalNames) => { const args = []; { let curArg = arguments[0]; - curArg = Dictionary.convert(curArg, { context: \\"Failed to execute 'fromRect' on 'DOMRect': parameter 1\\" }); + curArg = Dictionary.convert(curArg, { + context: \\"Failed to execute 'fromRect' on 'DOMRect': parameter 1\\", + ctorRegistry + }); args.push(curArg); } return utils.tryWrapperForImpl(Impl.implementation.fromRect(globalObject, ...args)); @@ -2540,12 +2660,15 @@ const utils = require(\\"./utils.js\\"); const URL = require(\\"./URL.js\\"); const URLSearchParams = require(\\"./URLSearchParams.js\\"); -exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {}) => { +exports._convertInherit = (obj, ret, { context = \\"The provided value\\", ctorRegistry } = {}) => { { const key = \\"boolWithDefault\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = conversions[\\"boolean\\"](value, { context: context + \\" has member 'boolWithDefault' that\\" }); + value = conversions[\\"boolean\\"](value, { + context: context + \\" has member 'boolWithDefault' that\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); ret[key] = value; } else { @@ -2557,11 +2680,11 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} const key = \\"requiredInterface\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = URL.convert(value, { context: context + \\" has member 'requiredInterface' that\\" }); + value = URL.convert(value, { context: context + \\" has member 'requiredInterface' that\\", ctorRegistry }); ret[key] = value; } else { - throw new TypeError(\\"requiredInterface is required in 'Dictionary'\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"requiredInterface is required in 'Dictionary'\\"); } } @@ -2570,12 +2693,15 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { if (!utils.isObject(value)) { - throw new TypeError(context + \\" has member 'seq' that\\" + \\" is not an iterable object.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](context + \\" has member 'seq' that\\" + \\" is not an iterable object.\\"); } else { const V = []; const tmp = value; for (let nextItem of tmp) { - nextItem = URLSearchParams.convert(nextItem, { context: context + \\" has member 'seq' that\\" + \\"'s element\\" }); + nextItem = URLSearchParams.convert(nextItem, { + context: context + \\" has member 'seq' that\\" + \\"'s element\\", + ctorRegistry + }); V.push(nextItem); } @@ -2590,20 +2716,29 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} const key = \\"vanillaString\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = conversions[\\"DOMString\\"](value, { context: context + \\" has member 'vanillaString' that\\" }); + value = conversions[\\"DOMString\\"](value, { + context: context + \\" has member 'vanillaString' that\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); ret[key] = value; } } }; -exports.convert = function convert(obj, { context = \\"The provided value\\" } = {}) { +exports.convert = ( + obj, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (obj !== undefined && typeof obj !== \\"object\\" && typeof obj !== \\"function\\") { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not an object.\`); } const ret = Object.create(null); - exports._convertInherit(obj, ret, { context }); + exports._convertInherit(obj, ret, { context, ctorRegistry }); return ret; }; " @@ -2627,11 +2762,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'DictionaryConvert'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'DictionaryConvert'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -2701,27 +2836,33 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class DictionaryConvert { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } op() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'op' called on an object that is not a valid instance of DictionaryConvert.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'op' called on an object that is not a valid instance of DictionaryConvert.\\" + ); } const args = []; { let curArg = arguments[0]; if (curArg !== undefined) { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'op' on 'DictionaryConvert': parameter 1\\" + context: \\"Failed to execute 'op' on 'DictionaryConvert': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); } { let curArg = arguments[1]; - curArg = Dictionary.convert(curArg, { context: \\"Failed to execute 'op' on 'DictionaryConvert': parameter 2\\" }); + curArg = Dictionary.convert(curArg, { + context: \\"Failed to execute 'op' on 'DictionaryConvert': parameter 2\\", + ctorRegistry + }); args.push(curArg); } return esValue[implSymbol].op(...args); @@ -2762,11 +2903,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Enum'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Enum'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -2836,24 +2977,27 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Enum { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } op(destination) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'op' called on an object that is not a valid instance of Enum.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'op' called on an object that is not a valid instance of Enum.\\"); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'op' on 'Enum': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'op' on 'Enum': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = RequestDestination.convert(curArg, { context: \\"Failed to execute 'op' on 'Enum': parameter 1\\" }); + curArg = RequestDestination.convert(curArg, { + context: \\"Failed to execute 'op' on 'Enum': parameter 1\\", + ctorRegistry + }); args.push(curArg); } return esValue[implSymbol].op(...args); @@ -2863,7 +3007,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get attr' called on an object that is not a valid instance of Enum.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get attr' called on an object that is not a valid instance of Enum.\\"); } return utils.tryWrapperForImpl(esValue[implSymbol][\\"attr\\"]); @@ -2873,7 +3017,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set attr' called on an object that is not a valid instance of Enum.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set attr' called on an object that is not a valid instance of Enum.\\"); } V = \`\${V}\`; @@ -2908,9 +3052,15 @@ exports[`generation with processors EventListener.webidl 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = function convert(value, { context = \\"The provided value\\" } = {}) { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (!utils.isObject(value)) { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not an object.\`); } function callTheUserObjectsOperation(event) { @@ -2921,7 +3071,7 @@ exports.convert = function convert(value, { context = \\"The provided value\\" } if (typeof O !== \\"function\\") { X = O[\\"handleEvent\\"]; if (typeof X !== \\"function\\") { - throw new TypeError(\`\${context} does not correctly implement EventListener.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} does not correctly implement EventListener.\`); } thisArg = O; } @@ -2959,11 +3109,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'EventTarget'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'EventTarget'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -3039,21 +3189,22 @@ exports.install = (globalObject, globalNames) => { addEventListener(type, callback) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'addEventListener' called on an object that is not a valid instance of EventTarget.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'addEventListener' called on an object that is not a valid instance of EventTarget.\\" + ); } if (arguments.length < 2) { - throw new TypeError( - \\"Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'addEventListener' on 'EventTarget': parameter 1\\" + context: \\"Failed to execute 'addEventListener' on 'EventTarget': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -3063,7 +3214,8 @@ exports.install = (globalObject, globalNames) => { curArg = null; } else { curArg = EventListener.convert(curArg, { - context: \\"Failed to execute 'addEventListener' on 'EventTarget': parameter 2\\" + context: \\"Failed to execute 'addEventListener' on 'EventTarget': parameter 2\\", + ctorRegistry }); } args.push(curArg); @@ -3105,11 +3257,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Global'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Global'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -3140,7 +3292,7 @@ exports._internalSetup = (wrapper, globalObject) => { op() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'op' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'op' called on an object that is not a valid instance of Global.\\"); } return esValue[implSymbol].op(); @@ -3148,7 +3300,9 @@ exports._internalSetup = (wrapper, globalObject) => { unforgeableOp() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'unforgeableOp' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'unforgeableOp' called on an object that is not a valid instance of Global.\\" + ); } return esValue[implSymbol].unforgeableOp(); @@ -3157,7 +3311,7 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get attr' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get attr' called on an object that is not a valid instance of Global.\\"); } return esValue[implSymbol][\\"attr\\"]; @@ -3166,10 +3320,13 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set attr' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set attr' called on an object that is not a valid instance of Global.\\"); } - V = conversions[\\"DOMString\\"](V, { context: \\"Failed to set the 'attr' property on 'Global': The provided value\\" }); + V = conversions[\\"DOMString\\"](V, { + context: \\"Failed to set the 'attr' property on 'Global': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"attr\\"] = V; }, @@ -3177,7 +3334,9 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get unforgeableAttr' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get unforgeableAttr' called on an object that is not a valid instance of Global.\\" + ); } return esValue[implSymbol][\\"unforgeableAttr\\"]; @@ -3186,11 +3345,14 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set unforgeableAttr' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set unforgeableAttr' called on an object that is not a valid instance of Global.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'unforgeableAttr' property on 'Global': The provided value\\" + context: \\"Failed to set the 'unforgeableAttr' property on 'Global': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"unforgeableAttr\\"] = V; @@ -3199,7 +3361,9 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get length' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get length' called on an object that is not a valid instance of Global.\\" + ); } return esValue[implSymbol][\\"length\\"]; @@ -3208,11 +3372,14 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set length' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set length' called on an object that is not a valid instance of Global.\\" + ); } V = conversions[\\"unsigned long\\"](V, { - context: \\"Failed to set the 'length' property on 'Global': The provided value\\" + context: \\"Failed to set the 'length' property on 'Global': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"length\\"] = V; @@ -3273,7 +3440,7 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Global { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } static staticOp() { @@ -3290,7 +3457,8 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'staticAttr' property on 'Global': The provided value\\" + context: \\"Failed to set the 'staticAttr' property on 'Global': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); Impl.implementation[\\"staticAttr\\"] = V; @@ -3329,11 +3497,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'HTMLConstructor'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'HTMLConstructor'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -3439,11 +3607,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'LegacyLenientAttributes'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'LegacyLenientAttributes'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -3513,14 +3681,14 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class LegacyLenientAttributes { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } get lenientSetter() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get lenientSetter' called on an object that is not a valid instance of LegacyLenientAttributes.\\" ); } @@ -3532,7 +3700,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'set lenientSetter' called on an object that is not a valid instance of LegacyLenientAttributes.\\" ); } @@ -3568,7 +3736,8 @@ exports.install = (globalObject, globalNames) => { } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'lenientThis' property on 'LegacyLenientAttributes': The provided value\\" + context: \\"Failed to set the 'lenientThis' property on 'LegacyLenientAttributes': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"lenientThis\\"] = V; @@ -3643,11 +3812,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'LegacyNoInterfaceObject'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'LegacyNoInterfaceObject'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -3717,13 +3886,15 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class LegacyNoInterfaceObject { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } def() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'def' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'def' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\" + ); } return esValue[implSymbol].def(); @@ -3733,7 +3904,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get abc' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get abc' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\" + ); } return esValue[implSymbol][\\"abc\\"]; @@ -3743,11 +3916,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set abc' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set abc' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'abc' property on 'LegacyNoInterfaceObject': The provided value\\" + context: \\"Failed to set the 'abc' property on 'LegacyNoInterfaceObject': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"abc\\"] = V; @@ -3783,11 +3959,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'LegacyUnforgeable'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'LegacyUnforgeable'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -3821,21 +3997,22 @@ function getUnforgeables(globalObject) { assign(url) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'assign' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'assign' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'assign' on 'LegacyUnforgeable': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'assign' on 'LegacyUnforgeable': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'assign' on 'LegacyUnforgeable': parameter 1\\" + context: \\"Failed to execute 'assign' on 'LegacyUnforgeable': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -3845,7 +4022,9 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get href' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get href' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } return esValue[implSymbol][\\"href\\"]; @@ -3854,11 +4033,14 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set href' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set href' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'href' property on 'LegacyUnforgeable': The provided value\\" + context: \\"Failed to set the 'href' property on 'LegacyUnforgeable': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"href\\"] = V; @@ -3866,7 +4048,9 @@ function getUnforgeables(globalObject) { toString() { const esValue = this; if (!exports.is(esValue)) { - throw new TypeError(\\"'toString' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'toString' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } return esValue[implSymbol][\\"href\\"]; @@ -3875,7 +4059,9 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get origin' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get origin' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } return esValue[implSymbol][\\"origin\\"]; @@ -3884,7 +4070,9 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get protocol' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get protocol' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } return esValue[implSymbol][\\"protocol\\"]; @@ -3893,11 +4081,14 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set protocol' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set protocol' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'protocol' property on 'LegacyUnforgeable': The provided value\\" + context: \\"Failed to set the 'protocol' property on 'LegacyUnforgeable': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"protocol\\"] = V; @@ -3962,7 +4153,7 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class LegacyUnforgeable { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } } Object.defineProperties(LegacyUnforgeable.prototype, { @@ -3998,11 +4189,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'LegacyUnforgeableMap'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'LegacyUnforgeableMap'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -4037,7 +4228,9 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get a' called on an object that is not a valid instance of LegacyUnforgeableMap.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get a' called on an object that is not a valid instance of LegacyUnforgeableMap.\\" + ); } return esValue[implSymbol][\\"a\\"]; @@ -4102,7 +4295,7 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class LegacyUnforgeableMap { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } } Object.defineProperties(LegacyUnforgeableMap.prototype, { @@ -4201,7 +4394,8 @@ const proxyHandler = { let namedValue = V; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'LegacyUnforgeableMap': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'LegacyUnforgeableMap': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); const creating = !target[implSymbol][utils.supportsPropertyName](P); @@ -4261,7 +4455,8 @@ const proxyHandler = { let namedValue = desc.value; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'LegacyUnforgeableMap': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'LegacyUnforgeableMap': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); const creating = !target[implSymbol][utils.supportsPropertyName](P); @@ -4315,11 +4510,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'MixedIn'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'MixedIn'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -4389,13 +4584,15 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class MixedIn { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } mixedInOp() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'mixedInOp' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'mixedInOp' called on an object that is not a valid instance of MixedIn.\\" + ); } return esValue[implSymbol].mixedInOp(); @@ -4404,7 +4601,9 @@ exports.install = (globalObject, globalNames) => { ifaceMixinOp() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'ifaceMixinOp' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'ifaceMixinOp' called on an object that is not a valid instance of MixedIn.\\" + ); } return esValue[implSymbol].ifaceMixinOp(); @@ -4414,7 +4613,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get mixedInAttr' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get mixedInAttr' called on an object that is not a valid instance of MixedIn.\\" + ); } return esValue[implSymbol][\\"mixedInAttr\\"]; @@ -4424,11 +4625,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set mixedInAttr' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set mixedInAttr' called on an object that is not a valid instance of MixedIn.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'mixedInAttr' property on 'MixedIn': The provided value\\" + context: \\"Failed to set the 'mixedInAttr' property on 'MixedIn': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"mixedInAttr\\"] = V; @@ -4438,7 +4642,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get ifaceMixinAttr' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get ifaceMixinAttr' called on an object that is not a valid instance of MixedIn.\\" + ); } return esValue[implSymbol][\\"ifaceMixinAttr\\"]; @@ -4448,11 +4654,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set ifaceMixinAttr' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set ifaceMixinAttr' called on an object that is not a valid instance of MixedIn.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'ifaceMixinAttr' property on 'MixedIn': The provided value\\" + context: \\"Failed to set the 'ifaceMixinAttr' property on 'MixedIn': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"ifaceMixinAttr\\"] = V; @@ -4490,9 +4699,15 @@ exports[`generation with processors NodeFilter.webidl 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = function convert(value, { context = \\"The provided value\\" } = {}) { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (!utils.isObject(value)) { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not an object.\`); } function callTheUserObjectsOperation(node) { @@ -4503,7 +4718,7 @@ exports.convert = function convert(value, { context = \\"The provided value\\" } if (typeof O !== \\"function\\") { X = O[\\"acceptNode\\"]; if (typeof X !== \\"function\\") { - throw new TypeError(\`\${context} does not correctly implement NodeFilter.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} does not correctly implement NodeFilter.\`); } thisArg = O; } @@ -4512,7 +4727,10 @@ exports.convert = function convert(value, { context = \\"The provided value\\" } let callResult = Reflect.apply(X, thisArg, [node]); - callResult = conversions[\\"unsigned short\\"](callResult, { context: context }); + callResult = conversions[\\"unsigned short\\"](callResult, { + context: context, + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); return callResult; } @@ -4530,8 +4748,9 @@ exports.install = (globalObject, globalNames) => { return; } + const ctorRegistry = utils.initCtorRegistry(globalObject); const NodeFilter = () => { - throw new TypeError(\\"Illegal invocation\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal invocation\\"); }; Object.defineProperties(NodeFilter, { @@ -4580,11 +4799,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Overloads'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Overloads'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -4663,13 +4882,16 @@ exports.install = (globalObject, globalNames) => { if (URL.is(curArg)) { { let curArg = arguments[0]; - curArg = URL.convert(curArg, { context: \\"Failed to construct 'Overloads': parameter 1\\" }); + curArg = URL.convert(curArg, { context: \\"Failed to construct 'Overloads': parameter 1\\", ctorRegistry }); args.push(curArg); } } else { { let curArg = arguments[0]; - curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to construct 'Overloads': parameter 1\\" }); + curArg = conversions[\\"DOMString\\"](curArg, { + context: \\"Failed to construct 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } } @@ -4681,14 +4903,14 @@ exports.install = (globalObject, globalNames) => { compatible(arg1) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'compatible' called on an object that is not a valid instance of Overloads.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'compatible' called on an object that is not a valid instance of Overloads.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'compatible' on 'Overloads': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'compatible' on 'Overloads': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -4697,7 +4919,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4706,14 +4929,16 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4722,14 +4947,16 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4737,7 +4964,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[2]; if (curArg !== undefined) { curArg = conversions[\\"long\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 3\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 3\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = 0; @@ -4751,14 +4979,14 @@ exports.install = (globalObject, globalNames) => { incompatible1(arg1) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'incompatible1' called on an object that is not a valid instance of Overloads.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'incompatible1' called on an object that is not a valid instance of Overloads.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'incompatible1' on 'Overloads': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'incompatible1' on 'Overloads': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -4768,7 +4996,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"long\\"](curArg, { - context: \\"Failed to execute 'incompatible1' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible1' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4776,7 +5005,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible1' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible1' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4788,14 +5018,14 @@ exports.install = (globalObject, globalNames) => { incompatible2(arg1) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'incompatible2' called on an object that is not a valid instance of Overloads.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'incompatible2' called on an object that is not a valid instance of Overloads.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'incompatible2' on 'Overloads': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'incompatible2' on 'Overloads': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -4804,7 +5034,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4813,14 +5044,16 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4831,14 +5064,14 @@ exports.install = (globalObject, globalNames) => { incompatible3(arg1) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'incompatible3' called on an object that is not a valid instance of Overloads.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'incompatible3' called on an object that is not a valid instance of Overloads.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'incompatible3' on 'Overloads': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'incompatible3' on 'Overloads': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -4847,7 +5080,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4856,7 +5090,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4867,7 +5102,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[1]; if (curArg !== undefined) { curArg = URL.convert(curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\", + ctorRegistry }); } args.push(curArg); @@ -4877,7 +5113,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[1]; if (curArg !== undefined) { curArg = URL.convert(curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\", + ctorRegistry }); } args.push(curArg); @@ -4888,7 +5125,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + \\" is not of any supported type.\\" ); } @@ -4900,7 +5137,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + \\" is not of any supported type.\\" ); } @@ -4910,7 +5147,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4918,22 +5156,24 @@ exports.install = (globalObject, globalNames) => { } break; case 3: - throw new TypeError( - \\"Failed to execute 'incompatible3' on 'Overloads': only \\" + arguments.length + \\" arguments present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'incompatible3' on 'Overloads': only \${arguments.length} arguments present.\` ); break; default: { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"long\\"](curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -4942,7 +5182,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'incompatible3' on 'Overloads': parameter 3\\" + \\" is not of any supported type.\\" ); } @@ -4953,7 +5193,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'incompatible3' on 'Overloads': parameter 4\\" + \\" is not of any supported type.\\" ); } @@ -5000,11 +5240,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'PromiseTypes'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'PromiseTypes'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -5039,14 +5279,14 @@ function getUnforgeables(globalObject) { try { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'unforgeablePromiseOperation' called on an object that is not a valid instance of PromiseTypes.\\" ); } return utils.tryWrapperForImpl(esValue[implSymbol].unforgeablePromiseOperation()); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } }, get unforgeablePromiseAttribute() { @@ -5054,14 +5294,14 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get unforgeablePromiseAttribute' called on an object that is not a valid instance of PromiseTypes.\\" ); } return utils.tryWrapperForImpl(esValue[implSymbol][\\"unforgeablePromiseAttribute\\"]); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } }); @@ -5121,26 +5361,26 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class PromiseTypes { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } voidPromiseConsumer(p) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'voidPromiseConsumer' called on an object that is not a valid instance of PromiseTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'voidPromiseConsumer' called on an object that is not a valid instance of PromiseTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'voidPromiseConsumer' on 'PromiseTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'voidPromiseConsumer' on 'PromiseTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = new Promise(resolve => resolve(curArg)); + curArg = new ctorRegistry[\\"%Promise%\\"](resolve => resolve(curArg)); args.push(curArg); } return esValue[implSymbol].voidPromiseConsumer(...args); @@ -5149,20 +5389,20 @@ exports.install = (globalObject, globalNames) => { promiseConsumer(p) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'promiseConsumer' called on an object that is not a valid instance of PromiseTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'promiseConsumer' called on an object that is not a valid instance of PromiseTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'promiseConsumer' on 'PromiseTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'promiseConsumer' on 'PromiseTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = new Promise(resolve => resolve(curArg)); + curArg = new ctorRegistry[\\"%Promise%\\"](resolve => resolve(curArg)); args.push(curArg); } return esValue[implSymbol].promiseConsumer(...args); @@ -5172,12 +5412,14 @@ exports.install = (globalObject, globalNames) => { try { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'promiseOperation' called on an object that is not a valid instance of PromiseTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'promiseOperation' called on an object that is not a valid instance of PromiseTypes.\\" + ); } return utils.tryWrapperForImpl(esValue[implSymbol].promiseOperation()); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } @@ -5186,14 +5428,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get promiseAttribute' called on an object that is not a valid instance of PromiseTypes.\\" ); } return utils.tryWrapperForImpl(esValue[implSymbol][\\"promiseAttribute\\"]); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } @@ -5201,7 +5443,7 @@ exports.install = (globalObject, globalNames) => { try { return utils.tryWrapperForImpl(Impl.implementation.staticPromiseOperation()); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } @@ -5211,7 +5453,7 @@ exports.install = (globalObject, globalNames) => { return Impl.implementation[\\"staticPromiseAttribute\\"]; } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } } @@ -5257,11 +5499,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Reflect'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Reflect'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -5331,14 +5573,16 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Reflect { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } get reflectedBoolean() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectedBoolean' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectedBoolean' called on an object that is not a valid instance of Reflect.\\" + ); } return esValue[implSymbol].hasAttributeNS(null, \\"reflectedboolean\\"); @@ -5348,11 +5592,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectedBoolean' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectedBoolean' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"boolean\\"](V, { - context: \\"Failed to set the 'reflectedBoolean' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectedBoolean' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); if (V) { @@ -5366,7 +5613,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectedDOMString' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectedDOMString' called on an object that is not a valid instance of Reflect.\\" + ); } const value = esValue[implSymbol].getAttributeNS(null, \\"reflecteddomstring\\"); @@ -5377,11 +5626,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectedDOMString' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectedDOMString' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'reflectedDOMString' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectedDOMString' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol].setAttributeNS(null, \\"reflecteddomstring\\", V); @@ -5391,7 +5643,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectedLong' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectedLong' called on an object that is not a valid instance of Reflect.\\" + ); } const value = parseInt(esValue[implSymbol].getAttributeNS(null, \\"reflectedlong\\")); @@ -5402,11 +5656,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectedLong' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectedLong' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"long\\"](V, { - context: \\"Failed to set the 'reflectedLong' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectedLong' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol].setAttributeNS(null, \\"reflectedlong\\", String(V)); @@ -5416,7 +5673,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectedUnsignedLong' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectedUnsignedLong' called on an object that is not a valid instance of Reflect.\\" + ); } const value = parseInt(esValue[implSymbol].getAttributeNS(null, \\"reflectedunsignedlong\\")); @@ -5427,11 +5686,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectedUnsignedLong' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectedUnsignedLong' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"unsigned long\\"](V, { - context: \\"Failed to set the 'reflectedUnsignedLong' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectedUnsignedLong' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol].setAttributeNS(null, \\"reflectedunsignedlong\\", String(V > 2147483647 ? 0 : V)); @@ -5441,7 +5703,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectedUSVStringURL' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectedUSVStringURL' called on an object that is not a valid instance of Reflect.\\" + ); } const value = esValue[implSymbol].getAttributeNS(null, \\"reflectedusvstringurl\\"); @@ -5456,11 +5720,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectedUSVStringURL' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectedUSVStringURL' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'reflectedUSVStringURL' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectedUSVStringURL' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol].setAttributeNS(null, \\"reflectedusvstringurl\\", V); @@ -5470,7 +5737,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectionTest' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectionTest' called on an object that is not a valid instance of Reflect.\\" + ); } const value = esValue[implSymbol].getAttributeNS(null, \\"reflection\\"); @@ -5481,11 +5750,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectionTest' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectionTest' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'reflectionTest' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectionTest' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol].setAttributeNS(null, \\"reflection\\", V); @@ -5495,7 +5767,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get withUnderscore' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get withUnderscore' called on an object that is not a valid instance of Reflect.\\" + ); } const value = esValue[implSymbol].getAttributeNS(null, \\"with-underscore\\"); @@ -5506,11 +5780,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set withUnderscore' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set withUnderscore' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'withUnderscore' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'withUnderscore' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol].setAttributeNS(null, \\"with-underscore\\", V); @@ -5556,11 +5833,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Replaceable'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Replaceable'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -5630,14 +5907,16 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Replaceable { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } get replaceable() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get replaceable' called on an object that is not a valid instance of Replaceable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get replaceable' called on an object that is not a valid instance of Replaceable.\\" + ); } return esValue[implSymbol][\\"replaceable\\"]; @@ -5647,7 +5926,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set replaceable' called on an object that is not a valid instance of Replaceable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set replaceable' called on an object that is not a valid instance of Replaceable.\\" + ); } Object.defineProperty(esValue, \\"replaceable\\", { @@ -5698,10 +5979,12 @@ const enumerationValues = new Set([ ]); exports.enumerationValues = enumerationValues; -exports.convert = function convert(value, { context = \\"The provided value\\" } = {}) { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { const string = \`\${value}\`; if (!enumerationValues.has(string)) { - throw new TypeError(\`\${context} '\${string}' is not a valid enumeration value for RequestDestination\`); + throw new ctorRegistry[\\"%TypeError%\\"]( + \`\${context} '\${string}' is not a valid enumeration value for RequestDestination\` + ); } return string; }; @@ -5726,11 +6009,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'SeqAndRec'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'SeqAndRec'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -5806,21 +6089,23 @@ exports.install = (globalObject, globalNames) => { recordConsumer(rec) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'recordConsumer' called on an object that is not a valid instance of SeqAndRec.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'recordConsumer' called on an object that is not a valid instance of SeqAndRec.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'recordConsumer' on 'SeqAndRec': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'recordConsumer' on 'SeqAndRec': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError(\\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\" is not an object.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\" is not an object.\\" + ); } else { const result = Object.create(null); for (const key of Reflect.ownKeys(curArg)) { @@ -5829,13 +6114,15 @@ exports.install = (globalObject, globalNames) => { let typedKey = key; typedKey = conversions[\\"USVString\\"](typedKey, { - context: \\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s key\\" + context: \\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; typedValue = conversions[\\"double\\"](typedValue, { - context: \\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s value\\" + context: \\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); result[typedKey] = typedValue; @@ -5851,21 +6138,23 @@ exports.install = (globalObject, globalNames) => { recordConsumer2(rec) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'recordConsumer2' called on an object that is not a valid instance of SeqAndRec.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'recordConsumer2' called on an object that is not a valid instance of SeqAndRec.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'recordConsumer2' on 'SeqAndRec': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError(\\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\" is not an object.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\" is not an object.\\" + ); } else { const result = Object.create(null); for (const key of Reflect.ownKeys(curArg)) { @@ -5874,13 +6163,15 @@ exports.install = (globalObject, globalNames) => { let typedKey = key; typedKey = conversions[\\"USVString\\"](typedKey, { - context: \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\"'s key\\" + context: \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; typedValue = URL.convert(typedValue, { - context: \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\"'s value\\" + context: \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\"'s value\\", + ctorRegistry }); result[typedKey] = typedValue; @@ -5896,21 +6187,21 @@ exports.install = (globalObject, globalNames) => { sequenceConsumer(seq) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'sequenceConsumer' called on an object that is not a valid instance of SeqAndRec.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'sequenceConsumer' called on an object that is not a valid instance of SeqAndRec.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'sequenceConsumer' on 'SeqAndRec': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'sequenceConsumer' on 'SeqAndRec': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'sequenceConsumer' on 'SeqAndRec': parameter 1\\" + \\" is not an iterable object.\\" ); } else { @@ -5918,7 +6209,8 @@ exports.install = (globalObject, globalNames) => { const tmp = curArg; for (let nextItem of tmp) { nextItem = conversions[\\"USVString\\"](nextItem, { - context: \\"Failed to execute 'sequenceConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s element\\" + context: \\"Failed to execute 'sequenceConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s element\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); V.push(nextItem); @@ -5933,21 +6225,21 @@ exports.install = (globalObject, globalNames) => { sequenceConsumer2(seq) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'sequenceConsumer2' called on an object that is not a valid instance of SeqAndRec.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'sequenceConsumer2' called on an object that is not a valid instance of SeqAndRec.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'sequenceConsumer2' on 'SeqAndRec': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'sequenceConsumer2' on 'SeqAndRec': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'sequenceConsumer2' on 'SeqAndRec': parameter 1\\" + \\" is not an iterable object.\\" ); } else { @@ -5968,21 +6260,21 @@ exports.install = (globalObject, globalNames) => { frozenArrayConsumer(arr) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'frozenArrayConsumer' called on an object that is not a valid instance of SeqAndRec.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'frozenArrayConsumer' called on an object that is not a valid instance of SeqAndRec.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'frozenArrayConsumer' on 'SeqAndRec': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'frozenArrayConsumer' on 'SeqAndRec': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'frozenArrayConsumer' on 'SeqAndRec': parameter 1\\" + \\" is not an iterable object.\\" ); } else { @@ -5990,7 +6282,8 @@ exports.install = (globalObject, globalNames) => { const tmp = curArg; for (let nextItem of tmp) { nextItem = conversions[\\"double\\"](nextItem, { - context: \\"Failed to execute 'frozenArrayConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s element\\" + context: \\"Failed to execute 'frozenArrayConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s element\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); V.push(nextItem); @@ -6041,11 +6334,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Static'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Static'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -6115,13 +6408,13 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Static { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } def() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'def' called on an object that is not a valid instance of Static.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'def' called on an object that is not a valid instance of Static.\\"); } return esValue[implSymbol].def(); @@ -6131,7 +6424,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get abc' called on an object that is not a valid instance of Static.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get abc' called on an object that is not a valid instance of Static.\\"); } return esValue[implSymbol][\\"abc\\"]; @@ -6141,10 +6434,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set abc' called on an object that is not a valid instance of Static.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set abc' called on an object that is not a valid instance of Static.\\"); } - V = conversions[\\"DOMString\\"](V, { context: \\"Failed to set the 'abc' property on 'Static': The provided value\\" }); + V = conversions[\\"DOMString\\"](V, { + context: \\"Failed to set the 'abc' property on 'Static': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"abc\\"] = V; } @@ -6162,7 +6458,10 @@ exports.install = (globalObject, globalNames) => { static set abc(V) { const esValue = this !== null && this !== undefined ? this : globalObject; - V = conversions[\\"DOMString\\"](V, { context: \\"Failed to set the 'abc' property on 'Static': The provided value\\" }); + V = conversions[\\"DOMString\\"](V, { + context: \\"Failed to set the 'abc' property on 'Static': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); Impl.implementation[\\"abc\\"] = V; } @@ -6203,11 +6502,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Storage'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Storage'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -6281,24 +6580,27 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Storage { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } key(index) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'key' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'key' called on an object that is not a valid instance of Storage.\\"); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'key' on 'Storage': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'key' on 'Storage': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = conversions[\\"unsigned long\\"](curArg, { context: \\"Failed to execute 'key' on 'Storage': parameter 1\\" }); + curArg = conversions[\\"unsigned long\\"](curArg, { + context: \\"Failed to execute 'key' on 'Storage': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } return esValue[implSymbol].key(...args); @@ -6307,18 +6609,21 @@ exports.install = (globalObject, globalNames) => { getItem(key) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'getItem' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'getItem' called on an object that is not a valid instance of Storage.\\"); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'getItem' on 'Storage': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'getItem' on 'Storage': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'getItem' on 'Storage': parameter 1\\" }); + curArg = conversions[\\"DOMString\\"](curArg, { + context: \\"Failed to execute 'getItem' on 'Storage': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } return esValue[implSymbol].getItem(...args); @@ -6327,23 +6632,29 @@ exports.install = (globalObject, globalNames) => { setItem(key, value) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'setItem' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'setItem' called on an object that is not a valid instance of Storage.\\"); } if (arguments.length < 2) { - throw new TypeError( - \\"Failed to execute 'setItem' on 'Storage': 2 arguments required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'setItem' on 'Storage': 2 arguments required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'setItem' on 'Storage': parameter 1\\" }); + curArg = conversions[\\"DOMString\\"](curArg, { + context: \\"Failed to execute 'setItem' on 'Storage': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } { let curArg = arguments[1]; - curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'setItem' on 'Storage': parameter 2\\" }); + curArg = conversions[\\"DOMString\\"](curArg, { + context: \\"Failed to execute 'setItem' on 'Storage': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } return esValue[implSymbol].setItem(...args); @@ -6352,19 +6663,22 @@ exports.install = (globalObject, globalNames) => { removeItem(key) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'removeItem' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'removeItem' called on an object that is not a valid instance of Storage.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'removeItem' on 'Storage': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'removeItem' on 'Storage': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'removeItem' on 'Storage': parameter 1\\" + context: \\"Failed to execute 'removeItem' on 'Storage': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -6374,7 +6688,7 @@ exports.install = (globalObject, globalNames) => { clear() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'clear' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'clear' called on an object that is not a valid instance of Storage.\\"); } return esValue[implSymbol].clear(); @@ -6384,7 +6698,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get length' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get length' called on an object that is not a valid instance of Storage.\\" + ); } return esValue[implSymbol][\\"length\\"]; @@ -6492,7 +6808,8 @@ const proxyHandler = { let namedValue = V; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'Storage': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'Storage': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); target[implSymbol].setItem(P, namedValue); @@ -6546,7 +6863,8 @@ const proxyHandler = { let namedValue = desc.value; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'Storage': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'Storage': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); target[implSymbol].setItem(P, namedValue); @@ -6595,11 +6913,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'StringifierAttribute'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'StringifierAttribute'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -6669,14 +6987,16 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class StringifierAttribute { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } get attr() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get attr' called on an object that is not a valid instance of StringifierAttribute.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get attr' called on an object that is not a valid instance of StringifierAttribute.\\" + ); } return esValue[implSymbol][\\"attr\\"]; @@ -6685,7 +7005,9 @@ exports.install = (globalObject, globalNames) => { toString() { const esValue = this; if (!exports.is(esValue)) { - throw new TypeError(\\"'toString' called on an object that is not a valid instance of StringifierAttribute.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'toString' called on an object that is not a valid instance of StringifierAttribute.\\" + ); } return esValue[implSymbol][\\"attr\\"]; @@ -6726,11 +7048,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'StringifierDefaultOperation'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'StringifierDefaultOperation'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -6800,13 +7122,13 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class StringifierDefaultOperation { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } toString() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'toString' called on an object that is not a valid instance of StringifierDefaultOperation.\\" ); } @@ -6848,11 +7170,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'StringifierNamedOperation'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'StringifierNamedOperation'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -6922,13 +7244,13 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class StringifierNamedOperation { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } operation() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'operation' called on an object that is not a valid instance of StringifierNamedOperation.\\" ); } @@ -6939,7 +7261,7 @@ exports.install = (globalObject, globalNames) => { toString() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'toString' called on an object that is not a valid instance of StringifierNamedOperation.\\" ); } @@ -6982,11 +7304,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'StringifierOperation'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'StringifierOperation'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -7056,13 +7378,15 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class StringifierOperation { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } toString() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'toString' called on an object that is not a valid instance of StringifierOperation.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'toString' called on an object that is not a valid instance of StringifierOperation.\\" + ); } return esValue[implSymbol].toString(); @@ -7104,11 +7428,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'TypedefsAndUnions'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'TypedefsAndUnions'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -7178,22 +7502,20 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class TypedefsAndUnions { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } numOrStrConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'numOrStrConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'numOrStrConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'numOrStrConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -7202,11 +7524,13 @@ exports.install = (globalObject, globalNames) => { if (typeof curArg === \\"number\\") { curArg = conversions[\\"double\\"](curArg, { context: \\"Failed to execute 'numOrStrConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), clamp: true }); } else { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'numOrStrConsumer' on 'TypedefsAndUnions': parameter 1\\" + context: \\"Failed to execute 'numOrStrConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); @@ -7217,16 +7541,14 @@ exports.install = (globalObject, globalNames) => { numOrEnumConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'numOrEnumConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -7237,11 +7559,13 @@ exports.install = (globalObject, globalNames) => { } else { if (typeof curArg === \\"number\\") { curArg = conversions[\\"double\\"](curArg, { - context: \\"Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': parameter 1\\" + context: \\"Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = RequestDestination.convert(curArg, { - context: \\"Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': parameter 1\\" + context: \\"Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': parameter 1\\", + ctorRegistry }); } } @@ -7253,16 +7577,14 @@ exports.install = (globalObject, globalNames) => { numOrStrOrNullConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'numOrStrOrNullConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'numOrStrOrNullConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'numOrStrOrNullConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -7274,12 +7596,14 @@ exports.install = (globalObject, globalNames) => { if (typeof curArg === \\"number\\") { curArg = conversions[\\"double\\"](curArg, { context: \\"Failed to execute 'numOrStrOrNullConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), clamp: true, enforceRange: true }); } else { curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'numOrStrOrNullConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), enforceRange: true }); } @@ -7292,16 +7616,14 @@ exports.install = (globalObject, globalNames) => { numOrStrOrURLOrNullConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'numOrStrOrURLOrNullConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'numOrStrOrURLOrNullConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'numOrStrOrURLOrNullConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -7315,12 +7637,14 @@ exports.install = (globalObject, globalNames) => { } else if (typeof curArg === \\"number\\") { curArg = conversions[\\"double\\"](curArg, { context: \\"Failed to execute 'numOrStrOrURLOrNullConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), clamp: true, enforceRange: true }); } else { curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'numOrStrOrURLOrNullConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), enforceRange: true }); } @@ -7333,23 +7657,21 @@ exports.install = (globalObject, globalNames) => { urlMapInnerConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'urlMapInnerConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" is not an object.\\" ); } else { @@ -7360,13 +7682,15 @@ exports.install = (globalObject, globalNames) => { let typedKey = key; typedKey = conversions[\\"USVString\\"](typedKey, { - context: \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s key\\" + context: \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; typedValue = URL.convert(typedValue, { - context: \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s value\\" + context: \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s value\\", + ctorRegistry }); result[typedKey] = typedValue; @@ -7382,14 +7706,14 @@ exports.install = (globalObject, globalNames) => { urlMapConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'urlMapConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'urlMapConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -7399,7 +7723,7 @@ exports.install = (globalObject, globalNames) => { curArg = null; } else { if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" is not an object.\\" ); } else { @@ -7410,13 +7734,15 @@ exports.install = (globalObject, globalNames) => { let typedKey = key; typedKey = conversions[\\"USVString\\"](typedKey, { - context: \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s key\\" + context: \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; typedValue = URL.convert(typedValue, { - context: \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s value\\" + context: \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s value\\", + ctorRegistry }); result[typedKey] = typedValue; @@ -7433,16 +7759,14 @@ exports.install = (globalObject, globalNames) => { bufferSourceOrURLConsumer(b) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'bufferSourceOrURLConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'bufferSourceOrURLConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'bufferSourceOrURLConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -7453,7 +7777,7 @@ exports.install = (globalObject, globalNames) => { } else if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'bufferSourceOrURLConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" is not of any supported type.\\" ); @@ -7466,16 +7790,14 @@ exports.install = (globalObject, globalNames) => { arrayBufferViewOrURLMapConsumer(b) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'arrayBufferViewOrURLMapConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -7487,7 +7809,7 @@ exports.install = (globalObject, globalNames) => { if (ArrayBuffer.isView(curArg)) { } else if (utils.isObject(curArg)) { if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" record\\" + \\" is not an object.\\" @@ -7503,7 +7825,8 @@ exports.install = (globalObject, globalNames) => { context: \\"Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" record\\" + - \\"'s key\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; @@ -7512,7 +7835,8 @@ exports.install = (globalObject, globalNames) => { context: \\"Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" record\\" + - \\"'s value\\" + \\"'s value\\", + ctorRegistry }); result[typedKey] = typedValue; @@ -7521,7 +7845,7 @@ exports.install = (globalObject, globalNames) => { curArg = result; } } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" is not of any supported type.\\" ); @@ -7535,16 +7859,14 @@ exports.install = (globalObject, globalNames) => { arrayBufferViewDupConsumer(b) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'arrayBufferViewDupConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'arrayBufferViewDupConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'arrayBufferViewDupConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -7552,7 +7874,7 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[0]; if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'arrayBufferViewDupConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" is not of any supported type.\\" ); @@ -7566,7 +7888,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get buf' called on an object that is not a valid instance of TypedefsAndUnions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get buf' called on an object that is not a valid instance of TypedefsAndUnions.\\" + ); } return utils.tryWrapperForImpl(esValue[implSymbol][\\"buf\\"]); @@ -7576,7 +7900,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set buf' called on an object that is not a valid instance of TypedefsAndUnions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set buf' called on an object that is not a valid instance of TypedefsAndUnions.\\" + ); } if (utils.isArrayBuffer(V)) { @@ -7585,7 +7911,7 @@ exports.install = (globalObject, globalNames) => { (V.constructor.name === \\"Uint8Array\\" || V.constructor.name === \\"Uint16Array\\") ) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to set the 'buf' property on 'TypedefsAndUnions': The provided value\\" + \\" is not of any supported type.\\" ); @@ -7597,7 +7923,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get time' called on an object that is not a valid instance of TypedefsAndUnions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get time' called on an object that is not a valid instance of TypedefsAndUnions.\\" + ); } return esValue[implSymbol][\\"time\\"]; @@ -7607,11 +7935,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set time' called on an object that is not a valid instance of TypedefsAndUnions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set time' called on an object that is not a valid instance of TypedefsAndUnions.\\" + ); } V = conversions[\\"unsigned long long\\"](V, { - context: \\"Failed to set the 'time' property on 'TypedefsAndUnions': The provided value\\" + context: \\"Failed to set the 'time' property on 'TypedefsAndUnions': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"time\\"] = V; @@ -7661,11 +7992,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'URL'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'URL'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -7736,20 +8067,26 @@ exports.install = (globalObject, globalNames) => { class URL { constructor(url) { if (arguments.length < 1) { - throw new TypeError( - \\"Failed to construct 'URL': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to construct 'URL': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = conversions[\\"USVString\\"](curArg, { context: \\"Failed to construct 'URL': parameter 1\\" }); + curArg = conversions[\\"USVString\\"](curArg, { + context: \\"Failed to construct 'URL': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } { let curArg = arguments[1]; if (curArg !== undefined) { - curArg = conversions[\\"USVString\\"](curArg, { context: \\"Failed to construct 'URL': parameter 2\\" }); + curArg = conversions[\\"USVString\\"](curArg, { + context: \\"Failed to construct 'URL': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); } args.push(curArg); } @@ -7759,7 +8096,7 @@ exports.install = (globalObject, globalNames) => { toJSON() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'toJSON' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'toJSON' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol].toJSON(); @@ -7769,7 +8106,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get href' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get href' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"href\\"]; @@ -7779,10 +8116,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set href' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set href' called on an object that is not a valid instance of URL.\\"); } - V = conversions[\\"USVString\\"](V, { context: \\"Failed to set the 'href' property on 'URL': The provided value\\" }); + V = conversions[\\"USVString\\"](V, { + context: \\"Failed to set the 'href' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"href\\"] = V; } @@ -7790,7 +8130,7 @@ exports.install = (globalObject, globalNames) => { toString() { const esValue = this; if (!exports.is(esValue)) { - throw new TypeError(\\"'toString' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'toString' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"href\\"]; @@ -7800,7 +8140,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get origin' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get origin' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"origin\\"]; @@ -7810,7 +8150,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get protocol' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get protocol' called on an object that is not a valid instance of URL.\\" + ); } return esValue[implSymbol][\\"protocol\\"]; @@ -7820,11 +8162,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set protocol' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set protocol' called on an object that is not a valid instance of URL.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'protocol' property on 'URL': The provided value\\" + context: \\"Failed to set the 'protocol' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"protocol\\"] = V; @@ -7834,7 +8179,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get username' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get username' called on an object that is not a valid instance of URL.\\" + ); } return esValue[implSymbol][\\"username\\"]; @@ -7844,11 +8191,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set username' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set username' called on an object that is not a valid instance of URL.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'username' property on 'URL': The provided value\\" + context: \\"Failed to set the 'username' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"username\\"] = V; @@ -7858,7 +8208,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get password' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get password' called on an object that is not a valid instance of URL.\\" + ); } return esValue[implSymbol][\\"password\\"]; @@ -7868,11 +8220,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set password' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set password' called on an object that is not a valid instance of URL.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'password' property on 'URL': The provided value\\" + context: \\"Failed to set the 'password' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"password\\"] = V; @@ -7882,7 +8237,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get host' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get host' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"host\\"]; @@ -7892,10 +8247,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set host' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set host' called on an object that is not a valid instance of URL.\\"); } - V = conversions[\\"USVString\\"](V, { context: \\"Failed to set the 'host' property on 'URL': The provided value\\" }); + V = conversions[\\"USVString\\"](V, { + context: \\"Failed to set the 'host' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"host\\"] = V; } @@ -7904,7 +8262,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get hostname' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get hostname' called on an object that is not a valid instance of URL.\\" + ); } return esValue[implSymbol][\\"hostname\\"]; @@ -7914,11 +8274,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set hostname' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set hostname' called on an object that is not a valid instance of URL.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'hostname' property on 'URL': The provided value\\" + context: \\"Failed to set the 'hostname' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"hostname\\"] = V; @@ -7928,7 +8291,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get port' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get port' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"port\\"]; @@ -7938,10 +8301,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set port' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set port' called on an object that is not a valid instance of URL.\\"); } - V = conversions[\\"USVString\\"](V, { context: \\"Failed to set the 'port' property on 'URL': The provided value\\" }); + V = conversions[\\"USVString\\"](V, { + context: \\"Failed to set the 'port' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"port\\"] = V; } @@ -7950,7 +8316,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get pathname' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get pathname' called on an object that is not a valid instance of URL.\\" + ); } return esValue[implSymbol][\\"pathname\\"]; @@ -7960,11 +8328,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set pathname' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set pathname' called on an object that is not a valid instance of URL.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'pathname' property on 'URL': The provided value\\" + context: \\"Failed to set the 'pathname' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"pathname\\"] = V; @@ -7974,7 +8345,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get search' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get search' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"search\\"]; @@ -7984,10 +8355,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set search' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set search' called on an object that is not a valid instance of URL.\\"); } - V = conversions[\\"USVString\\"](V, { context: \\"Failed to set the 'search' property on 'URL': The provided value\\" }); + V = conversions[\\"USVString\\"](V, { + context: \\"Failed to set the 'search' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"search\\"] = V; } @@ -7996,7 +8370,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get searchParams' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get searchParams' called on an object that is not a valid instance of URL.\\" + ); } return utils.getSameObject(this, \\"searchParams\\", () => { @@ -8008,7 +8384,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get hash' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get hash' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"hash\\"]; @@ -8018,10 +8394,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set hash' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set hash' called on an object that is not a valid instance of URL.\\"); } - V = conversions[\\"USVString\\"](V, { context: \\"Failed to set the 'hash' property on 'URL': The provided value\\" }); + V = conversions[\\"USVString\\"](V, { + context: \\"Failed to set the 'hash' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"hash\\"] = V; } @@ -8072,9 +8451,15 @@ const utils = require(\\"./utils.js\\"); const URL = require(\\"./URL.js\\"); -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (typeof value !== \\"function\\") { - throw new TypeError(context + \\" is not a function\\"); + throw new ctorRegistry[\\"%TypeError%\\"](context + \\" is not a function\\"); } function invokeTheCallbackFunction(url, string) { @@ -8085,7 +8470,7 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { callResult = Reflect.apply(value, thisArg, [url, string]); - callResult = URL.convert(callResult, { context: context }); + callResult = URL.convert(callResult, { context: context, ctorRegistry }); return callResult; } @@ -8095,7 +8480,7 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { let callResult = Reflect.construct(value, [url, string]); - callResult = URL.convert(callResult, { context: context }); + callResult = URL.convert(callResult, { context: context, ctorRegistry }); return callResult; }; @@ -8114,7 +8499,13 @@ exports[`generation with processors URLHandlerNonNull.webidl 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { function invokeTheCallbackFunction(url) { const thisArg = utils.tryWrapperForImpl(this); let callResult; @@ -8125,7 +8516,10 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { callResult = Reflect.apply(value, thisArg, [url]); } - callResult = conversions[\\"any\\"](callResult, { context: context }); + callResult = conversions[\\"any\\"](callResult, { + context: context, + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); return callResult; } @@ -8135,7 +8529,10 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { let callResult = Reflect.construct(value, [url]); - callResult = conversions[\\"any\\"](callResult, { context: context }); + callResult = conversions[\\"any\\"](callResult, { + context: context, + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); return callResult; }; @@ -8165,11 +8562,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'URLList'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'URLList'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -8243,25 +8640,26 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class URLList { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } item(index) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'item' called on an object that is not a valid instance of URLList.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'item' called on an object that is not a valid instance of URLList.\\"); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'item' on 'URLList': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'item' on 'URLList': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"unsigned long\\"](curArg, { - context: \\"Failed to execute 'item' on 'URLList': parameter 1\\" + context: \\"Failed to execute 'item' on 'URLList': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -8272,7 +8670,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get length' called on an object that is not a valid instance of URLList.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get length' called on an object that is not a valid instance of URLList.\\" + ); } return esValue[implSymbol][\\"length\\"]; @@ -8484,11 +8884,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'URLSearchParams'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'URLSearchParams'.\`); }; exports.createDefaultIterator = (globalObject, target, kind) => { @@ -8576,7 +8976,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isObject(curArg)) { if (curArg[Symbol.iterator] !== undefined) { if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" sequence\\" + \\" is not an iterable object.\\" ); } else { @@ -8584,7 +8984,7 @@ exports.install = (globalObject, globalNames) => { const tmp = curArg; for (let nextItem of tmp) { if (!utils.isObject(nextItem)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" sequence\\" + \\"'s element\\" + @@ -8599,7 +8999,8 @@ exports.install = (globalObject, globalNames) => { \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" sequence\\" + \\"'s element\\" + - \\"'s element\\" + \\"'s element\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); V.push(nextItem); @@ -8613,7 +9014,7 @@ exports.install = (globalObject, globalNames) => { } } else { if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" record\\" + \\" is not an object.\\" ); } else { @@ -8624,13 +9025,15 @@ exports.install = (globalObject, globalNames) => { let typedKey = key; typedKey = conversions[\\"USVString\\"](typedKey, { - context: \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" record\\" + \\"'s key\\" + context: \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" record\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; typedValue = conversions[\\"USVString\\"](typedValue, { - context: \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" record\\" + \\"'s value\\" + context: \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" record\\" + \\"'s value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); result[typedKey] = typedValue; @@ -8641,7 +9044,8 @@ exports.install = (globalObject, globalNames) => { } } else { curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to construct 'URLSearchParams': parameter 1\\" + context: \\"Failed to construct 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } } else { @@ -8655,28 +9059,30 @@ exports.install = (globalObject, globalNames) => { append(name, value) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'append' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'append' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 2) { - throw new TypeError( - \\"Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'append' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'append' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'append' on 'URLSearchParams': parameter 2\\" + context: \\"Failed to execute 'append' on 'URLSearchParams': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -8686,21 +9092,22 @@ exports.install = (globalObject, globalNames) => { delete(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'delete' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'delete' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'delete' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'delete' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -8710,21 +9117,22 @@ exports.install = (globalObject, globalNames) => { get(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'get' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'get' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -8734,21 +9142,22 @@ exports.install = (globalObject, globalNames) => { getAll(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'getAll' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'getAll' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'getAll' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'getAll' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -8758,21 +9167,22 @@ exports.install = (globalObject, globalNames) => { has(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'has' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'has' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'has' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'has' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -8782,28 +9192,30 @@ exports.install = (globalObject, globalNames) => { set(name, value) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 2) { - throw new TypeError( - \\"Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'set' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'set' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'set' on 'URLSearchParams': parameter 2\\" + context: \\"Failed to execute 'set' on 'URLSearchParams': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -8813,7 +9225,9 @@ exports.install = (globalObject, globalNames) => { sort() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'sort' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'sort' called on an object that is not a valid instance of URLSearchParams.\\" + ); } return esValue[implSymbol].sort(); @@ -8822,7 +9236,9 @@ exports.install = (globalObject, globalNames) => { toString() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'toString' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'toString' called on an object that is not a valid instance of URLSearchParams.\\" + ); } return esValue[implSymbol].toString(); @@ -8830,34 +9246,45 @@ exports.install = (globalObject, globalNames) => { keys() { if (!exports.is(this)) { - throw new TypeError(\\"'keys' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'keys' called on an object that is not a valid instance of URLSearchParams.\\" + ); } return exports.createDefaultIterator(globalObject, this, \\"key\\"); } values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of URLSearchParams.\\" + ); } return exports.createDefaultIterator(globalObject, this, \\"value\\"); } entries() { if (!exports.is(this)) { - throw new TypeError(\\"'entries' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'entries' called on an object that is not a valid instance of URLSearchParams.\\" + ); } return exports.createDefaultIterator(globalObject, this, \\"key+value\\"); } forEach(callback) { if (!exports.is(this)) { - throw new TypeError(\\"'forEach' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'forEach' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 1) { - throw new TypeError(\\"Failed to execute 'forEach' on 'iterable': 1 argument required, \\" + \\"but only 0 present.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.\\" + ); } callback = Function.convert(callback, { - context: \\"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1\\" + context: \\"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1\\", + ctorRegistry }); const thisArg = arguments[1]; let pairs = Array.from(this[implSymbol]); @@ -8899,7 +9326,9 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - throw new TypeError(\\"next() called on a value that is not a URLSearchParams iterator object\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a URLSearchParams iterator object\\" + ); } const { target, kind, index } = internal; @@ -8944,11 +9373,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'URLSearchParamsCollection'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'URLSearchParamsCollection'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -9022,27 +9451,28 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class URLSearchParamsCollection { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } item(index) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'item' called on an object that is not a valid instance of URLSearchParamsCollection.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'item' called on an object that is not a valid instance of URLSearchParamsCollection.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'item' on 'URLSearchParamsCollection': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'item' on 'URLSearchParamsCollection': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"unsigned long\\"](curArg, { - context: \\"Failed to execute 'item' on 'URLSearchParamsCollection': parameter 1\\" + context: \\"Failed to execute 'item' on 'URLSearchParamsCollection': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -9052,23 +9482,22 @@ exports.install = (globalObject, globalNames) => { namedItem(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'namedItem' called on an object that is not a valid instance of URLSearchParamsCollection.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'namedItem' on 'URLSearchParamsCollection': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'namedItem' on 'URLSearchParamsCollection': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'namedItem' on 'URLSearchParamsCollection': parameter 1\\" + context: \\"Failed to execute 'namedItem' on 'URLSearchParamsCollection': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -9079,7 +9508,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get length' called on an object that is not a valid instance of URLSearchParamsCollection.\\" ); } @@ -9311,11 +9740,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'URLSearchParamsCollection2'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'URLSearchParamsCollection2'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -9391,7 +9820,7 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class URLSearchParamsCollection2 extends globalObject.URLSearchParamsCollection { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } } Object.defineProperties(URLSearchParamsCollection2.prototype, { @@ -9509,7 +9938,8 @@ const proxyHandler = { let namedValue = V; namedValue = URL.convert(namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'URLSearchParamsCollection2': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'URLSearchParamsCollection2': The provided value\\", + ctorRegistry }); const creating = !(target[implSymbol].namedItem(P) !== null); @@ -9585,7 +10015,8 @@ const proxyHandler = { let namedValue = desc.value; namedValue = URL.convert(namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'URLSearchParamsCollection2': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'URLSearchParamsCollection2': The provided value\\", + ctorRegistry }); const creating = !(target[implSymbol].namedItem(P) !== null); @@ -9643,11 +10074,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'UnderscoredProperties'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'UnderscoredProperties'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -9717,27 +10148,27 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class UnderscoredProperties { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } operation(sequence) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'operation' called on an object that is not a valid instance of UnderscoredProperties.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'operation' called on an object that is not a valid instance of UnderscoredProperties.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'operation' on 'UnderscoredProperties': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'operation' on 'UnderscoredProperties': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'operation' on 'UnderscoredProperties': parameter 1\\" + \\" is not an iterable object.\\" ); } else { @@ -9745,7 +10176,8 @@ exports.install = (globalObject, globalNames) => { const tmp = curArg; for (let nextItem of tmp) { nextItem = conversions[\\"DOMString\\"](nextItem, { - context: \\"Failed to execute 'operation' on 'UnderscoredProperties': parameter 1\\" + \\"'s element\\" + context: \\"Failed to execute 'operation' on 'UnderscoredProperties': parameter 1\\" + \\"'s element\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); V.push(nextItem); @@ -9761,7 +10193,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get attribute' called on an object that is not a valid instance of UnderscoredProperties.\\" ); } @@ -9773,13 +10205,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'set attribute' called on an object that is not a valid instance of UnderscoredProperties.\\" ); } V = conversions[\\"byte\\"](V, { - context: \\"Failed to set the 'attribute' property on 'UnderscoredProperties': The provided value\\" + context: \\"Failed to set the 'attribute' property on 'UnderscoredProperties': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"attribute\\"] = V; @@ -9787,17 +10220,16 @@ exports.install = (globalObject, globalNames) => { static static(void_) { if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'static' on 'UnderscoredProperties': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'static' on 'UnderscoredProperties': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'static' on 'UnderscoredProperties': parameter 1\\" + context: \\"Failed to execute 'static' on 'UnderscoredProperties': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -9844,11 +10276,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Unscopable'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Unscopable'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -9918,14 +10350,16 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Unscopable { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } get unscopableTest() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get unscopableTest' called on an object that is not a valid instance of Unscopable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get unscopableTest' called on an object that is not a valid instance of Unscopable.\\" + ); } return esValue[implSymbol][\\"unscopableTest\\"]; @@ -9935,11 +10369,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set unscopableTest' called on an object that is not a valid instance of Unscopable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set unscopableTest' called on an object that is not a valid instance of Unscopable.\\" + ); } V = conversions[\\"boolean\\"](V, { - context: \\"Failed to set the 'unscopableTest' property on 'Unscopable': The provided value\\" + context: \\"Failed to set the 'unscopableTest' property on 'Unscopable': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"unscopableTest\\"] = V; @@ -9949,7 +10386,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get unscopableMixin' called on an object that is not a valid instance of Unscopable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get unscopableMixin' called on an object that is not a valid instance of Unscopable.\\" + ); } return esValue[implSymbol][\\"unscopableMixin\\"]; @@ -9959,11 +10398,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set unscopableMixin' called on an object that is not a valid instance of Unscopable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set unscopableMixin' called on an object that is not a valid instance of Unscopable.\\" + ); } V = conversions[\\"boolean\\"](V, { - context: \\"Failed to set the 'unscopableMixin' property on 'Unscopable': The provided value\\" + context: \\"Failed to set the 'unscopableMixin' property on 'Unscopable': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"unscopableMixin\\"] = V; @@ -10009,11 +10451,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Variadic'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Variadic'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -10083,19 +10525,22 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Variadic { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } simple1() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'simple1' called on an object that is not a valid instance of Variadic.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'simple1' called on an object that is not a valid instance of Variadic.\\" + ); } const args = []; for (let i = 0; i < arguments.length; i++) { let curArg = arguments[i]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'simple1' on 'Variadic': parameter \\" + (i + 1) + context: \\"Failed to execute 'simple1' on 'Variadic': parameter \\" + (i + 1), + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -10105,25 +10550,31 @@ exports.install = (globalObject, globalNames) => { simple2(first) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'simple2' called on an object that is not a valid instance of Variadic.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'simple2' called on an object that is not a valid instance of Variadic.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'simple2' on 'Variadic': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'simple2' on 'Variadic': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'simple2' on 'Variadic': parameter 1\\" + context: \\"Failed to execute 'simple2' on 'Variadic': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } for (let i = 1; i < arguments.length; i++) { let curArg = arguments[i]; - curArg = URL.convert(curArg, { context: \\"Failed to execute 'simple2' on 'Variadic': parameter \\" + (i + 1) }); + curArg = URL.convert(curArg, { + context: \\"Failed to execute 'simple2' on 'Variadic': parameter \\" + (i + 1), + ctorRegistry + }); args.push(curArg); } return esValue[implSymbol].simple2(...args); @@ -10132,7 +10583,9 @@ exports.install = (globalObject, globalNames) => { overloaded1() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'overloaded1' called on an object that is not a valid instance of Variadic.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'overloaded1' called on an object that is not a valid instance of Variadic.\\" + ); } const args = []; switch (arguments.length) { @@ -10144,7 +10597,8 @@ exports.install = (globalObject, globalNames) => { for (let i = 0; i < arguments.length; i++) { let curArg = arguments[i]; curArg = conversions[\\"unsigned long\\"](curArg, { - context: \\"Failed to execute 'overloaded1' on 'Variadic': parameter \\" + (i + 1) + context: \\"Failed to execute 'overloaded1' on 'Variadic': parameter \\" + (i + 1), + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -10152,7 +10606,8 @@ exports.install = (globalObject, globalNames) => { for (let i = 0; i < arguments.length; i++) { let curArg = arguments[i]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'overloaded1' on 'Variadic': parameter \\" + (i + 1) + context: \\"Failed to execute 'overloaded1' on 'Variadic': parameter \\" + (i + 1), + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -10165,14 +10620,14 @@ exports.install = (globalObject, globalNames) => { overloaded2(first) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'overloaded2' called on an object that is not a valid instance of Variadic.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'overloaded2' called on an object that is not a valid instance of Variadic.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'overloaded2' on 'Variadic': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'overloaded2' on 'Variadic': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -10184,7 +10639,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"unsigned long\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\" + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -10192,7 +10648,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\" + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -10205,14 +10662,16 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"unsigned long\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\" + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } for (let i = 1; i < arguments.length; i++) { let curArg = arguments[i]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter \\" + (i + 1) + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter \\" + (i + 1), + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -10220,14 +10679,16 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\" + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } for (let i = 1; i < arguments.length; i++) { let curArg = arguments[i]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter \\" + (i + 1) + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter \\" + (i + 1), + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -10274,11 +10735,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'ZeroArgConstructor'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'ZeroArgConstructor'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -10373,9 +10834,15 @@ exports[`generation without processors AsyncCallbackFunction.webidl 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (typeof value !== \\"function\\") { - throw new TypeError(context + \\" is not a function\\"); + throw new ctorRegistry[\\"%TypeError%\\"](context + \\" is not a function\\"); } function invokeTheCallbackFunction() { @@ -10385,17 +10852,17 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { try { callResult = Reflect.apply(value, thisArg, []); - callResult = new Promise(resolve => resolve(callResult)); + callResult = new ctorRegistry[\\"%Promise%\\"](resolve => resolve(callResult)); return callResult; } catch (err) { - return Promise.reject(err); + return ctorRegistry[\\"%Promise%\\"].reject(err); } } invokeTheCallbackFunction.construct = () => { let callResult = Reflect.construct(value, []); - callResult = new Promise(resolve => resolve(callResult)); + callResult = new ctorRegistry[\\"%Promise%\\"](resolve => resolve(callResult)); return callResult; }; @@ -10413,9 +10880,15 @@ exports[`generation without processors AsyncCallbackInterface.webidl 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = function convert(value, { context = \\"The provided value\\" } = {}) { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (!utils.isObject(value)) { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not an object.\`); } function callTheUserObjectsOperation() { @@ -10427,17 +10900,17 @@ exports.convert = function convert(value, { context = \\"The provided value\\" } if (typeof O !== \\"function\\") { X = O[\\"asyncMethod\\"]; if (typeof X !== \\"function\\") { - throw new TypeError(\`\${context} does not correctly implement AsyncCallbackInterface.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} does not correctly implement AsyncCallbackInterface.\`); } thisArg = O; } let callResult = Reflect.apply(X, thisArg, []); - callResult = new Promise(resolve => resolve(callResult)); + callResult = new ctorRegistry[\\"%Promise%\\"](resolve => resolve(callResult)); return callResult; } catch (err) { - return Promise.reject(err); + return ctorRegistry[\\"%Promise%\\"].reject(err); } } @@ -10469,11 +10942,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'AsyncIterablePairArgs'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'AsyncIterablePairArgs'.\`); }; exports.createDefaultAsyncIterator = (globalObject, target, kind) => { @@ -10554,19 +11027,22 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class AsyncIterablePairArgs { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } keys() { if (!exports.is(this)) { - throw new TypeError(\\"'keys' called on an object that is not a valid instance of AsyncIterablePairArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'keys' called on an object that is not a valid instance of AsyncIterablePairArgs.\\" + ); } const args = []; if (arguments[0] !== undefined) { args[0] = arguments[0]; args[0] = conversions[\\"boolean\\"](args[0], { - context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 1\\" + context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[0] = false; @@ -10575,14 +11051,16 @@ exports.install = (globalObject, globalNames) => { if (arguments[1] !== undefined) { args[1] = arguments[1]; args[1] = conversions[\\"DOMString\\"](args[1], { - context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 2\\" + context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[1] = undefined; } args[2] = arguments[2]; args[2] = Dictionary.convert(args[2], { - context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 3\\" + context: \\"Failed to execute 'keys' on 'AsyncIterablePairArgs': parameter 3\\", + ctorRegistry }); const asyncIterator = exports.createDefaultAsyncIterator(globalObject, this, \\"key\\"); @@ -10594,14 +11072,17 @@ exports.install = (globalObject, globalNames) => { values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of AsyncIterablePairArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of AsyncIterablePairArgs.\\" + ); } const args = []; if (arguments[0] !== undefined) { args[0] = arguments[0]; args[0] = conversions[\\"boolean\\"](args[0], { - context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 1\\" + context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[0] = false; @@ -10610,14 +11091,16 @@ exports.install = (globalObject, globalNames) => { if (arguments[1] !== undefined) { args[1] = arguments[1]; args[1] = conversions[\\"DOMString\\"](args[1], { - context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 2\\" + context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[1] = undefined; } args[2] = arguments[2]; args[2] = Dictionary.convert(args[2], { - context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 3\\" + context: \\"Failed to execute 'values' on 'AsyncIterablePairArgs': parameter 3\\", + ctorRegistry }); const asyncIterator = exports.createDefaultAsyncIterator(globalObject, this, \\"value\\"); @@ -10629,14 +11112,17 @@ exports.install = (globalObject, globalNames) => { entries() { if (!exports.is(this)) { - throw new TypeError(\\"'entries' called on an object that is not a valid instance of AsyncIterablePairArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'entries' called on an object that is not a valid instance of AsyncIterablePairArgs.\\" + ); } const args = []; if (arguments[0] !== undefined) { args[0] = arguments[0]; args[0] = conversions[\\"boolean\\"](args[0], { - context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 1\\" + context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[0] = false; @@ -10645,14 +11131,16 @@ exports.install = (globalObject, globalNames) => { if (arguments[1] !== undefined) { args[1] = arguments[1]; args[1] = conversions[\\"DOMString\\"](args[1], { - context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 2\\" + context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { args[1] = undefined; } args[2] = arguments[2]; args[2] = Dictionary.convert(args[2], { - context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 3\\" + context: \\"Failed to execute 'entries' on 'AsyncIterablePairArgs': parameter 3\\", + ctorRegistry }); const asyncIterator = exports.createDefaultAsyncIterator(globalObject, this, \\"key+value\\"); @@ -10684,14 +11172,16 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"next() called on a value that is not a AsyncIterablePairArgs async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a AsyncIterablePairArgs async iterator object\\" + ) ); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -10749,11 +11239,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'AsyncIterablePairNoArgs'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'AsyncIterablePairNoArgs'.\`); }; exports.createDefaultAsyncIterator = (globalObject, target, kind) => { @@ -10834,12 +11324,14 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class AsyncIterablePairNoArgs { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } keys() { if (!exports.is(this)) { - throw new TypeError(\\"'keys' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'keys' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\" + ); } const args = []; @@ -10853,7 +11345,9 @@ exports.install = (globalObject, globalNames) => { values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\" + ); } const args = []; @@ -10867,7 +11361,9 @@ exports.install = (globalObject, globalNames) => { entries() { if (!exports.is(this)) { - throw new TypeError(\\"'entries' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'entries' called on an object that is not a valid instance of AsyncIterablePairNoArgs.\\" + ); } const args = []; @@ -10901,14 +11397,16 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"next() called on a value that is not a AsyncIterablePairNoArgs async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a AsyncIterablePairNoArgs async iterator object\\" + ) ); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -10967,11 +11465,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'AsyncIterableValueArgs'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'AsyncIterableValueArgs'.\`); }; exports.createDefaultAsyncIterator = (globalObject, target, kind) => { @@ -11052,19 +11550,22 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class AsyncIterableValueArgs { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of AsyncIterableValueArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of AsyncIterableValueArgs.\\" + ); } const args = []; if (arguments[0] !== undefined) { args[0] = arguments[0]; args[0] = URL.convert(args[0], { - context: \\"Failed to execute 'values' on 'AsyncIterableValueArgs': parameter 1\\" + context: \\"Failed to execute 'values' on 'AsyncIterableValueArgs': parameter 1\\", + ctorRegistry }); } else { args[0] = undefined; @@ -11097,14 +11598,16 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"next() called on a value that is not a AsyncIterableValueArgs async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a AsyncIterableValueArgs async iterator object\\" + ) ); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -11162,11 +11665,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'AsyncIterableValueNoArgs'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'AsyncIterableValueNoArgs'.\`); }; exports.createDefaultAsyncIterator = (globalObject, target, kind) => { @@ -11247,12 +11750,14 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class AsyncIterableValueNoArgs { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of AsyncIterableValueNoArgs.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of AsyncIterableValueNoArgs.\\" + ); } const args = []; @@ -11284,14 +11789,16 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"next() called on a value that is not a AsyncIterableValueNoArgs async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a AsyncIterableValueNoArgs async iterator object\\" + ) ); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -11350,11 +11857,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'AsyncIterableWithReturn'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'AsyncIterableWithReturn'.\`); }; exports.createDefaultAsyncIterator = (globalObject, target, kind) => { @@ -11435,18 +11942,21 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class AsyncIterableWithReturn { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of AsyncIterableWithReturn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of AsyncIterableWithReturn.\\" + ); } const args = []; args[0] = arguments[0]; args[0] = Dictionary.convert(args[0], { - context: \\"Failed to execute 'values' on 'AsyncIterableWithReturn': parameter 1\\" + context: \\"Failed to execute 'values' on 'AsyncIterableWithReturn': parameter 1\\", + ctorRegistry }); const asyncIterator = exports.createDefaultAsyncIterator(globalObject, this, \\"value\\"); @@ -11476,14 +11986,16 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"next() called on a value that is not a AsyncIterableWithReturn async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a AsyncIterableWithReturn async iterator object\\" + ) ); } const nextSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value: undefined, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value: undefined, done: true }); } const nextPromise = internal.target[implSymbol][utils.asyncIteratorNext](this); @@ -11513,14 +12025,16 @@ exports.install = (globalObject, globalNames) => { return(value) { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - return Promise.reject( - new TypeError(\\"return() called on a value that is not a AsyncIterableWithReturn async iterator object\\") + return ctorRegistry[\\"%Promise%\\"].reject( + new ctorRegistry[\\"%TypeError%\\"]( + \\"return() called on a value that is not a AsyncIterableWithReturn async iterator object\\" + ) ); } const returnSteps = () => { if (internal.isFinished) { - return Promise.resolve({ value, done: true }); + return ctorRegistry[\\"%Promise%\\"].resolve({ value, done: true }); } internal.isFinished = true; @@ -11564,11 +12078,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'BufferSourceTypes'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'BufferSourceTypes'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -11638,20 +12152,20 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class BufferSourceTypes { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } bs(source) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'bs' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'bs' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'bs' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'bs' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -11660,7 +12174,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'bs' on 'BufferSourceTypes': parameter 1\\" + \\" is not of any supported type.\\" ); } @@ -11672,21 +12186,22 @@ exports.install = (globalObject, globalNames) => { ab(ab) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'ab' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'ab' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'ab' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'ab' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"ArrayBuffer\\"](curArg, { - context: \\"Failed to execute 'ab' on 'BufferSourceTypes': parameter 1\\" + context: \\"Failed to execute 'ab' on 'BufferSourceTypes': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -11696,14 +12211,14 @@ exports.install = (globalObject, globalNames) => { abv(abv) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'abv' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'abv' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'abv' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'abv' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -11711,7 +12226,7 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[0]; if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'abv' on 'BufferSourceTypes': parameter 1\\" + \\" is not of any supported type.\\" ); } @@ -11723,21 +12238,22 @@ exports.install = (globalObject, globalNames) => { u8a(u8) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'u8a' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'u8a' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'u8a' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'u8a' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"Uint8Array\\"](curArg, { - context: \\"Failed to execute 'u8a' on 'BufferSourceTypes': parameter 1\\" + context: \\"Failed to execute 'u8a' on 'BufferSourceTypes': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -11747,14 +12263,14 @@ exports.install = (globalObject, globalNames) => { abUnion(ab) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'abUnion' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'abUnion' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'abUnion' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'abUnion' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -11763,7 +12279,8 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'abUnion' on 'BufferSourceTypes': parameter 1\\" + context: \\"Failed to execute 'abUnion' on 'BufferSourceTypes': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); @@ -11774,14 +12291,14 @@ exports.install = (globalObject, globalNames) => { u8aUnion(ab) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'u8aUnion' called on an object that is not a valid instance of BufferSourceTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'u8aUnion' called on an object that is not a valid instance of BufferSourceTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'u8aUnion' on 'BufferSourceTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'u8aUnion' on 'BufferSourceTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -11790,7 +12307,8 @@ exports.install = (globalObject, globalNames) => { if (ArrayBuffer.isView(curArg) && curArg.constructor.name === \\"Uint8Array\\") { } else { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'u8aUnion' on 'BufferSourceTypes': parameter 1\\" + context: \\"Failed to execute 'u8aUnion' on 'BufferSourceTypes': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); @@ -11837,11 +12355,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'CEReactions'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'CEReactions'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -11924,13 +12442,15 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class CEReactions { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } method() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'method' called on an object that is not a valid instance of CEReactions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'method' called on an object that is not a valid instance of CEReactions.\\" + ); } return esValue[implSymbol].method(); @@ -11940,12 +12460,14 @@ exports.install = (globalObject, globalNames) => { try { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'promiseOperation' called on an object that is not a valid instance of CEReactions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'promiseOperation' called on an object that is not a valid instance of CEReactions.\\" + ); } return utils.tryWrapperForImpl(esValue[implSymbol].promiseOperation()); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } @@ -11953,7 +12475,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get attr' called on an object that is not a valid instance of CEReactions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get attr' called on an object that is not a valid instance of CEReactions.\\" + ); } return esValue[implSymbol][\\"attr\\"]; @@ -11963,11 +12487,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set attr' called on an object that is not a valid instance of CEReactions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set attr' called on an object that is not a valid instance of CEReactions.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'attr' property on 'CEReactions': The provided value\\" + context: \\"Failed to set the 'attr' property on 'CEReactions': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"attr\\"] = V; @@ -11978,14 +12505,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get promiseAttribute' called on an object that is not a valid instance of CEReactions.\\" ); } return utils.tryWrapperForImpl(esValue[implSymbol][\\"promiseAttribute\\"]); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } } @@ -12096,7 +12623,8 @@ class ProxyHandler { let namedValue = V; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'CEReactions': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'CEReactions': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); const creating = !target[implSymbol][utils.supportsPropertyName](P); @@ -12157,7 +12685,8 @@ class ProxyHandler { let namedValue = desc.value; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'CEReactions': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'CEReactions': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); const creating = !target[implSymbol][utils.supportsPropertyName](P); @@ -12207,12 +12736,12 @@ const URLCallback = require(\\"./URLCallback.js\\"); const URLHandlerNonNull = require(\\"./URLHandlerNonNull.js\\"); const VoidFunction = require(\\"./VoidFunction.js\\"); -exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {}) => { +exports._convertInherit = (obj, ret, { context = \\"The provided value\\", ctorRegistry } = {}) => { { const key = \\"function\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = Function.convert(value, { context: context + \\" has member 'function' that\\" }); + value = Function.convert(value, { context: context + \\" has member 'function' that\\", ctorRegistry }); ret[key] = value; } @@ -12222,7 +12751,7 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} const key = \\"urlCallback\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = URLCallback.convert(value, { context: context + \\" has member 'urlCallback' that\\" }); + value = URLCallback.convert(value, { context: context + \\" has member 'urlCallback' that\\", ctorRegistry }); ret[key] = value; } @@ -12235,7 +12764,7 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} if (!utils.isObject(value)) { value = null; } else { - value = URLHandlerNonNull.convert(value, { context: context + \\" has member 'urlHandler' that\\" }); + value = URLHandlerNonNull.convert(value, { context: context + \\" has member 'urlHandler' that\\", ctorRegistry }); } ret[key] = value; } @@ -12245,7 +12774,10 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} const key = \\"urlHandlerNonNull\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = URLHandlerNonNull.convert(value, { context: context + \\" has member 'urlHandlerNonNull' that\\" }); + value = URLHandlerNonNull.convert(value, { + context: context + \\" has member 'urlHandlerNonNull' that\\", + ctorRegistry + }); ret[key] = value; } @@ -12255,20 +12787,26 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} const key = \\"voidFunction\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = VoidFunction.convert(value, { context: context + \\" has member 'voidFunction' that\\" }); + value = VoidFunction.convert(value, { context: context + \\" has member 'voidFunction' that\\", ctorRegistry }); ret[key] = value; } } }; -exports.convert = function convert(obj, { context = \\"The provided value\\" } = {}) { +exports.convert = ( + obj, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (obj !== undefined && typeof obj !== \\"object\\" && typeof obj !== \\"function\\") { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not an object.\`); } const ret = Object.create(null); - exports._convertInherit(obj, ret, { context }); + exports._convertInherit(obj, ret, { context, ctorRegistry }); return ret; }; " @@ -12291,11 +12829,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'DOMImplementation'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'DOMImplementation'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -12365,43 +12903,44 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class DOMImplementation { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } createDocumentType(qualifiedName, publicId, systemId) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'createDocumentType' called on an object that is not a valid instance of DOMImplementation.\\" ); } if (arguments.length < 3) { - throw new TypeError( - \\"Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 1\\" + context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 2\\" + context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[2]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 3\\" + context: \\"Failed to execute 'createDocumentType' on 'DOMImplementation': parameter 3\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -12411,14 +12950,14 @@ exports.install = (globalObject, globalNames) => { createDocument(namespace, qualifiedName) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'createDocument' called on an object that is not a valid instance of DOMImplementation.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'createDocument' called on an object that is not a valid instance of DOMImplementation.\\" + ); } if (arguments.length < 2) { - throw new TypeError( - \\"Failed to execute 'createDocument' on 'DOMImplementation': 2 arguments required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'createDocument' on 'DOMImplementation': 2 arguments required, but only \${arguments.length} present.\` ); } const args = []; @@ -12428,7 +12967,8 @@ exports.install = (globalObject, globalNames) => { curArg = null; } else { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'createDocument' on 'DOMImplementation': parameter 1\\" + context: \\"Failed to execute 'createDocument' on 'DOMImplementation': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); @@ -12437,6 +12977,7 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'createDocument' on 'DOMImplementation': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), treatNullAsEmptyString: true }); args.push(curArg); @@ -12460,7 +13001,7 @@ exports.install = (globalObject, globalNames) => { createHTMLDocument() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'createHTMLDocument' called on an object that is not a valid instance of DOMImplementation.\\" ); } @@ -12469,7 +13010,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[0]; if (curArg !== undefined) { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'createHTMLDocument' on 'DOMImplementation': parameter 1\\" + context: \\"Failed to execute 'createHTMLDocument' on 'DOMImplementation': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); @@ -12480,7 +13022,9 @@ exports.install = (globalObject, globalNames) => { hasFeature() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'hasFeature' called on an object that is not a valid instance of DOMImplementation.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'hasFeature' called on an object that is not a valid instance of DOMImplementation.\\" + ); } return esValue[implSymbol].hasFeature(); @@ -12524,11 +13068,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'DOMRect'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'DOMRect'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -12603,7 +13147,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[0]; if (curArg !== undefined) { curArg = conversions[\\"unrestricted double\\"](curArg, { - context: \\"Failed to construct 'DOMRect': parameter 1\\" + context: \\"Failed to construct 'DOMRect': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = 0; @@ -12614,7 +13159,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[1]; if (curArg !== undefined) { curArg = conversions[\\"unrestricted double\\"](curArg, { - context: \\"Failed to construct 'DOMRect': parameter 2\\" + context: \\"Failed to construct 'DOMRect': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = 0; @@ -12625,7 +13171,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[2]; if (curArg !== undefined) { curArg = conversions[\\"unrestricted double\\"](curArg, { - context: \\"Failed to construct 'DOMRect': parameter 3\\" + context: \\"Failed to construct 'DOMRect': parameter 3\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = 0; @@ -12636,7 +13183,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[3]; if (curArg !== undefined) { curArg = conversions[\\"unrestricted double\\"](curArg, { - context: \\"Failed to construct 'DOMRect': parameter 4\\" + context: \\"Failed to construct 'DOMRect': parameter 4\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = 0; @@ -12650,7 +13198,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get x' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get x' called on an object that is not a valid instance of DOMRect.\\"); } return esValue[implSymbol][\\"x\\"]; @@ -12660,11 +13208,12 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set x' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set x' called on an object that is not a valid instance of DOMRect.\\"); } V = conversions[\\"unrestricted double\\"](V, { - context: \\"Failed to set the 'x' property on 'DOMRect': The provided value\\" + context: \\"Failed to set the 'x' property on 'DOMRect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"x\\"] = V; @@ -12674,7 +13223,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get y' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get y' called on an object that is not a valid instance of DOMRect.\\"); } return esValue[implSymbol][\\"y\\"]; @@ -12684,11 +13233,12 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set y' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set y' called on an object that is not a valid instance of DOMRect.\\"); } V = conversions[\\"unrestricted double\\"](V, { - context: \\"Failed to set the 'y' property on 'DOMRect': The provided value\\" + context: \\"Failed to set the 'y' property on 'DOMRect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"y\\"] = V; @@ -12698,7 +13248,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get width' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get width' called on an object that is not a valid instance of DOMRect.\\" + ); } return esValue[implSymbol][\\"width\\"]; @@ -12708,11 +13260,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set width' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set width' called on an object that is not a valid instance of DOMRect.\\" + ); } V = conversions[\\"unrestricted double\\"](V, { - context: \\"Failed to set the 'width' property on 'DOMRect': The provided value\\" + context: \\"Failed to set the 'width' property on 'DOMRect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"width\\"] = V; @@ -12722,7 +13277,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get height' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get height' called on an object that is not a valid instance of DOMRect.\\" + ); } return esValue[implSymbol][\\"height\\"]; @@ -12732,11 +13289,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set height' called on an object that is not a valid instance of DOMRect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set height' called on an object that is not a valid instance of DOMRect.\\" + ); } V = conversions[\\"unrestricted double\\"](V, { - context: \\"Failed to set the 'height' property on 'DOMRect': The provided value\\" + context: \\"Failed to set the 'height' property on 'DOMRect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"height\\"] = V; @@ -12746,7 +13306,10 @@ exports.install = (globalObject, globalNames) => { const args = []; { let curArg = arguments[0]; - curArg = Dictionary.convert(curArg, { context: \\"Failed to execute 'fromRect' on 'DOMRect': parameter 1\\" }); + curArg = Dictionary.convert(curArg, { + context: \\"Failed to execute 'fromRect' on 'DOMRect': parameter 1\\", + ctorRegistry + }); args.push(curArg); } return utils.tryWrapperForImpl(Impl.implementation.fromRect(globalObject, ...args)); @@ -12790,12 +13353,15 @@ const utils = require(\\"./utils.js\\"); const URL = require(\\"./URL.js\\"); const URLSearchParams = require(\\"./URLSearchParams.js\\"); -exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {}) => { +exports._convertInherit = (obj, ret, { context = \\"The provided value\\", ctorRegistry } = {}) => { { const key = \\"boolWithDefault\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = conversions[\\"boolean\\"](value, { context: context + \\" has member 'boolWithDefault' that\\" }); + value = conversions[\\"boolean\\"](value, { + context: context + \\" has member 'boolWithDefault' that\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); ret[key] = value; } else { @@ -12807,11 +13373,11 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} const key = \\"requiredInterface\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = URL.convert(value, { context: context + \\" has member 'requiredInterface' that\\" }); + value = URL.convert(value, { context: context + \\" has member 'requiredInterface' that\\", ctorRegistry }); ret[key] = value; } else { - throw new TypeError(\\"requiredInterface is required in 'Dictionary'\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"requiredInterface is required in 'Dictionary'\\"); } } @@ -12820,12 +13386,15 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { if (!utils.isObject(value)) { - throw new TypeError(context + \\" has member 'seq' that\\" + \\" is not an iterable object.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](context + \\" has member 'seq' that\\" + \\" is not an iterable object.\\"); } else { const V = []; const tmp = value; for (let nextItem of tmp) { - nextItem = URLSearchParams.convert(nextItem, { context: context + \\" has member 'seq' that\\" + \\"'s element\\" }); + nextItem = URLSearchParams.convert(nextItem, { + context: context + \\" has member 'seq' that\\" + \\"'s element\\", + ctorRegistry + }); V.push(nextItem); } @@ -12840,20 +13409,29 @@ exports._convertInherit = (obj, ret, { context = \\"The provided value\\" } = {} const key = \\"vanillaString\\"; let value = obj === undefined || obj === null ? undefined : obj[key]; if (value !== undefined) { - value = conversions[\\"DOMString\\"](value, { context: context + \\" has member 'vanillaString' that\\" }); + value = conversions[\\"DOMString\\"](value, { + context: context + \\" has member 'vanillaString' that\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); ret[key] = value; } } }; -exports.convert = function convert(obj, { context = \\"The provided value\\" } = {}) { +exports.convert = ( + obj, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (obj !== undefined && typeof obj !== \\"object\\" && typeof obj !== \\"function\\") { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not an object.\`); } const ret = Object.create(null); - exports._convertInherit(obj, ret, { context }); + exports._convertInherit(obj, ret, { context, ctorRegistry }); return ret; }; " @@ -12877,11 +13455,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'DictionaryConvert'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'DictionaryConvert'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -12951,27 +13529,33 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class DictionaryConvert { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } op() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'op' called on an object that is not a valid instance of DictionaryConvert.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'op' called on an object that is not a valid instance of DictionaryConvert.\\" + ); } const args = []; { let curArg = arguments[0]; if (curArg !== undefined) { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'op' on 'DictionaryConvert': parameter 1\\" + context: \\"Failed to execute 'op' on 'DictionaryConvert': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); } { let curArg = arguments[1]; - curArg = Dictionary.convert(curArg, { context: \\"Failed to execute 'op' on 'DictionaryConvert': parameter 2\\" }); + curArg = Dictionary.convert(curArg, { + context: \\"Failed to execute 'op' on 'DictionaryConvert': parameter 2\\", + ctorRegistry + }); args.push(curArg); } return esValue[implSymbol].op(...args); @@ -13012,11 +13596,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Enum'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Enum'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -13086,24 +13670,27 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Enum { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } op(destination) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'op' called on an object that is not a valid instance of Enum.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'op' called on an object that is not a valid instance of Enum.\\"); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'op' on 'Enum': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'op' on 'Enum': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = RequestDestination.convert(curArg, { context: \\"Failed to execute 'op' on 'Enum': parameter 1\\" }); + curArg = RequestDestination.convert(curArg, { + context: \\"Failed to execute 'op' on 'Enum': parameter 1\\", + ctorRegistry + }); args.push(curArg); } return esValue[implSymbol].op(...args); @@ -13113,7 +13700,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get attr' called on an object that is not a valid instance of Enum.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get attr' called on an object that is not a valid instance of Enum.\\"); } return utils.tryWrapperForImpl(esValue[implSymbol][\\"attr\\"]); @@ -13123,7 +13710,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set attr' called on an object that is not a valid instance of Enum.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set attr' called on an object that is not a valid instance of Enum.\\"); } V = \`\${V}\`; @@ -13158,9 +13745,15 @@ exports[`generation without processors EventListener.webidl 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = function convert(value, { context = \\"The provided value\\" } = {}) { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (!utils.isObject(value)) { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not an object.\`); } function callTheUserObjectsOperation(event) { @@ -13171,7 +13764,7 @@ exports.convert = function convert(value, { context = \\"The provided value\\" } if (typeof O !== \\"function\\") { X = O[\\"handleEvent\\"]; if (typeof X !== \\"function\\") { - throw new TypeError(\`\${context} does not correctly implement EventListener.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} does not correctly implement EventListener.\`); } thisArg = O; } @@ -13209,11 +13802,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'EventTarget'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'EventTarget'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -13289,21 +13882,22 @@ exports.install = (globalObject, globalNames) => { addEventListener(type, callback) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'addEventListener' called on an object that is not a valid instance of EventTarget.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'addEventListener' called on an object that is not a valid instance of EventTarget.\\" + ); } if (arguments.length < 2) { - throw new TypeError( - \\"Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'addEventListener' on 'EventTarget': parameter 1\\" + context: \\"Failed to execute 'addEventListener' on 'EventTarget': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -13313,7 +13907,8 @@ exports.install = (globalObject, globalNames) => { curArg = null; } else { curArg = EventListener.convert(curArg, { - context: \\"Failed to execute 'addEventListener' on 'EventTarget': parameter 2\\" + context: \\"Failed to execute 'addEventListener' on 'EventTarget': parameter 2\\", + ctorRegistry }); } args.push(curArg); @@ -13355,11 +13950,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Global'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Global'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -13390,7 +13985,7 @@ exports._internalSetup = (wrapper, globalObject) => { op() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'op' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'op' called on an object that is not a valid instance of Global.\\"); } return esValue[implSymbol].op(); @@ -13398,7 +13993,9 @@ exports._internalSetup = (wrapper, globalObject) => { unforgeableOp() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'unforgeableOp' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'unforgeableOp' called on an object that is not a valid instance of Global.\\" + ); } return esValue[implSymbol].unforgeableOp(); @@ -13407,7 +14004,7 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get attr' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get attr' called on an object that is not a valid instance of Global.\\"); } return esValue[implSymbol][\\"attr\\"]; @@ -13416,10 +14013,13 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set attr' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set attr' called on an object that is not a valid instance of Global.\\"); } - V = conversions[\\"DOMString\\"](V, { context: \\"Failed to set the 'attr' property on 'Global': The provided value\\" }); + V = conversions[\\"DOMString\\"](V, { + context: \\"Failed to set the 'attr' property on 'Global': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"attr\\"] = V; }, @@ -13427,7 +14027,9 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get unforgeableAttr' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get unforgeableAttr' called on an object that is not a valid instance of Global.\\" + ); } return esValue[implSymbol][\\"unforgeableAttr\\"]; @@ -13436,11 +14038,14 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set unforgeableAttr' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set unforgeableAttr' called on an object that is not a valid instance of Global.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'unforgeableAttr' property on 'Global': The provided value\\" + context: \\"Failed to set the 'unforgeableAttr' property on 'Global': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"unforgeableAttr\\"] = V; @@ -13449,7 +14054,9 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get length' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get length' called on an object that is not a valid instance of Global.\\" + ); } return esValue[implSymbol][\\"length\\"]; @@ -13458,11 +14065,14 @@ exports._internalSetup = (wrapper, globalObject) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set length' called on an object that is not a valid instance of Global.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set length' called on an object that is not a valid instance of Global.\\" + ); } V = conversions[\\"unsigned long\\"](V, { - context: \\"Failed to set the 'length' property on 'Global': The provided value\\" + context: \\"Failed to set the 'length' property on 'Global': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"length\\"] = V; @@ -13523,7 +14133,7 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Global { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } static staticOp() { @@ -13540,7 +14150,8 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'staticAttr' property on 'Global': The provided value\\" + context: \\"Failed to set the 'staticAttr' property on 'Global': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); Impl.implementation[\\"staticAttr\\"] = V; @@ -13578,11 +14189,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'HTMLConstructor'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'HTMLConstructor'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -13652,7 +14263,7 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class HTMLConstructor { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } } Object.defineProperties(HTMLConstructor.prototype, { @@ -13688,11 +14299,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'LegacyLenientAttributes'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'LegacyLenientAttributes'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -13762,14 +14373,14 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class LegacyLenientAttributes { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } get lenientSetter() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get lenientSetter' called on an object that is not a valid instance of LegacyLenientAttributes.\\" ); } @@ -13781,7 +14392,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'set lenientSetter' called on an object that is not a valid instance of LegacyLenientAttributes.\\" ); } @@ -13817,7 +14428,8 @@ exports.install = (globalObject, globalNames) => { } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'lenientThis' property on 'LegacyLenientAttributes': The provided value\\" + context: \\"Failed to set the 'lenientThis' property on 'LegacyLenientAttributes': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"lenientThis\\"] = V; @@ -13892,11 +14504,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'LegacyNoInterfaceObject'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'LegacyNoInterfaceObject'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -13966,13 +14578,15 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class LegacyNoInterfaceObject { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } def() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'def' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'def' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\" + ); } return esValue[implSymbol].def(); @@ -13982,7 +14596,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get abc' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get abc' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\" + ); } return esValue[implSymbol][\\"abc\\"]; @@ -13992,11 +14608,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set abc' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set abc' called on an object that is not a valid instance of LegacyNoInterfaceObject.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'abc' property on 'LegacyNoInterfaceObject': The provided value\\" + context: \\"Failed to set the 'abc' property on 'LegacyNoInterfaceObject': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"abc\\"] = V; @@ -14032,11 +14651,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'LegacyUnforgeable'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'LegacyUnforgeable'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -14070,21 +14689,22 @@ function getUnforgeables(globalObject) { assign(url) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'assign' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'assign' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'assign' on 'LegacyUnforgeable': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'assign' on 'LegacyUnforgeable': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'assign' on 'LegacyUnforgeable': parameter 1\\" + context: \\"Failed to execute 'assign' on 'LegacyUnforgeable': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -14094,7 +14714,9 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get href' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get href' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } return esValue[implSymbol][\\"href\\"]; @@ -14103,11 +14725,14 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set href' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set href' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'href' property on 'LegacyUnforgeable': The provided value\\" + context: \\"Failed to set the 'href' property on 'LegacyUnforgeable': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"href\\"] = V; @@ -14115,7 +14740,9 @@ function getUnforgeables(globalObject) { toString() { const esValue = this; if (!exports.is(esValue)) { - throw new TypeError(\\"'toString' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'toString' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } return esValue[implSymbol][\\"href\\"]; @@ -14124,7 +14751,9 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get origin' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get origin' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } return esValue[implSymbol][\\"origin\\"]; @@ -14133,7 +14762,9 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get protocol' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get protocol' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } return esValue[implSymbol][\\"protocol\\"]; @@ -14142,11 +14773,14 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set protocol' called on an object that is not a valid instance of LegacyUnforgeable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set protocol' called on an object that is not a valid instance of LegacyUnforgeable.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'protocol' property on 'LegacyUnforgeable': The provided value\\" + context: \\"Failed to set the 'protocol' property on 'LegacyUnforgeable': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"protocol\\"] = V; @@ -14211,7 +14845,7 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class LegacyUnforgeable { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } } Object.defineProperties(LegacyUnforgeable.prototype, { @@ -14247,11 +14881,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'LegacyUnforgeableMap'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'LegacyUnforgeableMap'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -14286,7 +14920,9 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get a' called on an object that is not a valid instance of LegacyUnforgeableMap.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get a' called on an object that is not a valid instance of LegacyUnforgeableMap.\\" + ); } return esValue[implSymbol][\\"a\\"]; @@ -14351,7 +14987,7 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class LegacyUnforgeableMap { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } } Object.defineProperties(LegacyUnforgeableMap.prototype, { @@ -14450,7 +15086,8 @@ const proxyHandler = { let namedValue = V; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'LegacyUnforgeableMap': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'LegacyUnforgeableMap': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); const creating = !target[implSymbol][utils.supportsPropertyName](P); @@ -14510,7 +15147,8 @@ const proxyHandler = { let namedValue = desc.value; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'LegacyUnforgeableMap': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'LegacyUnforgeableMap': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); const creating = !target[implSymbol][utils.supportsPropertyName](P); @@ -14564,11 +15202,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'MixedIn'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'MixedIn'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -14638,13 +15276,15 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class MixedIn { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } mixedInOp() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'mixedInOp' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'mixedInOp' called on an object that is not a valid instance of MixedIn.\\" + ); } return esValue[implSymbol].mixedInOp(); @@ -14653,7 +15293,9 @@ exports.install = (globalObject, globalNames) => { ifaceMixinOp() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'ifaceMixinOp' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'ifaceMixinOp' called on an object that is not a valid instance of MixedIn.\\" + ); } return esValue[implSymbol].ifaceMixinOp(); @@ -14663,7 +15305,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get mixedInAttr' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get mixedInAttr' called on an object that is not a valid instance of MixedIn.\\" + ); } return esValue[implSymbol][\\"mixedInAttr\\"]; @@ -14673,11 +15317,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set mixedInAttr' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set mixedInAttr' called on an object that is not a valid instance of MixedIn.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'mixedInAttr' property on 'MixedIn': The provided value\\" + context: \\"Failed to set the 'mixedInAttr' property on 'MixedIn': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"mixedInAttr\\"] = V; @@ -14687,7 +15334,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get ifaceMixinAttr' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get ifaceMixinAttr' called on an object that is not a valid instance of MixedIn.\\" + ); } return esValue[implSymbol][\\"ifaceMixinAttr\\"]; @@ -14697,11 +15346,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set ifaceMixinAttr' called on an object that is not a valid instance of MixedIn.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set ifaceMixinAttr' called on an object that is not a valid instance of MixedIn.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'ifaceMixinAttr' property on 'MixedIn': The provided value\\" + context: \\"Failed to set the 'ifaceMixinAttr' property on 'MixedIn': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"ifaceMixinAttr\\"] = V; @@ -14739,9 +15391,15 @@ exports[`generation without processors NodeFilter.webidl 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = function convert(value, { context = \\"The provided value\\" } = {}) { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (!utils.isObject(value)) { - throw new TypeError(\`\${context} is not an object.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not an object.\`); } function callTheUserObjectsOperation(node) { @@ -14752,7 +15410,7 @@ exports.convert = function convert(value, { context = \\"The provided value\\" } if (typeof O !== \\"function\\") { X = O[\\"acceptNode\\"]; if (typeof X !== \\"function\\") { - throw new TypeError(\`\${context} does not correctly implement NodeFilter.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} does not correctly implement NodeFilter.\`); } thisArg = O; } @@ -14761,7 +15419,10 @@ exports.convert = function convert(value, { context = \\"The provided value\\" } let callResult = Reflect.apply(X, thisArg, [node]); - callResult = conversions[\\"unsigned short\\"](callResult, { context: context }); + callResult = conversions[\\"unsigned short\\"](callResult, { + context: context, + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); return callResult; } @@ -14779,8 +15440,9 @@ exports.install = (globalObject, globalNames) => { return; } + const ctorRegistry = utils.initCtorRegistry(globalObject); const NodeFilter = () => { - throw new TypeError(\\"Illegal invocation\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal invocation\\"); }; Object.defineProperties(NodeFilter, { @@ -14829,11 +15491,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Overloads'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Overloads'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -14912,13 +15574,16 @@ exports.install = (globalObject, globalNames) => { if (URL.is(curArg)) { { let curArg = arguments[0]; - curArg = URL.convert(curArg, { context: \\"Failed to construct 'Overloads': parameter 1\\" }); + curArg = URL.convert(curArg, { context: \\"Failed to construct 'Overloads': parameter 1\\", ctorRegistry }); args.push(curArg); } } else { { let curArg = arguments[0]; - curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to construct 'Overloads': parameter 1\\" }); + curArg = conversions[\\"DOMString\\"](curArg, { + context: \\"Failed to construct 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } } @@ -14930,14 +15595,14 @@ exports.install = (globalObject, globalNames) => { compatible(arg1) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'compatible' called on an object that is not a valid instance of Overloads.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'compatible' called on an object that is not a valid instance of Overloads.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'compatible' on 'Overloads': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'compatible' on 'Overloads': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -14946,7 +15611,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -14955,14 +15621,16 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -14971,14 +15639,16 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -14986,7 +15656,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[2]; if (curArg !== undefined) { curArg = conversions[\\"long\\"](curArg, { - context: \\"Failed to execute 'compatible' on 'Overloads': parameter 3\\" + context: \\"Failed to execute 'compatible' on 'Overloads': parameter 3\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = 0; @@ -15000,14 +15671,14 @@ exports.install = (globalObject, globalNames) => { incompatible1(arg1) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'incompatible1' called on an object that is not a valid instance of Overloads.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'incompatible1' called on an object that is not a valid instance of Overloads.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'incompatible1' on 'Overloads': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'incompatible1' on 'Overloads': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -15017,7 +15688,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"long\\"](curArg, { - context: \\"Failed to execute 'incompatible1' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible1' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -15025,7 +15697,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible1' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible1' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -15037,14 +15710,14 @@ exports.install = (globalObject, globalNames) => { incompatible2(arg1) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'incompatible2' called on an object that is not a valid instance of Overloads.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'incompatible2' called on an object that is not a valid instance of Overloads.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'incompatible2' on 'Overloads': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'incompatible2' on 'Overloads': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -15053,7 +15726,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -15062,14 +15736,16 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'incompatible2' on 'Overloads': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -15080,14 +15756,14 @@ exports.install = (globalObject, globalNames) => { incompatible3(arg1) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'incompatible3' called on an object that is not a valid instance of Overloads.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'incompatible3' called on an object that is not a valid instance of Overloads.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'incompatible3' on 'Overloads': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'incompatible3' on 'Overloads': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -15096,7 +15772,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -15105,7 +15782,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -15116,7 +15794,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[1]; if (curArg !== undefined) { curArg = URL.convert(curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\", + ctorRegistry }); } args.push(curArg); @@ -15126,7 +15805,8 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[1]; if (curArg !== undefined) { curArg = URL.convert(curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\", + ctorRegistry }); } args.push(curArg); @@ -15137,7 +15817,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + \\" is not of any supported type.\\" ); } @@ -15149,7 +15829,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + \\" is not of any supported type.\\" ); } @@ -15159,7 +15839,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[1]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -15167,22 +15848,24 @@ exports.install = (globalObject, globalNames) => { } break; case 3: - throw new TypeError( - \\"Failed to execute 'incompatible3' on 'Overloads': only \\" + arguments.length + \\" arguments present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'incompatible3' on 'Overloads': only \${arguments.length} arguments present.\` ); break; default: { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"long\\"](curArg, { - context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\" + context: \\"Failed to execute 'incompatible3' on 'Overloads': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -15191,7 +15874,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'incompatible3' on 'Overloads': parameter 3\\" + \\" is not of any supported type.\\" ); } @@ -15202,7 +15885,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'incompatible3' on 'Overloads': parameter 4\\" + \\" is not of any supported type.\\" ); } @@ -15249,11 +15932,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'PromiseTypes'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'PromiseTypes'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -15288,14 +15971,14 @@ function getUnforgeables(globalObject) { try { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'unforgeablePromiseOperation' called on an object that is not a valid instance of PromiseTypes.\\" ); } return utils.tryWrapperForImpl(esValue[implSymbol].unforgeablePromiseOperation()); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } }, get unforgeablePromiseAttribute() { @@ -15303,14 +15986,14 @@ function getUnforgeables(globalObject) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get unforgeablePromiseAttribute' called on an object that is not a valid instance of PromiseTypes.\\" ); } return utils.tryWrapperForImpl(esValue[implSymbol][\\"unforgeablePromiseAttribute\\"]); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } }); @@ -15370,26 +16053,26 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class PromiseTypes { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } voidPromiseConsumer(p) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'voidPromiseConsumer' called on an object that is not a valid instance of PromiseTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'voidPromiseConsumer' called on an object that is not a valid instance of PromiseTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'voidPromiseConsumer' on 'PromiseTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'voidPromiseConsumer' on 'PromiseTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = new Promise(resolve => resolve(curArg)); + curArg = new ctorRegistry[\\"%Promise%\\"](resolve => resolve(curArg)); args.push(curArg); } return esValue[implSymbol].voidPromiseConsumer(...args); @@ -15398,20 +16081,20 @@ exports.install = (globalObject, globalNames) => { promiseConsumer(p) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'promiseConsumer' called on an object that is not a valid instance of PromiseTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'promiseConsumer' called on an object that is not a valid instance of PromiseTypes.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'promiseConsumer' on 'PromiseTypes': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'promiseConsumer' on 'PromiseTypes': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = new Promise(resolve => resolve(curArg)); + curArg = new ctorRegistry[\\"%Promise%\\"](resolve => resolve(curArg)); args.push(curArg); } return esValue[implSymbol].promiseConsumer(...args); @@ -15421,12 +16104,14 @@ exports.install = (globalObject, globalNames) => { try { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'promiseOperation' called on an object that is not a valid instance of PromiseTypes.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'promiseOperation' called on an object that is not a valid instance of PromiseTypes.\\" + ); } return utils.tryWrapperForImpl(esValue[implSymbol].promiseOperation()); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } @@ -15435,14 +16120,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get promiseAttribute' called on an object that is not a valid instance of PromiseTypes.\\" ); } return utils.tryWrapperForImpl(esValue[implSymbol][\\"promiseAttribute\\"]); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } @@ -15450,7 +16135,7 @@ exports.install = (globalObject, globalNames) => { try { return utils.tryWrapperForImpl(Impl.implementation.staticPromiseOperation()); } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } @@ -15460,7 +16145,7 @@ exports.install = (globalObject, globalNames) => { return Impl.implementation[\\"staticPromiseAttribute\\"]; } catch (e) { - return Promise.reject(e); + return ctorRegistry[\\"%Promise%\\"].reject(e); } } } @@ -15505,11 +16190,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Reflect'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Reflect'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -15579,14 +16264,16 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Reflect { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } get reflectedBoolean() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectedBoolean' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectedBoolean' called on an object that is not a valid instance of Reflect.\\" + ); } return esValue[implSymbol][\\"reflectedBoolean\\"]; @@ -15596,11 +16283,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectedBoolean' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectedBoolean' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"boolean\\"](V, { - context: \\"Failed to set the 'reflectedBoolean' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectedBoolean' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"reflectedBoolean\\"] = V; @@ -15610,7 +16300,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectedDOMString' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectedDOMString' called on an object that is not a valid instance of Reflect.\\" + ); } return esValue[implSymbol][\\"reflectedDOMString\\"]; @@ -15620,11 +16312,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectedDOMString' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectedDOMString' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'reflectedDOMString' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectedDOMString' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"reflectedDOMString\\"] = V; @@ -15634,7 +16329,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectedLong' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectedLong' called on an object that is not a valid instance of Reflect.\\" + ); } return esValue[implSymbol][\\"reflectedLong\\"]; @@ -15644,11 +16341,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectedLong' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectedLong' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"long\\"](V, { - context: \\"Failed to set the 'reflectedLong' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectedLong' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"reflectedLong\\"] = V; @@ -15658,7 +16358,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectedUnsignedLong' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectedUnsignedLong' called on an object that is not a valid instance of Reflect.\\" + ); } return esValue[implSymbol][\\"reflectedUnsignedLong\\"]; @@ -15668,11 +16370,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectedUnsignedLong' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectedUnsignedLong' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"unsigned long\\"](V, { - context: \\"Failed to set the 'reflectedUnsignedLong' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectedUnsignedLong' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"reflectedUnsignedLong\\"] = V; @@ -15682,7 +16387,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectedUSVStringURL' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectedUSVStringURL' called on an object that is not a valid instance of Reflect.\\" + ); } return esValue[implSymbol][\\"reflectedUSVStringURL\\"]; @@ -15692,11 +16399,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectedUSVStringURL' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectedUSVStringURL' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'reflectedUSVStringURL' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectedUSVStringURL' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"reflectedUSVStringURL\\"] = V; @@ -15706,7 +16416,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get reflectionTest' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get reflectionTest' called on an object that is not a valid instance of Reflect.\\" + ); } return esValue[implSymbol][\\"reflectionTest\\"]; @@ -15716,11 +16428,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set reflectionTest' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set reflectionTest' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'reflectionTest' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'reflectionTest' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"reflectionTest\\"] = V; @@ -15730,7 +16445,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get withUnderscore' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get withUnderscore' called on an object that is not a valid instance of Reflect.\\" + ); } return esValue[implSymbol][\\"withUnderscore\\"]; @@ -15740,11 +16457,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set withUnderscore' called on an object that is not a valid instance of Reflect.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set withUnderscore' called on an object that is not a valid instance of Reflect.\\" + ); } V = conversions[\\"DOMString\\"](V, { - context: \\"Failed to set the 'withUnderscore' property on 'Reflect': The provided value\\" + context: \\"Failed to set the 'withUnderscore' property on 'Reflect': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"withUnderscore\\"] = V; @@ -15790,11 +16510,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Replaceable'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Replaceable'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -15864,14 +16584,16 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Replaceable { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } get replaceable() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get replaceable' called on an object that is not a valid instance of Replaceable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get replaceable' called on an object that is not a valid instance of Replaceable.\\" + ); } return esValue[implSymbol][\\"replaceable\\"]; @@ -15881,7 +16603,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set replaceable' called on an object that is not a valid instance of Replaceable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set replaceable' called on an object that is not a valid instance of Replaceable.\\" + ); } Object.defineProperty(esValue, \\"replaceable\\", { @@ -15932,10 +16656,12 @@ const enumerationValues = new Set([ ]); exports.enumerationValues = enumerationValues; -exports.convert = function convert(value, { context = \\"The provided value\\" } = {}) { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { const string = \`\${value}\`; if (!enumerationValues.has(string)) { - throw new TypeError(\`\${context} '\${string}' is not a valid enumeration value for RequestDestination\`); + throw new ctorRegistry[\\"%TypeError%\\"]( + \`\${context} '\${string}' is not a valid enumeration value for RequestDestination\` + ); } return string; }; @@ -15960,11 +16686,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'SeqAndRec'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'SeqAndRec'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -16040,21 +16766,23 @@ exports.install = (globalObject, globalNames) => { recordConsumer(rec) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'recordConsumer' called on an object that is not a valid instance of SeqAndRec.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'recordConsumer' called on an object that is not a valid instance of SeqAndRec.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'recordConsumer' on 'SeqAndRec': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'recordConsumer' on 'SeqAndRec': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError(\\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\" is not an object.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\" is not an object.\\" + ); } else { const result = Object.create(null); for (const key of Reflect.ownKeys(curArg)) { @@ -16063,13 +16791,15 @@ exports.install = (globalObject, globalNames) => { let typedKey = key; typedKey = conversions[\\"USVString\\"](typedKey, { - context: \\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s key\\" + context: \\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; typedValue = conversions[\\"double\\"](typedValue, { - context: \\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s value\\" + context: \\"Failed to execute 'recordConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); result[typedKey] = typedValue; @@ -16085,21 +16815,23 @@ exports.install = (globalObject, globalNames) => { recordConsumer2(rec) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'recordConsumer2' called on an object that is not a valid instance of SeqAndRec.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'recordConsumer2' called on an object that is not a valid instance of SeqAndRec.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'recordConsumer2' on 'SeqAndRec': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError(\\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\" is not an object.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\" is not an object.\\" + ); } else { const result = Object.create(null); for (const key of Reflect.ownKeys(curArg)) { @@ -16108,13 +16840,15 @@ exports.install = (globalObject, globalNames) => { let typedKey = key; typedKey = conversions[\\"USVString\\"](typedKey, { - context: \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\"'s key\\" + context: \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; typedValue = URL.convert(typedValue, { - context: \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\"'s value\\" + context: \\"Failed to execute 'recordConsumer2' on 'SeqAndRec': parameter 1\\" + \\"'s value\\", + ctorRegistry }); result[typedKey] = typedValue; @@ -16130,21 +16864,21 @@ exports.install = (globalObject, globalNames) => { sequenceConsumer(seq) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'sequenceConsumer' called on an object that is not a valid instance of SeqAndRec.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'sequenceConsumer' called on an object that is not a valid instance of SeqAndRec.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'sequenceConsumer' on 'SeqAndRec': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'sequenceConsumer' on 'SeqAndRec': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'sequenceConsumer' on 'SeqAndRec': parameter 1\\" + \\" is not an iterable object.\\" ); } else { @@ -16152,7 +16886,8 @@ exports.install = (globalObject, globalNames) => { const tmp = curArg; for (let nextItem of tmp) { nextItem = conversions[\\"USVString\\"](nextItem, { - context: \\"Failed to execute 'sequenceConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s element\\" + context: \\"Failed to execute 'sequenceConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s element\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); V.push(nextItem); @@ -16167,21 +16902,21 @@ exports.install = (globalObject, globalNames) => { sequenceConsumer2(seq) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'sequenceConsumer2' called on an object that is not a valid instance of SeqAndRec.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'sequenceConsumer2' called on an object that is not a valid instance of SeqAndRec.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'sequenceConsumer2' on 'SeqAndRec': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'sequenceConsumer2' on 'SeqAndRec': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'sequenceConsumer2' on 'SeqAndRec': parameter 1\\" + \\" is not an iterable object.\\" ); } else { @@ -16202,21 +16937,21 @@ exports.install = (globalObject, globalNames) => { frozenArrayConsumer(arr) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'frozenArrayConsumer' called on an object that is not a valid instance of SeqAndRec.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'frozenArrayConsumer' called on an object that is not a valid instance of SeqAndRec.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'frozenArrayConsumer' on 'SeqAndRec': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'frozenArrayConsumer' on 'SeqAndRec': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'frozenArrayConsumer' on 'SeqAndRec': parameter 1\\" + \\" is not an iterable object.\\" ); } else { @@ -16224,7 +16959,8 @@ exports.install = (globalObject, globalNames) => { const tmp = curArg; for (let nextItem of tmp) { nextItem = conversions[\\"double\\"](nextItem, { - context: \\"Failed to execute 'frozenArrayConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s element\\" + context: \\"Failed to execute 'frozenArrayConsumer' on 'SeqAndRec': parameter 1\\" + \\"'s element\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); V.push(nextItem); @@ -16275,11 +17011,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Static'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Static'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -16349,13 +17085,13 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Static { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } def() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'def' called on an object that is not a valid instance of Static.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'def' called on an object that is not a valid instance of Static.\\"); } return esValue[implSymbol].def(); @@ -16365,7 +17101,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get abc' called on an object that is not a valid instance of Static.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get abc' called on an object that is not a valid instance of Static.\\"); } return esValue[implSymbol][\\"abc\\"]; @@ -16375,10 +17111,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set abc' called on an object that is not a valid instance of Static.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set abc' called on an object that is not a valid instance of Static.\\"); } - V = conversions[\\"DOMString\\"](V, { context: \\"Failed to set the 'abc' property on 'Static': The provided value\\" }); + V = conversions[\\"DOMString\\"](V, { + context: \\"Failed to set the 'abc' property on 'Static': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"abc\\"] = V; } @@ -16396,7 +17135,10 @@ exports.install = (globalObject, globalNames) => { static set abc(V) { const esValue = this !== null && this !== undefined ? this : globalObject; - V = conversions[\\"DOMString\\"](V, { context: \\"Failed to set the 'abc' property on 'Static': The provided value\\" }); + V = conversions[\\"DOMString\\"](V, { + context: \\"Failed to set the 'abc' property on 'Static': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); Impl.implementation[\\"abc\\"] = V; } @@ -16437,11 +17179,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Storage'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Storage'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -16515,24 +17257,27 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Storage { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } key(index) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'key' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'key' called on an object that is not a valid instance of Storage.\\"); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'key' on 'Storage': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'key' on 'Storage': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = conversions[\\"unsigned long\\"](curArg, { context: \\"Failed to execute 'key' on 'Storage': parameter 1\\" }); + curArg = conversions[\\"unsigned long\\"](curArg, { + context: \\"Failed to execute 'key' on 'Storage': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } return esValue[implSymbol].key(...args); @@ -16541,18 +17286,21 @@ exports.install = (globalObject, globalNames) => { getItem(key) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'getItem' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'getItem' called on an object that is not a valid instance of Storage.\\"); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'getItem' on 'Storage': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'getItem' on 'Storage': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'getItem' on 'Storage': parameter 1\\" }); + curArg = conversions[\\"DOMString\\"](curArg, { + context: \\"Failed to execute 'getItem' on 'Storage': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } return esValue[implSymbol].getItem(...args); @@ -16561,23 +17309,29 @@ exports.install = (globalObject, globalNames) => { setItem(key, value) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'setItem' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'setItem' called on an object that is not a valid instance of Storage.\\"); } if (arguments.length < 2) { - throw new TypeError( - \\"Failed to execute 'setItem' on 'Storage': 2 arguments required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'setItem' on 'Storage': 2 arguments required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'setItem' on 'Storage': parameter 1\\" }); + curArg = conversions[\\"DOMString\\"](curArg, { + context: \\"Failed to execute 'setItem' on 'Storage': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } { let curArg = arguments[1]; - curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'setItem' on 'Storage': parameter 2\\" }); + curArg = conversions[\\"DOMString\\"](curArg, { + context: \\"Failed to execute 'setItem' on 'Storage': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } return esValue[implSymbol].setItem(...args); @@ -16586,19 +17340,22 @@ exports.install = (globalObject, globalNames) => { removeItem(key) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'removeItem' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'removeItem' called on an object that is not a valid instance of Storage.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'removeItem' on 'Storage': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'removeItem' on 'Storage': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'removeItem' on 'Storage': parameter 1\\" + context: \\"Failed to execute 'removeItem' on 'Storage': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -16608,7 +17365,7 @@ exports.install = (globalObject, globalNames) => { clear() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'clear' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'clear' called on an object that is not a valid instance of Storage.\\"); } return esValue[implSymbol].clear(); @@ -16618,7 +17375,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get length' called on an object that is not a valid instance of Storage.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get length' called on an object that is not a valid instance of Storage.\\" + ); } return esValue[implSymbol][\\"length\\"]; @@ -16726,7 +17485,8 @@ const proxyHandler = { let namedValue = V; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'Storage': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'Storage': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); target[implSymbol].setItem(P, namedValue); @@ -16780,7 +17540,8 @@ const proxyHandler = { let namedValue = desc.value; namedValue = conversions[\\"DOMString\\"](namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'Storage': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'Storage': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); target[implSymbol].setItem(P, namedValue); @@ -16829,11 +17590,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'StringifierAttribute'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'StringifierAttribute'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -16903,14 +17664,16 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class StringifierAttribute { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } get attr() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get attr' called on an object that is not a valid instance of StringifierAttribute.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get attr' called on an object that is not a valid instance of StringifierAttribute.\\" + ); } return esValue[implSymbol][\\"attr\\"]; @@ -16919,7 +17682,9 @@ exports.install = (globalObject, globalNames) => { toString() { const esValue = this; if (!exports.is(esValue)) { - throw new TypeError(\\"'toString' called on an object that is not a valid instance of StringifierAttribute.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'toString' called on an object that is not a valid instance of StringifierAttribute.\\" + ); } return esValue[implSymbol][\\"attr\\"]; @@ -16960,11 +17725,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'StringifierDefaultOperation'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'StringifierDefaultOperation'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -17034,13 +17799,13 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class StringifierDefaultOperation { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } toString() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'toString' called on an object that is not a valid instance of StringifierDefaultOperation.\\" ); } @@ -17082,11 +17847,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'StringifierNamedOperation'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'StringifierNamedOperation'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -17156,13 +17921,13 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class StringifierNamedOperation { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } operation() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'operation' called on an object that is not a valid instance of StringifierNamedOperation.\\" ); } @@ -17173,7 +17938,7 @@ exports.install = (globalObject, globalNames) => { toString() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'toString' called on an object that is not a valid instance of StringifierNamedOperation.\\" ); } @@ -17216,11 +17981,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'StringifierOperation'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'StringifierOperation'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -17290,13 +18055,15 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class StringifierOperation { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } toString() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'toString' called on an object that is not a valid instance of StringifierOperation.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'toString' called on an object that is not a valid instance of StringifierOperation.\\" + ); } return esValue[implSymbol].toString(); @@ -17338,11 +18105,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'TypedefsAndUnions'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'TypedefsAndUnions'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -17412,22 +18179,20 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class TypedefsAndUnions { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } numOrStrConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'numOrStrConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'numOrStrConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'numOrStrConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -17436,11 +18201,13 @@ exports.install = (globalObject, globalNames) => { if (typeof curArg === \\"number\\") { curArg = conversions[\\"double\\"](curArg, { context: \\"Failed to execute 'numOrStrConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), clamp: true }); } else { curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'numOrStrConsumer' on 'TypedefsAndUnions': parameter 1\\" + context: \\"Failed to execute 'numOrStrConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } args.push(curArg); @@ -17451,16 +18218,14 @@ exports.install = (globalObject, globalNames) => { numOrEnumConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'numOrEnumConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -17471,11 +18236,13 @@ exports.install = (globalObject, globalNames) => { } else { if (typeof curArg === \\"number\\") { curArg = conversions[\\"double\\"](curArg, { - context: \\"Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': parameter 1\\" + context: \\"Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } else { curArg = RequestDestination.convert(curArg, { - context: \\"Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': parameter 1\\" + context: \\"Failed to execute 'numOrEnumConsumer' on 'TypedefsAndUnions': parameter 1\\", + ctorRegistry }); } } @@ -17487,16 +18254,14 @@ exports.install = (globalObject, globalNames) => { numOrStrOrNullConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'numOrStrOrNullConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'numOrStrOrNullConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'numOrStrOrNullConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -17508,12 +18273,14 @@ exports.install = (globalObject, globalNames) => { if (typeof curArg === \\"number\\") { curArg = conversions[\\"double\\"](curArg, { context: \\"Failed to execute 'numOrStrOrNullConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), clamp: true, enforceRange: true }); } else { curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'numOrStrOrNullConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), enforceRange: true }); } @@ -17526,16 +18293,14 @@ exports.install = (globalObject, globalNames) => { numOrStrOrURLOrNullConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'numOrStrOrURLOrNullConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'numOrStrOrURLOrNullConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'numOrStrOrURLOrNullConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -17549,12 +18314,14 @@ exports.install = (globalObject, globalNames) => { } else if (typeof curArg === \\"number\\") { curArg = conversions[\\"double\\"](curArg, { context: \\"Failed to execute 'numOrStrOrURLOrNullConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), clamp: true, enforceRange: true }); } else { curArg = conversions[\\"DOMString\\"](curArg, { context: \\"Failed to execute 'numOrStrOrURLOrNullConsumer' on 'TypedefsAndUnions': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry), enforceRange: true }); } @@ -17567,23 +18334,21 @@ exports.install = (globalObject, globalNames) => { urlMapInnerConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'urlMapInnerConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" is not an object.\\" ); } else { @@ -17594,13 +18359,15 @@ exports.install = (globalObject, globalNames) => { let typedKey = key; typedKey = conversions[\\"USVString\\"](typedKey, { - context: \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s key\\" + context: \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; typedValue = URL.convert(typedValue, { - context: \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s value\\" + context: \\"Failed to execute 'urlMapInnerConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s value\\", + ctorRegistry }); result[typedKey] = typedValue; @@ -17616,14 +18383,14 @@ exports.install = (globalObject, globalNames) => { urlMapConsumer(a) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'urlMapConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'urlMapConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -17633,7 +18400,7 @@ exports.install = (globalObject, globalNames) => { curArg = null; } else { if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" is not an object.\\" ); } else { @@ -17644,13 +18411,15 @@ exports.install = (globalObject, globalNames) => { let typedKey = key; typedKey = conversions[\\"USVString\\"](typedKey, { - context: \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s key\\" + context: \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; typedValue = URL.convert(typedValue, { - context: \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s value\\" + context: \\"Failed to execute 'urlMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\"'s value\\", + ctorRegistry }); result[typedKey] = typedValue; @@ -17667,16 +18436,14 @@ exports.install = (globalObject, globalNames) => { bufferSourceOrURLConsumer(b) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'bufferSourceOrURLConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'bufferSourceOrURLConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'bufferSourceOrURLConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -17687,7 +18454,7 @@ exports.install = (globalObject, globalNames) => { } else if (utils.isArrayBuffer(curArg)) { } else if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'bufferSourceOrURLConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" is not of any supported type.\\" ); @@ -17700,16 +18467,14 @@ exports.install = (globalObject, globalNames) => { arrayBufferViewOrURLMapConsumer(b) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'arrayBufferViewOrURLMapConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -17721,7 +18486,7 @@ exports.install = (globalObject, globalNames) => { if (ArrayBuffer.isView(curArg)) { } else if (utils.isObject(curArg)) { if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" record\\" + \\" is not an object.\\" @@ -17737,7 +18502,8 @@ exports.install = (globalObject, globalNames) => { context: \\"Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" record\\" + - \\"'s key\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; @@ -17746,7 +18512,8 @@ exports.install = (globalObject, globalNames) => { context: \\"Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" record\\" + - \\"'s value\\" + \\"'s value\\", + ctorRegistry }); result[typedKey] = typedValue; @@ -17755,7 +18522,7 @@ exports.install = (globalObject, globalNames) => { curArg = result; } } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'arrayBufferViewOrURLMapConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" is not of any supported type.\\" ); @@ -17769,16 +18536,14 @@ exports.install = (globalObject, globalNames) => { arrayBufferViewDupConsumer(b) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'arrayBufferViewDupConsumer' called on an object that is not a valid instance of TypedefsAndUnions.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'arrayBufferViewDupConsumer' on 'TypedefsAndUnions': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'arrayBufferViewDupConsumer' on 'TypedefsAndUnions': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -17786,7 +18551,7 @@ exports.install = (globalObject, globalNames) => { let curArg = arguments[0]; if (ArrayBuffer.isView(curArg)) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'arrayBufferViewDupConsumer' on 'TypedefsAndUnions': parameter 1\\" + \\" is not of any supported type.\\" ); @@ -17800,7 +18565,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get buf' called on an object that is not a valid instance of TypedefsAndUnions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get buf' called on an object that is not a valid instance of TypedefsAndUnions.\\" + ); } return utils.tryWrapperForImpl(esValue[implSymbol][\\"buf\\"]); @@ -17810,7 +18577,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set buf' called on an object that is not a valid instance of TypedefsAndUnions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set buf' called on an object that is not a valid instance of TypedefsAndUnions.\\" + ); } if (utils.isArrayBuffer(V)) { @@ -17819,7 +18588,7 @@ exports.install = (globalObject, globalNames) => { (V.constructor.name === \\"Uint8Array\\" || V.constructor.name === \\"Uint16Array\\") ) { } else { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to set the 'buf' property on 'TypedefsAndUnions': The provided value\\" + \\" is not of any supported type.\\" ); @@ -17831,7 +18600,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get time' called on an object that is not a valid instance of TypedefsAndUnions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get time' called on an object that is not a valid instance of TypedefsAndUnions.\\" + ); } return esValue[implSymbol][\\"time\\"]; @@ -17841,11 +18612,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set time' called on an object that is not a valid instance of TypedefsAndUnions.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set time' called on an object that is not a valid instance of TypedefsAndUnions.\\" + ); } V = conversions[\\"unsigned long long\\"](V, { - context: \\"Failed to set the 'time' property on 'TypedefsAndUnions': The provided value\\" + context: \\"Failed to set the 'time' property on 'TypedefsAndUnions': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"time\\"] = V; @@ -17895,11 +18669,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'URL'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'URL'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -17970,20 +18744,26 @@ exports.install = (globalObject, globalNames) => { class URL { constructor(url) { if (arguments.length < 1) { - throw new TypeError( - \\"Failed to construct 'URL': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to construct 'URL': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; - curArg = conversions[\\"USVString\\"](curArg, { context: \\"Failed to construct 'URL': parameter 1\\" }); + curArg = conversions[\\"USVString\\"](curArg, { + context: \\"Failed to construct 'URL': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); args.push(curArg); } { let curArg = arguments[1]; if (curArg !== undefined) { - curArg = conversions[\\"USVString\\"](curArg, { context: \\"Failed to construct 'URL': parameter 2\\" }); + curArg = conversions[\\"USVString\\"](curArg, { + context: \\"Failed to construct 'URL': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); } args.push(curArg); } @@ -17993,7 +18773,7 @@ exports.install = (globalObject, globalNames) => { toJSON() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'toJSON' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'toJSON' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol].toJSON(); @@ -18003,7 +18783,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get href' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get href' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"href\\"]; @@ -18013,10 +18793,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set href' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set href' called on an object that is not a valid instance of URL.\\"); } - V = conversions[\\"USVString\\"](V, { context: \\"Failed to set the 'href' property on 'URL': The provided value\\" }); + V = conversions[\\"USVString\\"](V, { + context: \\"Failed to set the 'href' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"href\\"] = V; } @@ -18024,7 +18807,7 @@ exports.install = (globalObject, globalNames) => { toString() { const esValue = this; if (!exports.is(esValue)) { - throw new TypeError(\\"'toString' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'toString' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"href\\"]; @@ -18034,7 +18817,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get origin' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get origin' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"origin\\"]; @@ -18044,7 +18827,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get protocol' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get protocol' called on an object that is not a valid instance of URL.\\" + ); } return esValue[implSymbol][\\"protocol\\"]; @@ -18054,11 +18839,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set protocol' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set protocol' called on an object that is not a valid instance of URL.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'protocol' property on 'URL': The provided value\\" + context: \\"Failed to set the 'protocol' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"protocol\\"] = V; @@ -18068,7 +18856,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get username' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get username' called on an object that is not a valid instance of URL.\\" + ); } return esValue[implSymbol][\\"username\\"]; @@ -18078,11 +18868,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set username' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set username' called on an object that is not a valid instance of URL.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'username' property on 'URL': The provided value\\" + context: \\"Failed to set the 'username' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"username\\"] = V; @@ -18092,7 +18885,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get password' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get password' called on an object that is not a valid instance of URL.\\" + ); } return esValue[implSymbol][\\"password\\"]; @@ -18102,11 +18897,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set password' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set password' called on an object that is not a valid instance of URL.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'password' property on 'URL': The provided value\\" + context: \\"Failed to set the 'password' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"password\\"] = V; @@ -18116,7 +18914,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get host' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get host' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"host\\"]; @@ -18126,10 +18924,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set host' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set host' called on an object that is not a valid instance of URL.\\"); } - V = conversions[\\"USVString\\"](V, { context: \\"Failed to set the 'host' property on 'URL': The provided value\\" }); + V = conversions[\\"USVString\\"](V, { + context: \\"Failed to set the 'host' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"host\\"] = V; } @@ -18138,7 +18939,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get hostname' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get hostname' called on an object that is not a valid instance of URL.\\" + ); } return esValue[implSymbol][\\"hostname\\"]; @@ -18148,11 +18951,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set hostname' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set hostname' called on an object that is not a valid instance of URL.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'hostname' property on 'URL': The provided value\\" + context: \\"Failed to set the 'hostname' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"hostname\\"] = V; @@ -18162,7 +18968,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get port' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get port' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"port\\"]; @@ -18172,10 +18978,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set port' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set port' called on an object that is not a valid instance of URL.\\"); } - V = conversions[\\"USVString\\"](V, { context: \\"Failed to set the 'port' property on 'URL': The provided value\\" }); + V = conversions[\\"USVString\\"](V, { + context: \\"Failed to set the 'port' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"port\\"] = V; } @@ -18184,7 +18993,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get pathname' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get pathname' called on an object that is not a valid instance of URL.\\" + ); } return esValue[implSymbol][\\"pathname\\"]; @@ -18194,11 +19005,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set pathname' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set pathname' called on an object that is not a valid instance of URL.\\" + ); } V = conversions[\\"USVString\\"](V, { - context: \\"Failed to set the 'pathname' property on 'URL': The provided value\\" + context: \\"Failed to set the 'pathname' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"pathname\\"] = V; @@ -18208,7 +19022,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get search' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get search' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"search\\"]; @@ -18218,10 +19032,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set search' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set search' called on an object that is not a valid instance of URL.\\"); } - V = conversions[\\"USVString\\"](V, { context: \\"Failed to set the 'search' property on 'URL': The provided value\\" }); + V = conversions[\\"USVString\\"](V, { + context: \\"Failed to set the 'search' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"search\\"] = V; } @@ -18230,7 +19047,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get searchParams' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get searchParams' called on an object that is not a valid instance of URL.\\" + ); } return utils.getSameObject(this, \\"searchParams\\", () => { @@ -18242,7 +19061,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get hash' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'get hash' called on an object that is not a valid instance of URL.\\"); } return esValue[implSymbol][\\"hash\\"]; @@ -18252,10 +19071,13 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set hash' called on an object that is not a valid instance of URL.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'set hash' called on an object that is not a valid instance of URL.\\"); } - V = conversions[\\"USVString\\"](V, { context: \\"Failed to set the 'hash' property on 'URL': The provided value\\" }); + V = conversions[\\"USVString\\"](V, { + context: \\"Failed to set the 'hash' property on 'URL': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); esValue[implSymbol][\\"hash\\"] = V; } @@ -18306,9 +19128,15 @@ const utils = require(\\"./utils.js\\"); const URL = require(\\"./URL.js\\"); -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { if (typeof value !== \\"function\\") { - throw new TypeError(context + \\" is not a function\\"); + throw new ctorRegistry[\\"%TypeError%\\"](context + \\" is not a function\\"); } function invokeTheCallbackFunction(url, string) { @@ -18319,7 +19147,7 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { callResult = Reflect.apply(value, thisArg, [url, string]); - callResult = URL.convert(callResult, { context: context }); + callResult = URL.convert(callResult, { context: context, ctorRegistry }); return callResult; } @@ -18329,7 +19157,7 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { let callResult = Reflect.construct(value, [url, string]); - callResult = URL.convert(callResult, { context: context }); + callResult = URL.convert(callResult, { context: context, ctorRegistry }); return callResult; }; @@ -18348,7 +19176,13 @@ exports[`generation without processors URLHandlerNonNull.webidl 1`] = ` const conversions = require(\\"webidl-conversions\\"); const utils = require(\\"./utils.js\\"); -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = ( + value, + { + context = \\"The provided value\\", + ctorRegistry = { \\"%TypeError%\\": TypeError, \\"%Number%\\": Number, \\"%Promise%\\": Promise, \\"%String%\\": String } + } = {} +) => { function invokeTheCallbackFunction(url) { const thisArg = utils.tryWrapperForImpl(this); let callResult; @@ -18359,7 +19193,10 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { callResult = Reflect.apply(value, thisArg, [url]); } - callResult = conversions[\\"any\\"](callResult, { context: context }); + callResult = conversions[\\"any\\"](callResult, { + context: context, + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); return callResult; } @@ -18369,7 +19206,10 @@ exports.convert = (value, { context = \\"The provided value\\" } = {}) => { let callResult = Reflect.construct(value, [url]); - callResult = conversions[\\"any\\"](callResult, { context: context }); + callResult = conversions[\\"any\\"](callResult, { + context: context, + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) + }); return callResult; }; @@ -18399,11 +19239,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'URLList'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'URLList'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -18477,25 +19317,26 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class URLList { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } item(index) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'item' called on an object that is not a valid instance of URLList.\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"'item' called on an object that is not a valid instance of URLList.\\"); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'item' on 'URLList': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'item' on 'URLList': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"unsigned long\\"](curArg, { - context: \\"Failed to execute 'item' on 'URLList': parameter 1\\" + context: \\"Failed to execute 'item' on 'URLList': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -18506,7 +19347,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get length' called on an object that is not a valid instance of URLList.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get length' called on an object that is not a valid instance of URLList.\\" + ); } return esValue[implSymbol][\\"length\\"]; @@ -18718,11 +19561,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'URLSearchParams'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'URLSearchParams'.\`); }; exports.createDefaultIterator = (globalObject, target, kind) => { @@ -18810,7 +19653,7 @@ exports.install = (globalObject, globalNames) => { if (utils.isObject(curArg)) { if (curArg[Symbol.iterator] !== undefined) { if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" sequence\\" + \\" is not an iterable object.\\" ); } else { @@ -18818,7 +19661,7 @@ exports.install = (globalObject, globalNames) => { const tmp = curArg; for (let nextItem of tmp) { if (!utils.isObject(nextItem)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" sequence\\" + \\"'s element\\" + @@ -18833,7 +19676,8 @@ exports.install = (globalObject, globalNames) => { \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" sequence\\" + \\"'s element\\" + - \\"'s element\\" + \\"'s element\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); V.push(nextItem); @@ -18847,7 +19691,7 @@ exports.install = (globalObject, globalNames) => { } } else { if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" record\\" + \\" is not an object.\\" ); } else { @@ -18858,13 +19702,15 @@ exports.install = (globalObject, globalNames) => { let typedKey = key; typedKey = conversions[\\"USVString\\"](typedKey, { - context: \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" record\\" + \\"'s key\\" + context: \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" record\\" + \\"'s key\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); let typedValue = curArg[key]; typedValue = conversions[\\"USVString\\"](typedValue, { - context: \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" record\\" + \\"'s value\\" + context: \\"Failed to construct 'URLSearchParams': parameter 1\\" + \\" record\\" + \\"'s value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); result[typedKey] = typedValue; @@ -18875,7 +19721,8 @@ exports.install = (globalObject, globalNames) => { } } else { curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to construct 'URLSearchParams': parameter 1\\" + context: \\"Failed to construct 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); } } else { @@ -18889,28 +19736,30 @@ exports.install = (globalObject, globalNames) => { append(name, value) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'append' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'append' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 2) { - throw new TypeError( - \\"Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'append' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'append' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'append' on 'URLSearchParams': parameter 2\\" + context: \\"Failed to execute 'append' on 'URLSearchParams': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -18920,21 +19769,22 @@ exports.install = (globalObject, globalNames) => { delete(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'delete' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'delete' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'delete' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'delete' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -18944,21 +19794,22 @@ exports.install = (globalObject, globalNames) => { get(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'get' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'get' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -18968,21 +19819,22 @@ exports.install = (globalObject, globalNames) => { getAll(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'getAll' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'getAll' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'getAll' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'getAll' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -18992,21 +19844,22 @@ exports.install = (globalObject, globalNames) => { has(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'has' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'has' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'has' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'has' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -19016,28 +19869,30 @@ exports.install = (globalObject, globalNames) => { set(name, value) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 2) { - throw new TypeError( - \\"Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'set' on 'URLSearchParams': parameter 1\\" + context: \\"Failed to execute 'set' on 'URLSearchParams': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } { let curArg = arguments[1]; curArg = conversions[\\"USVString\\"](curArg, { - context: \\"Failed to execute 'set' on 'URLSearchParams': parameter 2\\" + context: \\"Failed to execute 'set' on 'URLSearchParams': parameter 2\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -19047,7 +19902,9 @@ exports.install = (globalObject, globalNames) => { sort() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'sort' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'sort' called on an object that is not a valid instance of URLSearchParams.\\" + ); } return esValue[implSymbol].sort(); @@ -19056,7 +19913,9 @@ exports.install = (globalObject, globalNames) => { toString() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'toString' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'toString' called on an object that is not a valid instance of URLSearchParams.\\" + ); } return esValue[implSymbol].toString(); @@ -19064,34 +19923,45 @@ exports.install = (globalObject, globalNames) => { keys() { if (!exports.is(this)) { - throw new TypeError(\\"'keys' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'keys' called on an object that is not a valid instance of URLSearchParams.\\" + ); } return exports.createDefaultIterator(globalObject, this, \\"key\\"); } values() { if (!exports.is(this)) { - throw new TypeError(\\"'values' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'values' called on an object that is not a valid instance of URLSearchParams.\\" + ); } return exports.createDefaultIterator(globalObject, this, \\"value\\"); } entries() { if (!exports.is(this)) { - throw new TypeError(\\"'entries' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'entries' called on an object that is not a valid instance of URLSearchParams.\\" + ); } return exports.createDefaultIterator(globalObject, this, \\"key+value\\"); } forEach(callback) { if (!exports.is(this)) { - throw new TypeError(\\"'forEach' called on an object that is not a valid instance of URLSearchParams.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'forEach' called on an object that is not a valid instance of URLSearchParams.\\" + ); } if (arguments.length < 1) { - throw new TypeError(\\"Failed to execute 'forEach' on 'iterable': 1 argument required, \\" + \\"but only 0 present.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present.\\" + ); } callback = Function.convert(callback, { - context: \\"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1\\" + context: \\"Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1\\", + ctorRegistry }); const thisArg = arguments[1]; let pairs = Array.from(this[implSymbol]); @@ -19133,7 +20003,9 @@ exports.install = (globalObject, globalNames) => { next() { const internal = this && this[utils.iterInternalSymbol]; if (!internal) { - throw new TypeError(\\"next() called on a value that is not a URLSearchParams iterator object\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"next() called on a value that is not a URLSearchParams iterator object\\" + ); } const { target, kind, index } = internal; @@ -19178,11 +20050,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'URLSearchParamsCollection'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'URLSearchParamsCollection'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -19256,27 +20128,28 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class URLSearchParamsCollection { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } item(index) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'item' called on an object that is not a valid instance of URLSearchParamsCollection.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'item' called on an object that is not a valid instance of URLSearchParamsCollection.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'item' on 'URLSearchParamsCollection': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'item' on 'URLSearchParamsCollection': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"unsigned long\\"](curArg, { - context: \\"Failed to execute 'item' on 'URLSearchParamsCollection': parameter 1\\" + context: \\"Failed to execute 'item' on 'URLSearchParamsCollection': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -19286,23 +20159,22 @@ exports.install = (globalObject, globalNames) => { namedItem(name) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'namedItem' called on an object that is not a valid instance of URLSearchParamsCollection.\\" ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'namedItem' on 'URLSearchParamsCollection': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'namedItem' on 'URLSearchParamsCollection': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'namedItem' on 'URLSearchParamsCollection': parameter 1\\" + context: \\"Failed to execute 'namedItem' on 'URLSearchParamsCollection': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -19313,7 +20185,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get length' called on an object that is not a valid instance of URLSearchParamsCollection.\\" ); } @@ -19545,11 +20417,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'URLSearchParamsCollection2'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'URLSearchParamsCollection2'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -19625,7 +20497,7 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class URLSearchParamsCollection2 extends globalObject.URLSearchParamsCollection { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } } Object.defineProperties(URLSearchParamsCollection2.prototype, { @@ -19743,7 +20615,8 @@ const proxyHandler = { let namedValue = V; namedValue = URL.convert(namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'URLSearchParamsCollection2': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'URLSearchParamsCollection2': The provided value\\", + ctorRegistry }); const creating = !(target[implSymbol].namedItem(P) !== null); @@ -19819,7 +20692,8 @@ const proxyHandler = { let namedValue = desc.value; namedValue = URL.convert(namedValue, { - context: \\"Failed to set the '\\" + P + \\"' property on 'URLSearchParamsCollection2': The provided value\\" + context: \\"Failed to set the '\\" + P + \\"' property on 'URLSearchParamsCollection2': The provided value\\", + ctorRegistry }); const creating = !(target[implSymbol].namedItem(P) !== null); @@ -19877,11 +20751,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'UnderscoredProperties'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'UnderscoredProperties'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -19951,27 +20825,27 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class UnderscoredProperties { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } operation(sequence) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'operation' called on an object that is not a valid instance of UnderscoredProperties.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'operation' called on an object that is not a valid instance of UnderscoredProperties.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'operation' on 'UnderscoredProperties': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'operation' on 'UnderscoredProperties': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; if (!utils.isObject(curArg)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"Failed to execute 'operation' on 'UnderscoredProperties': parameter 1\\" + \\" is not an iterable object.\\" ); } else { @@ -19979,7 +20853,8 @@ exports.install = (globalObject, globalNames) => { const tmp = curArg; for (let nextItem of tmp) { nextItem = conversions[\\"DOMString\\"](nextItem, { - context: \\"Failed to execute 'operation' on 'UnderscoredProperties': parameter 1\\" + \\"'s element\\" + context: \\"Failed to execute 'operation' on 'UnderscoredProperties': parameter 1\\" + \\"'s element\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); V.push(nextItem); @@ -19995,7 +20870,7 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'get attribute' called on an object that is not a valid instance of UnderscoredProperties.\\" ); } @@ -20007,13 +20882,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError( + throw new ctorRegistry[\\"%TypeError%\\"]( \\"'set attribute' called on an object that is not a valid instance of UnderscoredProperties.\\" ); } V = conversions[\\"byte\\"](V, { - context: \\"Failed to set the 'attribute' property on 'UnderscoredProperties': The provided value\\" + context: \\"Failed to set the 'attribute' property on 'UnderscoredProperties': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"attribute\\"] = V; @@ -20021,17 +20897,16 @@ exports.install = (globalObject, globalNames) => { static static(void_) { if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'static' on 'UnderscoredProperties': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'static' on 'UnderscoredProperties': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'static' on 'UnderscoredProperties': parameter 1\\" + context: \\"Failed to execute 'static' on 'UnderscoredProperties': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -20078,11 +20953,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Unscopable'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Unscopable'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -20152,14 +21027,16 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Unscopable { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } get unscopableTest() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get unscopableTest' called on an object that is not a valid instance of Unscopable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get unscopableTest' called on an object that is not a valid instance of Unscopable.\\" + ); } return esValue[implSymbol][\\"unscopableTest\\"]; @@ -20169,11 +21046,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set unscopableTest' called on an object that is not a valid instance of Unscopable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set unscopableTest' called on an object that is not a valid instance of Unscopable.\\" + ); } V = conversions[\\"boolean\\"](V, { - context: \\"Failed to set the 'unscopableTest' property on 'Unscopable': The provided value\\" + context: \\"Failed to set the 'unscopableTest' property on 'Unscopable': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"unscopableTest\\"] = V; @@ -20183,7 +21063,9 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'get unscopableMixin' called on an object that is not a valid instance of Unscopable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'get unscopableMixin' called on an object that is not a valid instance of Unscopable.\\" + ); } return esValue[implSymbol][\\"unscopableMixin\\"]; @@ -20193,11 +21075,14 @@ exports.install = (globalObject, globalNames) => { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'set unscopableMixin' called on an object that is not a valid instance of Unscopable.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'set unscopableMixin' called on an object that is not a valid instance of Unscopable.\\" + ); } V = conversions[\\"boolean\\"](V, { - context: \\"Failed to set the 'unscopableMixin' property on 'Unscopable': The provided value\\" + context: \\"Failed to set the 'unscopableMixin' property on 'Unscopable': The provided value\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); esValue[implSymbol][\\"unscopableMixin\\"] = V; @@ -20243,11 +21128,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'Variadic'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'Variadic'.\`); }; function makeWrapper(globalObject, newTarget) { @@ -20317,19 +21202,22 @@ exports.install = (globalObject, globalNames) => { const ctorRegistry = utils.initCtorRegistry(globalObject); class Variadic { constructor() { - throw new TypeError(\\"Illegal constructor\\"); + throw new ctorRegistry[\\"%TypeError%\\"](\\"Illegal constructor\\"); } simple1() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'simple1' called on an object that is not a valid instance of Variadic.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'simple1' called on an object that is not a valid instance of Variadic.\\" + ); } const args = []; for (let i = 0; i < arguments.length; i++) { let curArg = arguments[i]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'simple1' on 'Variadic': parameter \\" + (i + 1) + context: \\"Failed to execute 'simple1' on 'Variadic': parameter \\" + (i + 1), + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -20339,25 +21227,31 @@ exports.install = (globalObject, globalNames) => { simple2(first) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'simple2' called on an object that is not a valid instance of Variadic.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'simple2' called on an object that is not a valid instance of Variadic.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'simple2' on 'Variadic': 1 argument required, but only \\" + arguments.length + \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'simple2' on 'Variadic': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'simple2' on 'Variadic': parameter 1\\" + context: \\"Failed to execute 'simple2' on 'Variadic': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } for (let i = 1; i < arguments.length; i++) { let curArg = arguments[i]; - curArg = URL.convert(curArg, { context: \\"Failed to execute 'simple2' on 'Variadic': parameter \\" + (i + 1) }); + curArg = URL.convert(curArg, { + context: \\"Failed to execute 'simple2' on 'Variadic': parameter \\" + (i + 1), + ctorRegistry + }); args.push(curArg); } return esValue[implSymbol].simple2(...args); @@ -20366,7 +21260,9 @@ exports.install = (globalObject, globalNames) => { overloaded1() { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'overloaded1' called on an object that is not a valid instance of Variadic.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'overloaded1' called on an object that is not a valid instance of Variadic.\\" + ); } const args = []; switch (arguments.length) { @@ -20378,7 +21274,8 @@ exports.install = (globalObject, globalNames) => { for (let i = 0; i < arguments.length; i++) { let curArg = arguments[i]; curArg = conversions[\\"unsigned long\\"](curArg, { - context: \\"Failed to execute 'overloaded1' on 'Variadic': parameter \\" + (i + 1) + context: \\"Failed to execute 'overloaded1' on 'Variadic': parameter \\" + (i + 1), + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -20386,7 +21283,8 @@ exports.install = (globalObject, globalNames) => { for (let i = 0; i < arguments.length; i++) { let curArg = arguments[i]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'overloaded1' on 'Variadic': parameter \\" + (i + 1) + context: \\"Failed to execute 'overloaded1' on 'Variadic': parameter \\" + (i + 1), + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -20399,14 +21297,14 @@ exports.install = (globalObject, globalNames) => { overloaded2(first) { const esValue = this !== null && this !== undefined ? this : globalObject; if (!exports.is(esValue)) { - throw new TypeError(\\"'overloaded2' called on an object that is not a valid instance of Variadic.\\"); + throw new ctorRegistry[\\"%TypeError%\\"]( + \\"'overloaded2' called on an object that is not a valid instance of Variadic.\\" + ); } if (arguments.length < 1) { - throw new TypeError( - \\"Failed to execute 'overloaded2' on 'Variadic': 1 argument required, but only \\" + - arguments.length + - \\" present.\\" + throw new ctorRegistry[\\"%TypeError%\\"]( + \`Failed to execute 'overloaded2' on 'Variadic': 1 argument required, but only \${arguments.length} present.\` ); } const args = []; @@ -20418,7 +21316,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"unsigned long\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\" + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -20426,7 +21325,8 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\" + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -20439,14 +21339,16 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"unsigned long\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\" + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } for (let i = 1; i < arguments.length; i++) { let curArg = arguments[i]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter \\" + (i + 1) + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter \\" + (i + 1), + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -20454,14 +21356,16 @@ exports.install = (globalObject, globalNames) => { { let curArg = arguments[0]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\" + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter 1\\", + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } for (let i = 1; i < arguments.length; i++) { let curArg = arguments[i]; curArg = conversions[\\"DOMString\\"](curArg, { - context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter \\" + (i + 1) + context: \\"Failed to execute 'overloaded2' on 'Variadic': parameter \\" + (i + 1), + globals: utils.conversionGlobalsFromCtorRegistry(ctorRegistry) }); args.push(curArg); } @@ -20508,11 +21412,11 @@ exports.is = value => { exports.isImpl = value => { return utils.isObject(value) && value instanceof Impl.implementation; }; -exports.convert = (value, { context = \\"The provided value\\" } = {}) => { +exports.convert = (value, { context = \\"The provided value\\", ctorRegistry = { \\"%TypeError%\\": TypeError } } = {}) => { if (exports.is(value)) { return utils.implForWrapper(value); } - throw new TypeError(\`\${context} is not of type 'ZeroArgConstructor'.\`); + throw new ctorRegistry[\\"%TypeError%\\"](\`\${context} is not of type 'ZeroArgConstructor'.\`); }; function makeWrapper(globalObject, newTarget) {