Upload folder using huggingface_hub (part 8)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +2 -0
- node_modules/jsdom/lib/jsdom/living/generated/OnErrorEventHandlerNonNull.js +56 -0
- node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEvent.js +144 -0
- node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEventInit.js +35 -0
- node_modules/jsdom/lib/jsdom/living/generated/Performance.js +142 -0
- node_modules/jsdom/lib/jsdom/living/generated/Plugin.js +359 -0
- node_modules/jsdom/lib/jsdom/living/generated/PluginArray.js +336 -0
- node_modules/jsdom/lib/jsdom/living/generated/PointerEvent.js +324 -0
- node_modules/jsdom/lib/jsdom/living/generated/PointerEventInit.js +241 -0
- node_modules/jsdom/lib/jsdom/living/generated/PopStateEvent.js +144 -0
- node_modules/jsdom/lib/jsdom/living/generated/PopStateEventInit.js +32 -0
- node_modules/jsdom/lib/jsdom/living/generated/ProcessingInstruction.js +122 -0
- node_modules/jsdom/lib/jsdom/living/generated/ProgressEvent.js +170 -0
- node_modules/jsdom/lib/jsdom/living/generated/ProgressEventInit.js +65 -0
- node_modules/jsdom/lib/jsdom/living/generated/PromiseRejectionEvent.js +157 -0
- node_modules/jsdom/lib/jsdom/living/generated/PromiseRejectionEventInit.js +42 -0
- node_modules/jsdom/lib/jsdom/living/generated/RadioNodeList.js +296 -0
- node_modules/jsdom/lib/jsdom/living/generated/Range.js +641 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedPreserveAspectRatio.js +136 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedRect.js +136 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedString.js +149 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGBoundingBoxOptions.js +64 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGDefsElement.js +109 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGDescElement.js +109 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGElement.js +0 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGGElement.js +109 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGGraphicsElement.js +139 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGMetadataElement.js +109 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGNumber.js +132 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGPreserveAspectRatio.js +196 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGRect.js +210 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGSVGElement.js +786 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGStringList.js +511 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGSwitchElement.js +109 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGSymbolElement.js +146 -0
- node_modules/jsdom/lib/jsdom/living/generated/SVGTitleElement.js +109 -0
- node_modules/jsdom/lib/jsdom/living/generated/Screen.js +180 -0
- node_modules/jsdom/lib/jsdom/living/generated/ScrollBehavior.js +12 -0
- node_modules/jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions.js +45 -0
- node_modules/jsdom/lib/jsdom/living/generated/ScrollLogicalPosition.js +14 -0
- node_modules/jsdom/lib/jsdom/living/generated/ScrollOptions.js +30 -0
- node_modules/jsdom/lib/jsdom/living/generated/ScrollRestoration.js +12 -0
- node_modules/jsdom/lib/jsdom/living/generated/Selection.js +569 -0
- node_modules/jsdom/lib/jsdom/living/generated/SelectionMode.js +12 -0
- node_modules/jsdom/lib/jsdom/living/generated/ShadowRoot.js +187 -0
- node_modules/jsdom/lib/jsdom/living/generated/ShadowRootInit.js +30 -0
- node_modules/jsdom/lib/jsdom/living/generated/ShadowRootMode.js +12 -0
- node_modules/jsdom/lib/jsdom/living/generated/StaticRange.js +123 -0
- node_modules/jsdom/lib/jsdom/living/generated/StaticRangeInit.js +72 -0
- node_modules/jsdom/lib/jsdom/living/generated/Storage.js +397 -0
.gitattributes
CHANGED
|
@@ -52,3 +52,5 @@ node_modules/bcrypt/prebuilds/win32-arm64/bcrypt.node filter=lfs diff=lfs merge=
|
|
| 52 |
node_modules/bcrypt/prebuilds/win32-x64/bcrypt.node filter=lfs diff=lfs merge=lfs -text
|
| 53 |
node_modules/better-sqlite3/build/Release/better_sqlite3.node filter=lfs diff=lfs merge=lfs -text
|
| 54 |
node_modules/esbuild/bin/esbuild filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 52 |
node_modules/bcrypt/prebuilds/win32-x64/bcrypt.node filter=lfs diff=lfs merge=lfs -text
|
| 53 |
node_modules/better-sqlite3/build/Release/better_sqlite3.node filter=lfs diff=lfs merge=lfs -text
|
| 54 |
node_modules/esbuild/bin/esbuild filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
node_modules/lightningcss-linux-x64-musl/lightningcss.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
|
node_modules/jsdom/lib/jsdom/living/generated/OnErrorEventHandlerNonNull.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 7 |
+
function invokeTheCallbackFunction(...args) {
|
| 8 |
+
const thisArg = utils.tryWrapperForImpl(this);
|
| 9 |
+
let callResult;
|
| 10 |
+
|
| 11 |
+
if (typeof value === "function") {
|
| 12 |
+
for (let i = 0; i < Math.min(args.length, 5); i++) {
|
| 13 |
+
args[i] = utils.tryWrapperForImpl(args[i]);
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
if (args.length < 1) {
|
| 17 |
+
for (let i = args.length; i < 1; i++) {
|
| 18 |
+
args[i] = undefined;
|
| 19 |
+
}
|
| 20 |
+
} else if (args.length > 5) {
|
| 21 |
+
args.length = 5;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
callResult = Reflect.apply(value, thisArg, args);
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
callResult = conversions["any"](callResult, { context: context, globals: globalObject });
|
| 28 |
+
|
| 29 |
+
return callResult;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
invokeTheCallbackFunction.construct = (...args) => {
|
| 33 |
+
for (let i = 0; i < Math.min(args.length, 5); i++) {
|
| 34 |
+
args[i] = utils.tryWrapperForImpl(args[i]);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
if (args.length < 1) {
|
| 38 |
+
for (let i = args.length; i < 1; i++) {
|
| 39 |
+
args[i] = undefined;
|
| 40 |
+
}
|
| 41 |
+
} else if (args.length > 5) {
|
| 42 |
+
args.length = 5;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
let callResult = Reflect.construct(value, args);
|
| 46 |
+
|
| 47 |
+
callResult = conversions["any"](callResult, { context: context, globals: globalObject });
|
| 48 |
+
|
| 49 |
+
return callResult;
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
invokeTheCallbackFunction[utils.wrapperSymbol] = value;
|
| 53 |
+
invokeTheCallbackFunction.objectReference = value;
|
| 54 |
+
|
| 55 |
+
return invokeTheCallbackFunction;
|
| 56 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEvent.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const PageTransitionEventInit = require("./PageTransitionEventInit.js");
|
| 7 |
+
const implSymbol = utils.implSymbol;
|
| 8 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 9 |
+
const Event = require("./Event.js");
|
| 10 |
+
|
| 11 |
+
const interfaceName = "PageTransitionEvent";
|
| 12 |
+
|
| 13 |
+
exports.is = value => {
|
| 14 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 15 |
+
};
|
| 16 |
+
exports.isImpl = value => {
|
| 17 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 18 |
+
};
|
| 19 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 20 |
+
if (exports.is(value)) {
|
| 21 |
+
return utils.implForWrapper(value);
|
| 22 |
+
}
|
| 23 |
+
throw new globalObject.TypeError(`${context} is not of type 'PageTransitionEvent'.`);
|
| 24 |
+
};
|
| 25 |
+
|
| 26 |
+
function makeWrapper(globalObject, newTarget) {
|
| 27 |
+
let proto;
|
| 28 |
+
if (newTarget !== undefined) {
|
| 29 |
+
proto = newTarget.prototype;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
if (!utils.isObject(proto)) {
|
| 33 |
+
proto = globalObject[ctorRegistrySymbol]["PageTransitionEvent"].prototype;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return Object.create(proto);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 40 |
+
const wrapper = makeWrapper(globalObject);
|
| 41 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 45 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 46 |
+
return utils.implForWrapper(wrapper);
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 50 |
+
Event._internalSetup(wrapper, globalObject);
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 54 |
+
privateData.wrapper = wrapper;
|
| 55 |
+
|
| 56 |
+
exports._internalSetup(wrapper, globalObject);
|
| 57 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 58 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 59 |
+
configurable: true
|
| 60 |
+
});
|
| 61 |
+
|
| 62 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 63 |
+
if (Impl.init) {
|
| 64 |
+
Impl.init(wrapper[implSymbol]);
|
| 65 |
+
}
|
| 66 |
+
return wrapper;
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
exports.new = (globalObject, newTarget) => {
|
| 70 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 71 |
+
|
| 72 |
+
exports._internalSetup(wrapper, globalObject);
|
| 73 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 74 |
+
value: Object.create(Impl.implementation.prototype),
|
| 75 |
+
configurable: true
|
| 76 |
+
});
|
| 77 |
+
|
| 78 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 79 |
+
if (Impl.init) {
|
| 80 |
+
Impl.init(wrapper[implSymbol]);
|
| 81 |
+
}
|
| 82 |
+
return wrapper[implSymbol];
|
| 83 |
+
};
|
| 84 |
+
|
| 85 |
+
const exposed = new Set(["Window"]);
|
| 86 |
+
|
| 87 |
+
exports.install = (globalObject, globalNames) => {
|
| 88 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 89 |
+
return;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 93 |
+
class PageTransitionEvent extends globalObject.Event {
|
| 94 |
+
constructor(type) {
|
| 95 |
+
if (arguments.length < 1) {
|
| 96 |
+
throw new globalObject.TypeError(
|
| 97 |
+
`Failed to construct 'PageTransitionEvent': 1 argument required, but only ${arguments.length} present.`
|
| 98 |
+
);
|
| 99 |
+
}
|
| 100 |
+
const args = [];
|
| 101 |
+
{
|
| 102 |
+
let curArg = arguments[0];
|
| 103 |
+
curArg = conversions["DOMString"](curArg, {
|
| 104 |
+
context: "Failed to construct 'PageTransitionEvent': parameter 1",
|
| 105 |
+
globals: globalObject
|
| 106 |
+
});
|
| 107 |
+
args.push(curArg);
|
| 108 |
+
}
|
| 109 |
+
{
|
| 110 |
+
let curArg = arguments[1];
|
| 111 |
+
curArg = PageTransitionEventInit.convert(globalObject, curArg, {
|
| 112 |
+
context: "Failed to construct 'PageTransitionEvent': parameter 2"
|
| 113 |
+
});
|
| 114 |
+
args.push(curArg);
|
| 115 |
+
}
|
| 116 |
+
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
get persisted() {
|
| 120 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 121 |
+
|
| 122 |
+
if (!exports.is(esValue)) {
|
| 123 |
+
throw new globalObject.TypeError(
|
| 124 |
+
"'get persisted' called on an object that is not a valid instance of PageTransitionEvent."
|
| 125 |
+
);
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
return esValue[implSymbol]["persisted"];
|
| 129 |
+
}
|
| 130 |
+
}
|
| 131 |
+
Object.defineProperties(PageTransitionEvent.prototype, {
|
| 132 |
+
persisted: { enumerable: true },
|
| 133 |
+
[Symbol.toStringTag]: { value: "PageTransitionEvent", configurable: true }
|
| 134 |
+
});
|
| 135 |
+
ctorRegistry[interfaceName] = PageTransitionEvent;
|
| 136 |
+
|
| 137 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 138 |
+
configurable: true,
|
| 139 |
+
writable: true,
|
| 140 |
+
value: PageTransitionEvent
|
| 141 |
+
});
|
| 142 |
+
};
|
| 143 |
+
|
| 144 |
+
const Impl = require("../events/PageTransitionEvent-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/PageTransitionEventInit.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const EventInit = require("./EventInit.js");
|
| 7 |
+
|
| 8 |
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
| 9 |
+
EventInit._convertInherit(globalObject, obj, ret, { context });
|
| 10 |
+
|
| 11 |
+
{
|
| 12 |
+
const key = "persisted";
|
| 13 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 14 |
+
if (value !== undefined) {
|
| 15 |
+
value = conversions["boolean"](value, {
|
| 16 |
+
context: context + " has member 'persisted' that",
|
| 17 |
+
globals: globalObject
|
| 18 |
+
});
|
| 19 |
+
|
| 20 |
+
ret[key] = value;
|
| 21 |
+
} else {
|
| 22 |
+
ret[key] = false;
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
};
|
| 26 |
+
|
| 27 |
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
| 28 |
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
| 29 |
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
const ret = Object.create(null);
|
| 33 |
+
exports._convertInherit(globalObject, obj, ret, { context });
|
| 34 |
+
return ret;
|
| 35 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/Performance.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
const EventTarget = require("./EventTarget.js");
|
| 9 |
+
|
| 10 |
+
const interfaceName = "Performance";
|
| 11 |
+
|
| 12 |
+
exports.is = value => {
|
| 13 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 14 |
+
};
|
| 15 |
+
exports.isImpl = value => {
|
| 16 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 19 |
+
if (exports.is(value)) {
|
| 20 |
+
return utils.implForWrapper(value);
|
| 21 |
+
}
|
| 22 |
+
throw new globalObject.TypeError(`${context} is not of type 'Performance'.`);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
function makeWrapper(globalObject, newTarget) {
|
| 26 |
+
let proto;
|
| 27 |
+
if (newTarget !== undefined) {
|
| 28 |
+
proto = newTarget.prototype;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!utils.isObject(proto)) {
|
| 32 |
+
proto = globalObject[ctorRegistrySymbol]["Performance"].prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
return Object.create(proto);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 39 |
+
const wrapper = makeWrapper(globalObject);
|
| 40 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 44 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 45 |
+
return utils.implForWrapper(wrapper);
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 49 |
+
EventTarget._internalSetup(wrapper, globalObject);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 53 |
+
privateData.wrapper = wrapper;
|
| 54 |
+
|
| 55 |
+
exports._internalSetup(wrapper, globalObject);
|
| 56 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 57 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 58 |
+
configurable: true
|
| 59 |
+
});
|
| 60 |
+
|
| 61 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 62 |
+
if (Impl.init) {
|
| 63 |
+
Impl.init(wrapper[implSymbol]);
|
| 64 |
+
}
|
| 65 |
+
return wrapper;
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports.new = (globalObject, newTarget) => {
|
| 69 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 70 |
+
|
| 71 |
+
exports._internalSetup(wrapper, globalObject);
|
| 72 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 73 |
+
value: Object.create(Impl.implementation.prototype),
|
| 74 |
+
configurable: true
|
| 75 |
+
});
|
| 76 |
+
|
| 77 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 78 |
+
if (Impl.init) {
|
| 79 |
+
Impl.init(wrapper[implSymbol]);
|
| 80 |
+
}
|
| 81 |
+
return wrapper[implSymbol];
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
const exposed = new Set(["Window", "Worker"]);
|
| 85 |
+
|
| 86 |
+
exports.install = (globalObject, globalNames) => {
|
| 87 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 88 |
+
return;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 92 |
+
class Performance extends globalObject.EventTarget {
|
| 93 |
+
constructor() {
|
| 94 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
now() {
|
| 98 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 99 |
+
if (!exports.is(esValue)) {
|
| 100 |
+
throw new globalObject.TypeError("'now' called on an object that is not a valid instance of Performance.");
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].now());
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
toJSON() {
|
| 107 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 108 |
+
if (!exports.is(esValue)) {
|
| 109 |
+
throw new globalObject.TypeError("'toJSON' called on an object that is not a valid instance of Performance.");
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
return esValue[implSymbol].toJSON();
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
get timeOrigin() {
|
| 116 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 117 |
+
|
| 118 |
+
if (!exports.is(esValue)) {
|
| 119 |
+
throw new globalObject.TypeError(
|
| 120 |
+
"'get timeOrigin' called on an object that is not a valid instance of Performance."
|
| 121 |
+
);
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["timeOrigin"]);
|
| 125 |
+
}
|
| 126 |
+
}
|
| 127 |
+
Object.defineProperties(Performance.prototype, {
|
| 128 |
+
now: { enumerable: true },
|
| 129 |
+
toJSON: { enumerable: true },
|
| 130 |
+
timeOrigin: { enumerable: true },
|
| 131 |
+
[Symbol.toStringTag]: { value: "Performance", configurable: true }
|
| 132 |
+
});
|
| 133 |
+
ctorRegistry[interfaceName] = Performance;
|
| 134 |
+
|
| 135 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 136 |
+
configurable: true,
|
| 137 |
+
writable: true,
|
| 138 |
+
value: Performance
|
| 139 |
+
});
|
| 140 |
+
};
|
| 141 |
+
|
| 142 |
+
const Impl = require("../hr-time/Performance-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/Plugin.js
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "Plugin";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'Plugin'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["Plugin"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
function makeProxy(wrapper, globalObject) {
|
| 38 |
+
let proxyHandler = proxyHandlerCache.get(globalObject);
|
| 39 |
+
if (proxyHandler === undefined) {
|
| 40 |
+
proxyHandler = new ProxyHandler(globalObject);
|
| 41 |
+
proxyHandlerCache.set(globalObject, proxyHandler);
|
| 42 |
+
}
|
| 43 |
+
return new Proxy(wrapper, proxyHandler);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 47 |
+
const wrapper = makeWrapper(globalObject);
|
| 48 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 52 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 53 |
+
return utils.implForWrapper(wrapper);
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 57 |
+
|
| 58 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 59 |
+
privateData.wrapper = wrapper;
|
| 60 |
+
|
| 61 |
+
exports._internalSetup(wrapper, globalObject);
|
| 62 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 63 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 64 |
+
configurable: true
|
| 65 |
+
});
|
| 66 |
+
|
| 67 |
+
wrapper = makeProxy(wrapper, globalObject);
|
| 68 |
+
|
| 69 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 70 |
+
if (Impl.init) {
|
| 71 |
+
Impl.init(wrapper[implSymbol]);
|
| 72 |
+
}
|
| 73 |
+
return wrapper;
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
exports.new = (globalObject, newTarget) => {
|
| 77 |
+
let wrapper = makeWrapper(globalObject, newTarget);
|
| 78 |
+
|
| 79 |
+
exports._internalSetup(wrapper, globalObject);
|
| 80 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 81 |
+
value: Object.create(Impl.implementation.prototype),
|
| 82 |
+
configurable: true
|
| 83 |
+
});
|
| 84 |
+
|
| 85 |
+
wrapper = makeProxy(wrapper, globalObject);
|
| 86 |
+
|
| 87 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 88 |
+
if (Impl.init) {
|
| 89 |
+
Impl.init(wrapper[implSymbol]);
|
| 90 |
+
}
|
| 91 |
+
return wrapper[implSymbol];
|
| 92 |
+
};
|
| 93 |
+
|
| 94 |
+
const exposed = new Set(["Window"]);
|
| 95 |
+
|
| 96 |
+
exports.install = (globalObject, globalNames) => {
|
| 97 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 98 |
+
return;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 102 |
+
class Plugin {
|
| 103 |
+
constructor() {
|
| 104 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
item(index) {
|
| 108 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 109 |
+
if (!exports.is(esValue)) {
|
| 110 |
+
throw new globalObject.TypeError("'item' called on an object that is not a valid instance of Plugin.");
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
if (arguments.length < 1) {
|
| 114 |
+
throw new globalObject.TypeError(
|
| 115 |
+
`Failed to execute 'item' on 'Plugin': 1 argument required, but only ${arguments.length} present.`
|
| 116 |
+
);
|
| 117 |
+
}
|
| 118 |
+
const args = [];
|
| 119 |
+
{
|
| 120 |
+
let curArg = arguments[0];
|
| 121 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 122 |
+
context: "Failed to execute 'item' on 'Plugin': parameter 1",
|
| 123 |
+
globals: globalObject
|
| 124 |
+
});
|
| 125 |
+
args.push(curArg);
|
| 126 |
+
}
|
| 127 |
+
return esValue[implSymbol].item(...args);
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
namedItem(name) {
|
| 131 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 132 |
+
if (!exports.is(esValue)) {
|
| 133 |
+
throw new globalObject.TypeError("'namedItem' called on an object that is not a valid instance of Plugin.");
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
if (arguments.length < 1) {
|
| 137 |
+
throw new globalObject.TypeError(
|
| 138 |
+
`Failed to execute 'namedItem' on 'Plugin': 1 argument required, but only ${arguments.length} present.`
|
| 139 |
+
);
|
| 140 |
+
}
|
| 141 |
+
const args = [];
|
| 142 |
+
{
|
| 143 |
+
let curArg = arguments[0];
|
| 144 |
+
curArg = conversions["DOMString"](curArg, {
|
| 145 |
+
context: "Failed to execute 'namedItem' on 'Plugin': parameter 1",
|
| 146 |
+
globals: globalObject
|
| 147 |
+
});
|
| 148 |
+
args.push(curArg);
|
| 149 |
+
}
|
| 150 |
+
return esValue[implSymbol].namedItem(...args);
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
get name() {
|
| 154 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 155 |
+
|
| 156 |
+
if (!exports.is(esValue)) {
|
| 157 |
+
throw new globalObject.TypeError("'get name' called on an object that is not a valid instance of Plugin.");
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
return esValue[implSymbol]["name"];
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
get description() {
|
| 164 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 165 |
+
|
| 166 |
+
if (!exports.is(esValue)) {
|
| 167 |
+
throw new globalObject.TypeError(
|
| 168 |
+
"'get description' called on an object that is not a valid instance of Plugin."
|
| 169 |
+
);
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
return esValue[implSymbol]["description"];
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
get filename() {
|
| 176 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 177 |
+
|
| 178 |
+
if (!exports.is(esValue)) {
|
| 179 |
+
throw new globalObject.TypeError("'get filename' called on an object that is not a valid instance of Plugin.");
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
return esValue[implSymbol]["filename"];
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
get length() {
|
| 186 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 187 |
+
|
| 188 |
+
if (!exports.is(esValue)) {
|
| 189 |
+
throw new globalObject.TypeError("'get length' called on an object that is not a valid instance of Plugin.");
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
return esValue[implSymbol]["length"];
|
| 193 |
+
}
|
| 194 |
+
}
|
| 195 |
+
Object.defineProperties(Plugin.prototype, {
|
| 196 |
+
item: { enumerable: true },
|
| 197 |
+
namedItem: { enumerable: true },
|
| 198 |
+
name: { enumerable: true },
|
| 199 |
+
description: { enumerable: true },
|
| 200 |
+
filename: { enumerable: true },
|
| 201 |
+
length: { enumerable: true },
|
| 202 |
+
[Symbol.toStringTag]: { value: "Plugin", configurable: true },
|
| 203 |
+
[Symbol.iterator]: { value: globalObject.Array.prototype[Symbol.iterator], configurable: true, writable: true }
|
| 204 |
+
});
|
| 205 |
+
ctorRegistry[interfaceName] = Plugin;
|
| 206 |
+
|
| 207 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 208 |
+
configurable: true,
|
| 209 |
+
writable: true,
|
| 210 |
+
value: Plugin
|
| 211 |
+
});
|
| 212 |
+
};
|
| 213 |
+
|
| 214 |
+
const proxyHandlerCache = new WeakMap();
|
| 215 |
+
class ProxyHandler {
|
| 216 |
+
constructor(globalObject) {
|
| 217 |
+
this._globalObject = globalObject;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
get(target, P, receiver) {
|
| 221 |
+
if (typeof P === "symbol") {
|
| 222 |
+
return Reflect.get(target, P, receiver);
|
| 223 |
+
}
|
| 224 |
+
const desc = this.getOwnPropertyDescriptor(target, P);
|
| 225 |
+
if (desc === undefined) {
|
| 226 |
+
const parent = Object.getPrototypeOf(target);
|
| 227 |
+
if (parent === null) {
|
| 228 |
+
return undefined;
|
| 229 |
+
}
|
| 230 |
+
return Reflect.get(target, P, receiver);
|
| 231 |
+
}
|
| 232 |
+
if (!desc.get && !desc.set) {
|
| 233 |
+
return desc.value;
|
| 234 |
+
}
|
| 235 |
+
const getter = desc.get;
|
| 236 |
+
if (getter === undefined) {
|
| 237 |
+
return undefined;
|
| 238 |
+
}
|
| 239 |
+
return Reflect.apply(getter, receiver, []);
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
has(target, P) {
|
| 243 |
+
if (typeof P === "symbol") {
|
| 244 |
+
return Reflect.has(target, P);
|
| 245 |
+
}
|
| 246 |
+
const desc = this.getOwnPropertyDescriptor(target, P);
|
| 247 |
+
if (desc !== undefined) {
|
| 248 |
+
return true;
|
| 249 |
+
}
|
| 250 |
+
const parent = Object.getPrototypeOf(target);
|
| 251 |
+
if (parent !== null) {
|
| 252 |
+
return Reflect.has(parent, P);
|
| 253 |
+
}
|
| 254 |
+
return false;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
ownKeys(target) {
|
| 258 |
+
const keys = new Set();
|
| 259 |
+
|
| 260 |
+
for (const key of target[implSymbol][utils.supportedPropertyIndices]) {
|
| 261 |
+
keys.add(`${key}`);
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
for (const key of Reflect.ownKeys(target)) {
|
| 265 |
+
keys.add(key);
|
| 266 |
+
}
|
| 267 |
+
return [...keys];
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
getOwnPropertyDescriptor(target, P) {
|
| 271 |
+
if (typeof P === "symbol") {
|
| 272 |
+
return Reflect.getOwnPropertyDescriptor(target, P);
|
| 273 |
+
}
|
| 274 |
+
let ignoreNamedProps = false;
|
| 275 |
+
|
| 276 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 277 |
+
const index = P >>> 0;
|
| 278 |
+
|
| 279 |
+
if (target[implSymbol][utils.supportsPropertyIndex](index)) {
|
| 280 |
+
const indexedValue = target[implSymbol].item(index);
|
| 281 |
+
return {
|
| 282 |
+
writable: false,
|
| 283 |
+
enumerable: true,
|
| 284 |
+
configurable: true,
|
| 285 |
+
value: utils.tryWrapperForImpl(indexedValue)
|
| 286 |
+
};
|
| 287 |
+
}
|
| 288 |
+
ignoreNamedProps = true;
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
return Reflect.getOwnPropertyDescriptor(target, P);
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
set(target, P, V, receiver) {
|
| 295 |
+
if (typeof P === "symbol") {
|
| 296 |
+
return Reflect.set(target, P, V, receiver);
|
| 297 |
+
}
|
| 298 |
+
// The `receiver` argument refers to the Proxy exotic object or an object
|
| 299 |
+
// that inherits from it, whereas `target` refers to the Proxy target:
|
| 300 |
+
if (target[implSymbol][utils.wrapperSymbol] === receiver) {
|
| 301 |
+
const globalObject = this._globalObject;
|
| 302 |
+
}
|
| 303 |
+
let ownDesc;
|
| 304 |
+
|
| 305 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 306 |
+
const index = P >>> 0;
|
| 307 |
+
|
| 308 |
+
if (target[implSymbol][utils.supportsPropertyIndex](index)) {
|
| 309 |
+
const indexedValue = target[implSymbol].item(index);
|
| 310 |
+
ownDesc = {
|
| 311 |
+
writable: false,
|
| 312 |
+
enumerable: true,
|
| 313 |
+
configurable: true,
|
| 314 |
+
value: utils.tryWrapperForImpl(indexedValue)
|
| 315 |
+
};
|
| 316 |
+
}
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
if (ownDesc === undefined) {
|
| 320 |
+
ownDesc = Reflect.getOwnPropertyDescriptor(target, P);
|
| 321 |
+
}
|
| 322 |
+
return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc);
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
defineProperty(target, P, desc) {
|
| 326 |
+
if (typeof P === "symbol") {
|
| 327 |
+
return Reflect.defineProperty(target, P, desc);
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
const globalObject = this._globalObject;
|
| 331 |
+
|
| 332 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 333 |
+
return false;
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
return Reflect.defineProperty(target, P, desc);
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
deleteProperty(target, P) {
|
| 340 |
+
if (typeof P === "symbol") {
|
| 341 |
+
return Reflect.deleteProperty(target, P);
|
| 342 |
+
}
|
| 343 |
+
|
| 344 |
+
const globalObject = this._globalObject;
|
| 345 |
+
|
| 346 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 347 |
+
const index = P >>> 0;
|
| 348 |
+
return !target[implSymbol][utils.supportsPropertyIndex](index);
|
| 349 |
+
}
|
| 350 |
+
|
| 351 |
+
return Reflect.deleteProperty(target, P);
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
preventExtensions() {
|
| 355 |
+
return false;
|
| 356 |
+
}
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
const Impl = require("../navigator/Plugin-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/PluginArray.js
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "PluginArray";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'PluginArray'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["PluginArray"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
function makeProxy(wrapper, globalObject) {
|
| 38 |
+
let proxyHandler = proxyHandlerCache.get(globalObject);
|
| 39 |
+
if (proxyHandler === undefined) {
|
| 40 |
+
proxyHandler = new ProxyHandler(globalObject);
|
| 41 |
+
proxyHandlerCache.set(globalObject, proxyHandler);
|
| 42 |
+
}
|
| 43 |
+
return new Proxy(wrapper, proxyHandler);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 47 |
+
const wrapper = makeWrapper(globalObject);
|
| 48 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 52 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 53 |
+
return utils.implForWrapper(wrapper);
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 57 |
+
|
| 58 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 59 |
+
privateData.wrapper = wrapper;
|
| 60 |
+
|
| 61 |
+
exports._internalSetup(wrapper, globalObject);
|
| 62 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 63 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 64 |
+
configurable: true
|
| 65 |
+
});
|
| 66 |
+
|
| 67 |
+
wrapper = makeProxy(wrapper, globalObject);
|
| 68 |
+
|
| 69 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 70 |
+
if (Impl.init) {
|
| 71 |
+
Impl.init(wrapper[implSymbol]);
|
| 72 |
+
}
|
| 73 |
+
return wrapper;
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
exports.new = (globalObject, newTarget) => {
|
| 77 |
+
let wrapper = makeWrapper(globalObject, newTarget);
|
| 78 |
+
|
| 79 |
+
exports._internalSetup(wrapper, globalObject);
|
| 80 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 81 |
+
value: Object.create(Impl.implementation.prototype),
|
| 82 |
+
configurable: true
|
| 83 |
+
});
|
| 84 |
+
|
| 85 |
+
wrapper = makeProxy(wrapper, globalObject);
|
| 86 |
+
|
| 87 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 88 |
+
if (Impl.init) {
|
| 89 |
+
Impl.init(wrapper[implSymbol]);
|
| 90 |
+
}
|
| 91 |
+
return wrapper[implSymbol];
|
| 92 |
+
};
|
| 93 |
+
|
| 94 |
+
const exposed = new Set(["Window"]);
|
| 95 |
+
|
| 96 |
+
exports.install = (globalObject, globalNames) => {
|
| 97 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 98 |
+
return;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 102 |
+
class PluginArray {
|
| 103 |
+
constructor() {
|
| 104 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
refresh() {
|
| 108 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 109 |
+
if (!exports.is(esValue)) {
|
| 110 |
+
throw new globalObject.TypeError("'refresh' called on an object that is not a valid instance of PluginArray.");
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
return esValue[implSymbol].refresh();
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
item(index) {
|
| 117 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 118 |
+
if (!exports.is(esValue)) {
|
| 119 |
+
throw new globalObject.TypeError("'item' called on an object that is not a valid instance of PluginArray.");
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
if (arguments.length < 1) {
|
| 123 |
+
throw new globalObject.TypeError(
|
| 124 |
+
`Failed to execute 'item' on 'PluginArray': 1 argument required, but only ${arguments.length} present.`
|
| 125 |
+
);
|
| 126 |
+
}
|
| 127 |
+
const args = [];
|
| 128 |
+
{
|
| 129 |
+
let curArg = arguments[0];
|
| 130 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 131 |
+
context: "Failed to execute 'item' on 'PluginArray': parameter 1",
|
| 132 |
+
globals: globalObject
|
| 133 |
+
});
|
| 134 |
+
args.push(curArg);
|
| 135 |
+
}
|
| 136 |
+
return esValue[implSymbol].item(...args);
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
namedItem(name) {
|
| 140 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 141 |
+
if (!exports.is(esValue)) {
|
| 142 |
+
throw new globalObject.TypeError(
|
| 143 |
+
"'namedItem' called on an object that is not a valid instance of PluginArray."
|
| 144 |
+
);
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
if (arguments.length < 1) {
|
| 148 |
+
throw new globalObject.TypeError(
|
| 149 |
+
`Failed to execute 'namedItem' on 'PluginArray': 1 argument required, but only ${arguments.length} present.`
|
| 150 |
+
);
|
| 151 |
+
}
|
| 152 |
+
const args = [];
|
| 153 |
+
{
|
| 154 |
+
let curArg = arguments[0];
|
| 155 |
+
curArg = conversions["DOMString"](curArg, {
|
| 156 |
+
context: "Failed to execute 'namedItem' on 'PluginArray': parameter 1",
|
| 157 |
+
globals: globalObject
|
| 158 |
+
});
|
| 159 |
+
args.push(curArg);
|
| 160 |
+
}
|
| 161 |
+
return esValue[implSymbol].namedItem(...args);
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
get length() {
|
| 165 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 166 |
+
|
| 167 |
+
if (!exports.is(esValue)) {
|
| 168 |
+
throw new globalObject.TypeError(
|
| 169 |
+
"'get length' called on an object that is not a valid instance of PluginArray."
|
| 170 |
+
);
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
return esValue[implSymbol]["length"];
|
| 174 |
+
}
|
| 175 |
+
}
|
| 176 |
+
Object.defineProperties(PluginArray.prototype, {
|
| 177 |
+
refresh: { enumerable: true },
|
| 178 |
+
item: { enumerable: true },
|
| 179 |
+
namedItem: { enumerable: true },
|
| 180 |
+
length: { enumerable: true },
|
| 181 |
+
[Symbol.toStringTag]: { value: "PluginArray", configurable: true },
|
| 182 |
+
[Symbol.iterator]: { value: globalObject.Array.prototype[Symbol.iterator], configurable: true, writable: true }
|
| 183 |
+
});
|
| 184 |
+
ctorRegistry[interfaceName] = PluginArray;
|
| 185 |
+
|
| 186 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 187 |
+
configurable: true,
|
| 188 |
+
writable: true,
|
| 189 |
+
value: PluginArray
|
| 190 |
+
});
|
| 191 |
+
};
|
| 192 |
+
|
| 193 |
+
const proxyHandlerCache = new WeakMap();
|
| 194 |
+
class ProxyHandler {
|
| 195 |
+
constructor(globalObject) {
|
| 196 |
+
this._globalObject = globalObject;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
get(target, P, receiver) {
|
| 200 |
+
if (typeof P === "symbol") {
|
| 201 |
+
return Reflect.get(target, P, receiver);
|
| 202 |
+
}
|
| 203 |
+
const desc = this.getOwnPropertyDescriptor(target, P);
|
| 204 |
+
if (desc === undefined) {
|
| 205 |
+
const parent = Object.getPrototypeOf(target);
|
| 206 |
+
if (parent === null) {
|
| 207 |
+
return undefined;
|
| 208 |
+
}
|
| 209 |
+
return Reflect.get(target, P, receiver);
|
| 210 |
+
}
|
| 211 |
+
if (!desc.get && !desc.set) {
|
| 212 |
+
return desc.value;
|
| 213 |
+
}
|
| 214 |
+
const getter = desc.get;
|
| 215 |
+
if (getter === undefined) {
|
| 216 |
+
return undefined;
|
| 217 |
+
}
|
| 218 |
+
return Reflect.apply(getter, receiver, []);
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
has(target, P) {
|
| 222 |
+
if (typeof P === "symbol") {
|
| 223 |
+
return Reflect.has(target, P);
|
| 224 |
+
}
|
| 225 |
+
const desc = this.getOwnPropertyDescriptor(target, P);
|
| 226 |
+
if (desc !== undefined) {
|
| 227 |
+
return true;
|
| 228 |
+
}
|
| 229 |
+
const parent = Object.getPrototypeOf(target);
|
| 230 |
+
if (parent !== null) {
|
| 231 |
+
return Reflect.has(parent, P);
|
| 232 |
+
}
|
| 233 |
+
return false;
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
ownKeys(target) {
|
| 237 |
+
const keys = new Set();
|
| 238 |
+
|
| 239 |
+
for (const key of target[implSymbol][utils.supportedPropertyIndices]) {
|
| 240 |
+
keys.add(`${key}`);
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
for (const key of Reflect.ownKeys(target)) {
|
| 244 |
+
keys.add(key);
|
| 245 |
+
}
|
| 246 |
+
return [...keys];
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
getOwnPropertyDescriptor(target, P) {
|
| 250 |
+
if (typeof P === "symbol") {
|
| 251 |
+
return Reflect.getOwnPropertyDescriptor(target, P);
|
| 252 |
+
}
|
| 253 |
+
let ignoreNamedProps = false;
|
| 254 |
+
|
| 255 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 256 |
+
const index = P >>> 0;
|
| 257 |
+
const indexedValue = target[implSymbol].item(index);
|
| 258 |
+
if (indexedValue !== null) {
|
| 259 |
+
return {
|
| 260 |
+
writable: false,
|
| 261 |
+
enumerable: true,
|
| 262 |
+
configurable: true,
|
| 263 |
+
value: utils.tryWrapperForImpl(indexedValue)
|
| 264 |
+
};
|
| 265 |
+
}
|
| 266 |
+
ignoreNamedProps = true;
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
return Reflect.getOwnPropertyDescriptor(target, P);
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
set(target, P, V, receiver) {
|
| 273 |
+
if (typeof P === "symbol") {
|
| 274 |
+
return Reflect.set(target, P, V, receiver);
|
| 275 |
+
}
|
| 276 |
+
// The `receiver` argument refers to the Proxy exotic object or an object
|
| 277 |
+
// that inherits from it, whereas `target` refers to the Proxy target:
|
| 278 |
+
if (target[implSymbol][utils.wrapperSymbol] === receiver) {
|
| 279 |
+
const globalObject = this._globalObject;
|
| 280 |
+
}
|
| 281 |
+
let ownDesc;
|
| 282 |
+
|
| 283 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 284 |
+
const index = P >>> 0;
|
| 285 |
+
const indexedValue = target[implSymbol].item(index);
|
| 286 |
+
if (indexedValue !== null) {
|
| 287 |
+
ownDesc = {
|
| 288 |
+
writable: false,
|
| 289 |
+
enumerable: true,
|
| 290 |
+
configurable: true,
|
| 291 |
+
value: utils.tryWrapperForImpl(indexedValue)
|
| 292 |
+
};
|
| 293 |
+
}
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
if (ownDesc === undefined) {
|
| 297 |
+
ownDesc = Reflect.getOwnPropertyDescriptor(target, P);
|
| 298 |
+
}
|
| 299 |
+
return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc);
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
defineProperty(target, P, desc) {
|
| 303 |
+
if (typeof P === "symbol") {
|
| 304 |
+
return Reflect.defineProperty(target, P, desc);
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
const globalObject = this._globalObject;
|
| 308 |
+
|
| 309 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 310 |
+
return false;
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
return Reflect.defineProperty(target, P, desc);
|
| 314 |
+
}
|
| 315 |
+
|
| 316 |
+
deleteProperty(target, P) {
|
| 317 |
+
if (typeof P === "symbol") {
|
| 318 |
+
return Reflect.deleteProperty(target, P);
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
const globalObject = this._globalObject;
|
| 322 |
+
|
| 323 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 324 |
+
const index = P >>> 0;
|
| 325 |
+
return !(target[implSymbol].item(index) !== null);
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
return Reflect.deleteProperty(target, P);
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
preventExtensions() {
|
| 332 |
+
return false;
|
| 333 |
+
}
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
const Impl = require("../navigator/PluginArray-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/PointerEvent.js
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const PointerEventInit = require("./PointerEventInit.js");
|
| 7 |
+
const implSymbol = utils.implSymbol;
|
| 8 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 9 |
+
const MouseEvent = require("./MouseEvent.js");
|
| 10 |
+
|
| 11 |
+
const interfaceName = "PointerEvent";
|
| 12 |
+
|
| 13 |
+
exports.is = value => {
|
| 14 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 15 |
+
};
|
| 16 |
+
exports.isImpl = value => {
|
| 17 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 18 |
+
};
|
| 19 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 20 |
+
if (exports.is(value)) {
|
| 21 |
+
return utils.implForWrapper(value);
|
| 22 |
+
}
|
| 23 |
+
throw new globalObject.TypeError(`${context} is not of type 'PointerEvent'.`);
|
| 24 |
+
};
|
| 25 |
+
|
| 26 |
+
function makeWrapper(globalObject, newTarget) {
|
| 27 |
+
let proto;
|
| 28 |
+
if (newTarget !== undefined) {
|
| 29 |
+
proto = newTarget.prototype;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
if (!utils.isObject(proto)) {
|
| 33 |
+
proto = globalObject[ctorRegistrySymbol]["PointerEvent"].prototype;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return Object.create(proto);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 40 |
+
const wrapper = makeWrapper(globalObject);
|
| 41 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 45 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 46 |
+
return utils.implForWrapper(wrapper);
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 50 |
+
MouseEvent._internalSetup(wrapper, globalObject);
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 54 |
+
privateData.wrapper = wrapper;
|
| 55 |
+
|
| 56 |
+
exports._internalSetup(wrapper, globalObject);
|
| 57 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 58 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 59 |
+
configurable: true
|
| 60 |
+
});
|
| 61 |
+
|
| 62 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 63 |
+
if (Impl.init) {
|
| 64 |
+
Impl.init(wrapper[implSymbol]);
|
| 65 |
+
}
|
| 66 |
+
return wrapper;
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
exports.new = (globalObject, newTarget) => {
|
| 70 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 71 |
+
|
| 72 |
+
exports._internalSetup(wrapper, globalObject);
|
| 73 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 74 |
+
value: Object.create(Impl.implementation.prototype),
|
| 75 |
+
configurable: true
|
| 76 |
+
});
|
| 77 |
+
|
| 78 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 79 |
+
if (Impl.init) {
|
| 80 |
+
Impl.init(wrapper[implSymbol]);
|
| 81 |
+
}
|
| 82 |
+
return wrapper[implSymbol];
|
| 83 |
+
};
|
| 84 |
+
|
| 85 |
+
const exposed = new Set(["Window"]);
|
| 86 |
+
|
| 87 |
+
exports.install = (globalObject, globalNames) => {
|
| 88 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 89 |
+
return;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 93 |
+
class PointerEvent extends globalObject.MouseEvent {
|
| 94 |
+
constructor(type) {
|
| 95 |
+
if (arguments.length < 1) {
|
| 96 |
+
throw new globalObject.TypeError(
|
| 97 |
+
`Failed to construct 'PointerEvent': 1 argument required, but only ${arguments.length} present.`
|
| 98 |
+
);
|
| 99 |
+
}
|
| 100 |
+
const args = [];
|
| 101 |
+
{
|
| 102 |
+
let curArg = arguments[0];
|
| 103 |
+
curArg = conversions["DOMString"](curArg, {
|
| 104 |
+
context: "Failed to construct 'PointerEvent': parameter 1",
|
| 105 |
+
globals: globalObject
|
| 106 |
+
});
|
| 107 |
+
args.push(curArg);
|
| 108 |
+
}
|
| 109 |
+
{
|
| 110 |
+
let curArg = arguments[1];
|
| 111 |
+
curArg = PointerEventInit.convert(globalObject, curArg, {
|
| 112 |
+
context: "Failed to construct 'PointerEvent': parameter 2"
|
| 113 |
+
});
|
| 114 |
+
args.push(curArg);
|
| 115 |
+
}
|
| 116 |
+
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
getCoalescedEvents() {
|
| 120 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 121 |
+
if (!exports.is(esValue)) {
|
| 122 |
+
throw new globalObject.TypeError(
|
| 123 |
+
"'getCoalescedEvents' called on an object that is not a valid instance of PointerEvent."
|
| 124 |
+
);
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].getCoalescedEvents());
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
getPredictedEvents() {
|
| 131 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 132 |
+
if (!exports.is(esValue)) {
|
| 133 |
+
throw new globalObject.TypeError(
|
| 134 |
+
"'getPredictedEvents' called on an object that is not a valid instance of PointerEvent."
|
| 135 |
+
);
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].getPredictedEvents());
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
get pointerId() {
|
| 142 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 143 |
+
|
| 144 |
+
if (!exports.is(esValue)) {
|
| 145 |
+
throw new globalObject.TypeError(
|
| 146 |
+
"'get pointerId' called on an object that is not a valid instance of PointerEvent."
|
| 147 |
+
);
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
return esValue[implSymbol]["pointerId"];
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
get width() {
|
| 154 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 155 |
+
|
| 156 |
+
if (!exports.is(esValue)) {
|
| 157 |
+
throw new globalObject.TypeError(
|
| 158 |
+
"'get width' called on an object that is not a valid instance of PointerEvent."
|
| 159 |
+
);
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
return esValue[implSymbol]["width"];
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
get height() {
|
| 166 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 167 |
+
|
| 168 |
+
if (!exports.is(esValue)) {
|
| 169 |
+
throw new globalObject.TypeError(
|
| 170 |
+
"'get height' called on an object that is not a valid instance of PointerEvent."
|
| 171 |
+
);
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
return esValue[implSymbol]["height"];
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
get pressure() {
|
| 178 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 179 |
+
|
| 180 |
+
if (!exports.is(esValue)) {
|
| 181 |
+
throw new globalObject.TypeError(
|
| 182 |
+
"'get pressure' called on an object that is not a valid instance of PointerEvent."
|
| 183 |
+
);
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
return esValue[implSymbol]["pressure"];
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
get tangentialPressure() {
|
| 190 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 191 |
+
|
| 192 |
+
if (!exports.is(esValue)) {
|
| 193 |
+
throw new globalObject.TypeError(
|
| 194 |
+
"'get tangentialPressure' called on an object that is not a valid instance of PointerEvent."
|
| 195 |
+
);
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
return esValue[implSymbol]["tangentialPressure"];
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
get tiltX() {
|
| 202 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 203 |
+
|
| 204 |
+
if (!exports.is(esValue)) {
|
| 205 |
+
throw new globalObject.TypeError(
|
| 206 |
+
"'get tiltX' called on an object that is not a valid instance of PointerEvent."
|
| 207 |
+
);
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
return esValue[implSymbol]["tiltX"];
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
get tiltY() {
|
| 214 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 215 |
+
|
| 216 |
+
if (!exports.is(esValue)) {
|
| 217 |
+
throw new globalObject.TypeError(
|
| 218 |
+
"'get tiltY' called on an object that is not a valid instance of PointerEvent."
|
| 219 |
+
);
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
return esValue[implSymbol]["tiltY"];
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
get twist() {
|
| 226 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 227 |
+
|
| 228 |
+
if (!exports.is(esValue)) {
|
| 229 |
+
throw new globalObject.TypeError(
|
| 230 |
+
"'get twist' called on an object that is not a valid instance of PointerEvent."
|
| 231 |
+
);
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
return esValue[implSymbol]["twist"];
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
get altitudeAngle() {
|
| 238 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 239 |
+
|
| 240 |
+
if (!exports.is(esValue)) {
|
| 241 |
+
throw new globalObject.TypeError(
|
| 242 |
+
"'get altitudeAngle' called on an object that is not a valid instance of PointerEvent."
|
| 243 |
+
);
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
return esValue[implSymbol]["altitudeAngle"];
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
get azimuthAngle() {
|
| 250 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 251 |
+
|
| 252 |
+
if (!exports.is(esValue)) {
|
| 253 |
+
throw new globalObject.TypeError(
|
| 254 |
+
"'get azimuthAngle' called on an object that is not a valid instance of PointerEvent."
|
| 255 |
+
);
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
return esValue[implSymbol]["azimuthAngle"];
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
get pointerType() {
|
| 262 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 263 |
+
|
| 264 |
+
if (!exports.is(esValue)) {
|
| 265 |
+
throw new globalObject.TypeError(
|
| 266 |
+
"'get pointerType' called on an object that is not a valid instance of PointerEvent."
|
| 267 |
+
);
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
return esValue[implSymbol]["pointerType"];
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
get isPrimary() {
|
| 274 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 275 |
+
|
| 276 |
+
if (!exports.is(esValue)) {
|
| 277 |
+
throw new globalObject.TypeError(
|
| 278 |
+
"'get isPrimary' called on an object that is not a valid instance of PointerEvent."
|
| 279 |
+
);
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
return esValue[implSymbol]["isPrimary"];
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
get persistentDeviceId() {
|
| 286 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 287 |
+
|
| 288 |
+
if (!exports.is(esValue)) {
|
| 289 |
+
throw new globalObject.TypeError(
|
| 290 |
+
"'get persistentDeviceId' called on an object that is not a valid instance of PointerEvent."
|
| 291 |
+
);
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
return esValue[implSymbol]["persistentDeviceId"];
|
| 295 |
+
}
|
| 296 |
+
}
|
| 297 |
+
Object.defineProperties(PointerEvent.prototype, {
|
| 298 |
+
getCoalescedEvents: { enumerable: true },
|
| 299 |
+
getPredictedEvents: { enumerable: true },
|
| 300 |
+
pointerId: { enumerable: true },
|
| 301 |
+
width: { enumerable: true },
|
| 302 |
+
height: { enumerable: true },
|
| 303 |
+
pressure: { enumerable: true },
|
| 304 |
+
tangentialPressure: { enumerable: true },
|
| 305 |
+
tiltX: { enumerable: true },
|
| 306 |
+
tiltY: { enumerable: true },
|
| 307 |
+
twist: { enumerable: true },
|
| 308 |
+
altitudeAngle: { enumerable: true },
|
| 309 |
+
azimuthAngle: { enumerable: true },
|
| 310 |
+
pointerType: { enumerable: true },
|
| 311 |
+
isPrimary: { enumerable: true },
|
| 312 |
+
persistentDeviceId: { enumerable: true },
|
| 313 |
+
[Symbol.toStringTag]: { value: "PointerEvent", configurable: true }
|
| 314 |
+
});
|
| 315 |
+
ctorRegistry[interfaceName] = PointerEvent;
|
| 316 |
+
|
| 317 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 318 |
+
configurable: true,
|
| 319 |
+
writable: true,
|
| 320 |
+
value: PointerEvent
|
| 321 |
+
});
|
| 322 |
+
};
|
| 323 |
+
|
| 324 |
+
const Impl = require("../events/PointerEvent-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/PointerEventInit.js
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const PointerEvent = require("./PointerEvent.js");
|
| 7 |
+
const MouseEventInit = require("./MouseEventInit.js");
|
| 8 |
+
|
| 9 |
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
| 10 |
+
MouseEventInit._convertInherit(globalObject, obj, ret, { context });
|
| 11 |
+
|
| 12 |
+
{
|
| 13 |
+
const key = "altitudeAngle";
|
| 14 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 15 |
+
if (value !== undefined) {
|
| 16 |
+
value = conversions["double"](value, {
|
| 17 |
+
context: context + " has member 'altitudeAngle' that",
|
| 18 |
+
globals: globalObject
|
| 19 |
+
});
|
| 20 |
+
|
| 21 |
+
ret[key] = value;
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
{
|
| 26 |
+
const key = "azimuthAngle";
|
| 27 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 28 |
+
if (value !== undefined) {
|
| 29 |
+
value = conversions["double"](value, {
|
| 30 |
+
context: context + " has member 'azimuthAngle' that",
|
| 31 |
+
globals: globalObject
|
| 32 |
+
});
|
| 33 |
+
|
| 34 |
+
ret[key] = value;
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
{
|
| 39 |
+
const key = "coalescedEvents";
|
| 40 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 41 |
+
if (value !== undefined) {
|
| 42 |
+
if (!utils.isObject(value)) {
|
| 43 |
+
throw new globalObject.TypeError(
|
| 44 |
+
context + " has member 'coalescedEvents' that" + " is not an iterable object."
|
| 45 |
+
);
|
| 46 |
+
} else {
|
| 47 |
+
const V = [];
|
| 48 |
+
const tmp = value;
|
| 49 |
+
for (let nextItem of tmp) {
|
| 50 |
+
nextItem = PointerEvent.convert(globalObject, nextItem, {
|
| 51 |
+
context: context + " has member 'coalescedEvents' that" + "'s element"
|
| 52 |
+
});
|
| 53 |
+
|
| 54 |
+
V.push(nextItem);
|
| 55 |
+
}
|
| 56 |
+
value = V;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
ret[key] = value;
|
| 60 |
+
} else {
|
| 61 |
+
ret[key] = [];
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
{
|
| 66 |
+
const key = "height";
|
| 67 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 68 |
+
if (value !== undefined) {
|
| 69 |
+
value = conversions["double"](value, { context: context + " has member 'height' that", globals: globalObject });
|
| 70 |
+
|
| 71 |
+
ret[key] = value;
|
| 72 |
+
} else {
|
| 73 |
+
ret[key] = 1;
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
{
|
| 78 |
+
const key = "isPrimary";
|
| 79 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 80 |
+
if (value !== undefined) {
|
| 81 |
+
value = conversions["boolean"](value, {
|
| 82 |
+
context: context + " has member 'isPrimary' that",
|
| 83 |
+
globals: globalObject
|
| 84 |
+
});
|
| 85 |
+
|
| 86 |
+
ret[key] = value;
|
| 87 |
+
} else {
|
| 88 |
+
ret[key] = false;
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
{
|
| 93 |
+
const key = "persistentDeviceId";
|
| 94 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 95 |
+
if (value !== undefined) {
|
| 96 |
+
value = conversions["long"](value, {
|
| 97 |
+
context: context + " has member 'persistentDeviceId' that",
|
| 98 |
+
globals: globalObject
|
| 99 |
+
});
|
| 100 |
+
|
| 101 |
+
ret[key] = value;
|
| 102 |
+
} else {
|
| 103 |
+
ret[key] = 0;
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
{
|
| 108 |
+
const key = "pointerId";
|
| 109 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 110 |
+
if (value !== undefined) {
|
| 111 |
+
value = conversions["long"](value, { context: context + " has member 'pointerId' that", globals: globalObject });
|
| 112 |
+
|
| 113 |
+
ret[key] = value;
|
| 114 |
+
} else {
|
| 115 |
+
ret[key] = 0;
|
| 116 |
+
}
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
{
|
| 120 |
+
const key = "pointerType";
|
| 121 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 122 |
+
if (value !== undefined) {
|
| 123 |
+
value = conversions["DOMString"](value, {
|
| 124 |
+
context: context + " has member 'pointerType' that",
|
| 125 |
+
globals: globalObject
|
| 126 |
+
});
|
| 127 |
+
|
| 128 |
+
ret[key] = value;
|
| 129 |
+
} else {
|
| 130 |
+
ret[key] = "";
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
{
|
| 135 |
+
const key = "predictedEvents";
|
| 136 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 137 |
+
if (value !== undefined) {
|
| 138 |
+
if (!utils.isObject(value)) {
|
| 139 |
+
throw new globalObject.TypeError(
|
| 140 |
+
context + " has member 'predictedEvents' that" + " is not an iterable object."
|
| 141 |
+
);
|
| 142 |
+
} else {
|
| 143 |
+
const V = [];
|
| 144 |
+
const tmp = value;
|
| 145 |
+
for (let nextItem of tmp) {
|
| 146 |
+
nextItem = PointerEvent.convert(globalObject, nextItem, {
|
| 147 |
+
context: context + " has member 'predictedEvents' that" + "'s element"
|
| 148 |
+
});
|
| 149 |
+
|
| 150 |
+
V.push(nextItem);
|
| 151 |
+
}
|
| 152 |
+
value = V;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
ret[key] = value;
|
| 156 |
+
} else {
|
| 157 |
+
ret[key] = [];
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
{
|
| 162 |
+
const key = "pressure";
|
| 163 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 164 |
+
if (value !== undefined) {
|
| 165 |
+
value = conversions["float"](value, { context: context + " has member 'pressure' that", globals: globalObject });
|
| 166 |
+
|
| 167 |
+
ret[key] = value;
|
| 168 |
+
} else {
|
| 169 |
+
ret[key] = 0;
|
| 170 |
+
}
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
{
|
| 174 |
+
const key = "tangentialPressure";
|
| 175 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 176 |
+
if (value !== undefined) {
|
| 177 |
+
value = conversions["float"](value, {
|
| 178 |
+
context: context + " has member 'tangentialPressure' that",
|
| 179 |
+
globals: globalObject
|
| 180 |
+
});
|
| 181 |
+
|
| 182 |
+
ret[key] = value;
|
| 183 |
+
} else {
|
| 184 |
+
ret[key] = 0;
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
{
|
| 189 |
+
const key = "tiltX";
|
| 190 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 191 |
+
if (value !== undefined) {
|
| 192 |
+
value = conversions["long"](value, { context: context + " has member 'tiltX' that", globals: globalObject });
|
| 193 |
+
|
| 194 |
+
ret[key] = value;
|
| 195 |
+
}
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
{
|
| 199 |
+
const key = "tiltY";
|
| 200 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 201 |
+
if (value !== undefined) {
|
| 202 |
+
value = conversions["long"](value, { context: context + " has member 'tiltY' that", globals: globalObject });
|
| 203 |
+
|
| 204 |
+
ret[key] = value;
|
| 205 |
+
}
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
{
|
| 209 |
+
const key = "twist";
|
| 210 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 211 |
+
if (value !== undefined) {
|
| 212 |
+
value = conversions["long"](value, { context: context + " has member 'twist' that", globals: globalObject });
|
| 213 |
+
|
| 214 |
+
ret[key] = value;
|
| 215 |
+
} else {
|
| 216 |
+
ret[key] = 0;
|
| 217 |
+
}
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
{
|
| 221 |
+
const key = "width";
|
| 222 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 223 |
+
if (value !== undefined) {
|
| 224 |
+
value = conversions["double"](value, { context: context + " has member 'width' that", globals: globalObject });
|
| 225 |
+
|
| 226 |
+
ret[key] = value;
|
| 227 |
+
} else {
|
| 228 |
+
ret[key] = 1;
|
| 229 |
+
}
|
| 230 |
+
}
|
| 231 |
+
};
|
| 232 |
+
|
| 233 |
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
| 234 |
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
| 235 |
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
const ret = Object.create(null);
|
| 239 |
+
exports._convertInherit(globalObject, obj, ret, { context });
|
| 240 |
+
return ret;
|
| 241 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/PopStateEvent.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const PopStateEventInit = require("./PopStateEventInit.js");
|
| 7 |
+
const implSymbol = utils.implSymbol;
|
| 8 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 9 |
+
const Event = require("./Event.js");
|
| 10 |
+
|
| 11 |
+
const interfaceName = "PopStateEvent";
|
| 12 |
+
|
| 13 |
+
exports.is = value => {
|
| 14 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 15 |
+
};
|
| 16 |
+
exports.isImpl = value => {
|
| 17 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 18 |
+
};
|
| 19 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 20 |
+
if (exports.is(value)) {
|
| 21 |
+
return utils.implForWrapper(value);
|
| 22 |
+
}
|
| 23 |
+
throw new globalObject.TypeError(`${context} is not of type 'PopStateEvent'.`);
|
| 24 |
+
};
|
| 25 |
+
|
| 26 |
+
function makeWrapper(globalObject, newTarget) {
|
| 27 |
+
let proto;
|
| 28 |
+
if (newTarget !== undefined) {
|
| 29 |
+
proto = newTarget.prototype;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
if (!utils.isObject(proto)) {
|
| 33 |
+
proto = globalObject[ctorRegistrySymbol]["PopStateEvent"].prototype;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return Object.create(proto);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 40 |
+
const wrapper = makeWrapper(globalObject);
|
| 41 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 45 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 46 |
+
return utils.implForWrapper(wrapper);
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 50 |
+
Event._internalSetup(wrapper, globalObject);
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 54 |
+
privateData.wrapper = wrapper;
|
| 55 |
+
|
| 56 |
+
exports._internalSetup(wrapper, globalObject);
|
| 57 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 58 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 59 |
+
configurable: true
|
| 60 |
+
});
|
| 61 |
+
|
| 62 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 63 |
+
if (Impl.init) {
|
| 64 |
+
Impl.init(wrapper[implSymbol]);
|
| 65 |
+
}
|
| 66 |
+
return wrapper;
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
exports.new = (globalObject, newTarget) => {
|
| 70 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 71 |
+
|
| 72 |
+
exports._internalSetup(wrapper, globalObject);
|
| 73 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 74 |
+
value: Object.create(Impl.implementation.prototype),
|
| 75 |
+
configurable: true
|
| 76 |
+
});
|
| 77 |
+
|
| 78 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 79 |
+
if (Impl.init) {
|
| 80 |
+
Impl.init(wrapper[implSymbol]);
|
| 81 |
+
}
|
| 82 |
+
return wrapper[implSymbol];
|
| 83 |
+
};
|
| 84 |
+
|
| 85 |
+
const exposed = new Set(["Window"]);
|
| 86 |
+
|
| 87 |
+
exports.install = (globalObject, globalNames) => {
|
| 88 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 89 |
+
return;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 93 |
+
class PopStateEvent extends globalObject.Event {
|
| 94 |
+
constructor(type) {
|
| 95 |
+
if (arguments.length < 1) {
|
| 96 |
+
throw new globalObject.TypeError(
|
| 97 |
+
`Failed to construct 'PopStateEvent': 1 argument required, but only ${arguments.length} present.`
|
| 98 |
+
);
|
| 99 |
+
}
|
| 100 |
+
const args = [];
|
| 101 |
+
{
|
| 102 |
+
let curArg = arguments[0];
|
| 103 |
+
curArg = conversions["DOMString"](curArg, {
|
| 104 |
+
context: "Failed to construct 'PopStateEvent': parameter 1",
|
| 105 |
+
globals: globalObject
|
| 106 |
+
});
|
| 107 |
+
args.push(curArg);
|
| 108 |
+
}
|
| 109 |
+
{
|
| 110 |
+
let curArg = arguments[1];
|
| 111 |
+
curArg = PopStateEventInit.convert(globalObject, curArg, {
|
| 112 |
+
context: "Failed to construct 'PopStateEvent': parameter 2"
|
| 113 |
+
});
|
| 114 |
+
args.push(curArg);
|
| 115 |
+
}
|
| 116 |
+
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
get state() {
|
| 120 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 121 |
+
|
| 122 |
+
if (!exports.is(esValue)) {
|
| 123 |
+
throw new globalObject.TypeError(
|
| 124 |
+
"'get state' called on an object that is not a valid instance of PopStateEvent."
|
| 125 |
+
);
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
return esValue[implSymbol]["state"];
|
| 129 |
+
}
|
| 130 |
+
}
|
| 131 |
+
Object.defineProperties(PopStateEvent.prototype, {
|
| 132 |
+
state: { enumerable: true },
|
| 133 |
+
[Symbol.toStringTag]: { value: "PopStateEvent", configurable: true }
|
| 134 |
+
});
|
| 135 |
+
ctorRegistry[interfaceName] = PopStateEvent;
|
| 136 |
+
|
| 137 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 138 |
+
configurable: true,
|
| 139 |
+
writable: true,
|
| 140 |
+
value: PopStateEvent
|
| 141 |
+
});
|
| 142 |
+
};
|
| 143 |
+
|
| 144 |
+
const Impl = require("../events/PopStateEvent-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/PopStateEventInit.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const EventInit = require("./EventInit.js");
|
| 7 |
+
|
| 8 |
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
| 9 |
+
EventInit._convertInherit(globalObject, obj, ret, { context });
|
| 10 |
+
|
| 11 |
+
{
|
| 12 |
+
const key = "state";
|
| 13 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 14 |
+
if (value !== undefined) {
|
| 15 |
+
value = conversions["any"](value, { context: context + " has member 'state' that", globals: globalObject });
|
| 16 |
+
|
| 17 |
+
ret[key] = value;
|
| 18 |
+
} else {
|
| 19 |
+
ret[key] = null;
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
| 25 |
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
| 26 |
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
const ret = Object.create(null);
|
| 30 |
+
exports._convertInherit(globalObject, obj, ret, { context });
|
| 31 |
+
return ret;
|
| 32 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/ProcessingInstruction.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
const CharacterData = require("./CharacterData.js");
|
| 9 |
+
|
| 10 |
+
const interfaceName = "ProcessingInstruction";
|
| 11 |
+
|
| 12 |
+
exports.is = value => {
|
| 13 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 14 |
+
};
|
| 15 |
+
exports.isImpl = value => {
|
| 16 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 19 |
+
if (exports.is(value)) {
|
| 20 |
+
return utils.implForWrapper(value);
|
| 21 |
+
}
|
| 22 |
+
throw new globalObject.TypeError(`${context} is not of type 'ProcessingInstruction'.`);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
function makeWrapper(globalObject, newTarget) {
|
| 26 |
+
let proto;
|
| 27 |
+
if (newTarget !== undefined) {
|
| 28 |
+
proto = newTarget.prototype;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!utils.isObject(proto)) {
|
| 32 |
+
proto = globalObject[ctorRegistrySymbol]["ProcessingInstruction"].prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
return Object.create(proto);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 39 |
+
const wrapper = makeWrapper(globalObject);
|
| 40 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 44 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 45 |
+
return utils.implForWrapper(wrapper);
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 49 |
+
CharacterData._internalSetup(wrapper, globalObject);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 53 |
+
privateData.wrapper = wrapper;
|
| 54 |
+
|
| 55 |
+
exports._internalSetup(wrapper, globalObject);
|
| 56 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 57 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 58 |
+
configurable: true
|
| 59 |
+
});
|
| 60 |
+
|
| 61 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 62 |
+
if (Impl.init) {
|
| 63 |
+
Impl.init(wrapper[implSymbol]);
|
| 64 |
+
}
|
| 65 |
+
return wrapper;
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports.new = (globalObject, newTarget) => {
|
| 69 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 70 |
+
|
| 71 |
+
exports._internalSetup(wrapper, globalObject);
|
| 72 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 73 |
+
value: Object.create(Impl.implementation.prototype),
|
| 74 |
+
configurable: true
|
| 75 |
+
});
|
| 76 |
+
|
| 77 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 78 |
+
if (Impl.init) {
|
| 79 |
+
Impl.init(wrapper[implSymbol]);
|
| 80 |
+
}
|
| 81 |
+
return wrapper[implSymbol];
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
const exposed = new Set(["Window"]);
|
| 85 |
+
|
| 86 |
+
exports.install = (globalObject, globalNames) => {
|
| 87 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 88 |
+
return;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 92 |
+
class ProcessingInstruction extends globalObject.CharacterData {
|
| 93 |
+
constructor() {
|
| 94 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
get target() {
|
| 98 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 99 |
+
|
| 100 |
+
if (!exports.is(esValue)) {
|
| 101 |
+
throw new globalObject.TypeError(
|
| 102 |
+
"'get target' called on an object that is not a valid instance of ProcessingInstruction."
|
| 103 |
+
);
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
return esValue[implSymbol]["target"];
|
| 107 |
+
}
|
| 108 |
+
}
|
| 109 |
+
Object.defineProperties(ProcessingInstruction.prototype, {
|
| 110 |
+
target: { enumerable: true },
|
| 111 |
+
[Symbol.toStringTag]: { value: "ProcessingInstruction", configurable: true }
|
| 112 |
+
});
|
| 113 |
+
ctorRegistry[interfaceName] = ProcessingInstruction;
|
| 114 |
+
|
| 115 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 116 |
+
configurable: true,
|
| 117 |
+
writable: true,
|
| 118 |
+
value: ProcessingInstruction
|
| 119 |
+
});
|
| 120 |
+
};
|
| 121 |
+
|
| 122 |
+
const Impl = require("../nodes/ProcessingInstruction-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/ProgressEvent.js
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const ProgressEventInit = require("./ProgressEventInit.js");
|
| 7 |
+
const implSymbol = utils.implSymbol;
|
| 8 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 9 |
+
const Event = require("./Event.js");
|
| 10 |
+
|
| 11 |
+
const interfaceName = "ProgressEvent";
|
| 12 |
+
|
| 13 |
+
exports.is = value => {
|
| 14 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 15 |
+
};
|
| 16 |
+
exports.isImpl = value => {
|
| 17 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 18 |
+
};
|
| 19 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 20 |
+
if (exports.is(value)) {
|
| 21 |
+
return utils.implForWrapper(value);
|
| 22 |
+
}
|
| 23 |
+
throw new globalObject.TypeError(`${context} is not of type 'ProgressEvent'.`);
|
| 24 |
+
};
|
| 25 |
+
|
| 26 |
+
function makeWrapper(globalObject, newTarget) {
|
| 27 |
+
let proto;
|
| 28 |
+
if (newTarget !== undefined) {
|
| 29 |
+
proto = newTarget.prototype;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
if (!utils.isObject(proto)) {
|
| 33 |
+
proto = globalObject[ctorRegistrySymbol]["ProgressEvent"].prototype;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return Object.create(proto);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 40 |
+
const wrapper = makeWrapper(globalObject);
|
| 41 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 45 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 46 |
+
return utils.implForWrapper(wrapper);
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 50 |
+
Event._internalSetup(wrapper, globalObject);
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 54 |
+
privateData.wrapper = wrapper;
|
| 55 |
+
|
| 56 |
+
exports._internalSetup(wrapper, globalObject);
|
| 57 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 58 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 59 |
+
configurable: true
|
| 60 |
+
});
|
| 61 |
+
|
| 62 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 63 |
+
if (Impl.init) {
|
| 64 |
+
Impl.init(wrapper[implSymbol]);
|
| 65 |
+
}
|
| 66 |
+
return wrapper;
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
exports.new = (globalObject, newTarget) => {
|
| 70 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 71 |
+
|
| 72 |
+
exports._internalSetup(wrapper, globalObject);
|
| 73 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 74 |
+
value: Object.create(Impl.implementation.prototype),
|
| 75 |
+
configurable: true
|
| 76 |
+
});
|
| 77 |
+
|
| 78 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 79 |
+
if (Impl.init) {
|
| 80 |
+
Impl.init(wrapper[implSymbol]);
|
| 81 |
+
}
|
| 82 |
+
return wrapper[implSymbol];
|
| 83 |
+
};
|
| 84 |
+
|
| 85 |
+
const exposed = new Set(["Window", "DedicatedWorker", "SharedWorker"]);
|
| 86 |
+
|
| 87 |
+
exports.install = (globalObject, globalNames) => {
|
| 88 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 89 |
+
return;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 93 |
+
class ProgressEvent extends globalObject.Event {
|
| 94 |
+
constructor(type) {
|
| 95 |
+
if (arguments.length < 1) {
|
| 96 |
+
throw new globalObject.TypeError(
|
| 97 |
+
`Failed to construct 'ProgressEvent': 1 argument required, but only ${arguments.length} present.`
|
| 98 |
+
);
|
| 99 |
+
}
|
| 100 |
+
const args = [];
|
| 101 |
+
{
|
| 102 |
+
let curArg = arguments[0];
|
| 103 |
+
curArg = conversions["DOMString"](curArg, {
|
| 104 |
+
context: "Failed to construct 'ProgressEvent': parameter 1",
|
| 105 |
+
globals: globalObject
|
| 106 |
+
});
|
| 107 |
+
args.push(curArg);
|
| 108 |
+
}
|
| 109 |
+
{
|
| 110 |
+
let curArg = arguments[1];
|
| 111 |
+
curArg = ProgressEventInit.convert(globalObject, curArg, {
|
| 112 |
+
context: "Failed to construct 'ProgressEvent': parameter 2"
|
| 113 |
+
});
|
| 114 |
+
args.push(curArg);
|
| 115 |
+
}
|
| 116 |
+
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
get lengthComputable() {
|
| 120 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 121 |
+
|
| 122 |
+
if (!exports.is(esValue)) {
|
| 123 |
+
throw new globalObject.TypeError(
|
| 124 |
+
"'get lengthComputable' called on an object that is not a valid instance of ProgressEvent."
|
| 125 |
+
);
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
return esValue[implSymbol]["lengthComputable"];
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
get loaded() {
|
| 132 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 133 |
+
|
| 134 |
+
if (!exports.is(esValue)) {
|
| 135 |
+
throw new globalObject.TypeError(
|
| 136 |
+
"'get loaded' called on an object that is not a valid instance of ProgressEvent."
|
| 137 |
+
);
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
return esValue[implSymbol]["loaded"];
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
get total() {
|
| 144 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 145 |
+
|
| 146 |
+
if (!exports.is(esValue)) {
|
| 147 |
+
throw new globalObject.TypeError(
|
| 148 |
+
"'get total' called on an object that is not a valid instance of ProgressEvent."
|
| 149 |
+
);
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
return esValue[implSymbol]["total"];
|
| 153 |
+
}
|
| 154 |
+
}
|
| 155 |
+
Object.defineProperties(ProgressEvent.prototype, {
|
| 156 |
+
lengthComputable: { enumerable: true },
|
| 157 |
+
loaded: { enumerable: true },
|
| 158 |
+
total: { enumerable: true },
|
| 159 |
+
[Symbol.toStringTag]: { value: "ProgressEvent", configurable: true }
|
| 160 |
+
});
|
| 161 |
+
ctorRegistry[interfaceName] = ProgressEvent;
|
| 162 |
+
|
| 163 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 164 |
+
configurable: true,
|
| 165 |
+
writable: true,
|
| 166 |
+
value: ProgressEvent
|
| 167 |
+
});
|
| 168 |
+
};
|
| 169 |
+
|
| 170 |
+
const Impl = require("../events/ProgressEvent-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/ProgressEventInit.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const EventInit = require("./EventInit.js");
|
| 7 |
+
|
| 8 |
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
| 9 |
+
EventInit._convertInherit(globalObject, obj, ret, { context });
|
| 10 |
+
|
| 11 |
+
{
|
| 12 |
+
const key = "lengthComputable";
|
| 13 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 14 |
+
if (value !== undefined) {
|
| 15 |
+
value = conversions["boolean"](value, {
|
| 16 |
+
context: context + " has member 'lengthComputable' that",
|
| 17 |
+
globals: globalObject
|
| 18 |
+
});
|
| 19 |
+
|
| 20 |
+
ret[key] = value;
|
| 21 |
+
} else {
|
| 22 |
+
ret[key] = false;
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
{
|
| 27 |
+
const key = "loaded";
|
| 28 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 29 |
+
if (value !== undefined) {
|
| 30 |
+
value = conversions["unsigned long long"](value, {
|
| 31 |
+
context: context + " has member 'loaded' that",
|
| 32 |
+
globals: globalObject
|
| 33 |
+
});
|
| 34 |
+
|
| 35 |
+
ret[key] = value;
|
| 36 |
+
} else {
|
| 37 |
+
ret[key] = 0;
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
{
|
| 42 |
+
const key = "total";
|
| 43 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 44 |
+
if (value !== undefined) {
|
| 45 |
+
value = conversions["unsigned long long"](value, {
|
| 46 |
+
context: context + " has member 'total' that",
|
| 47 |
+
globals: globalObject
|
| 48 |
+
});
|
| 49 |
+
|
| 50 |
+
ret[key] = value;
|
| 51 |
+
} else {
|
| 52 |
+
ret[key] = 0;
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
};
|
| 56 |
+
|
| 57 |
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
| 58 |
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
| 59 |
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
const ret = Object.create(null);
|
| 63 |
+
exports._convertInherit(globalObject, obj, ret, { context });
|
| 64 |
+
return ret;
|
| 65 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/PromiseRejectionEvent.js
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const PromiseRejectionEventInit = require("./PromiseRejectionEventInit.js");
|
| 7 |
+
const implSymbol = utils.implSymbol;
|
| 8 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 9 |
+
const Event = require("./Event.js");
|
| 10 |
+
|
| 11 |
+
const interfaceName = "PromiseRejectionEvent";
|
| 12 |
+
|
| 13 |
+
exports.is = value => {
|
| 14 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 15 |
+
};
|
| 16 |
+
exports.isImpl = value => {
|
| 17 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 18 |
+
};
|
| 19 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 20 |
+
if (exports.is(value)) {
|
| 21 |
+
return utils.implForWrapper(value);
|
| 22 |
+
}
|
| 23 |
+
throw new globalObject.TypeError(`${context} is not of type 'PromiseRejectionEvent'.`);
|
| 24 |
+
};
|
| 25 |
+
|
| 26 |
+
function makeWrapper(globalObject, newTarget) {
|
| 27 |
+
let proto;
|
| 28 |
+
if (newTarget !== undefined) {
|
| 29 |
+
proto = newTarget.prototype;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
if (!utils.isObject(proto)) {
|
| 33 |
+
proto = globalObject[ctorRegistrySymbol]["PromiseRejectionEvent"].prototype;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return Object.create(proto);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 40 |
+
const wrapper = makeWrapper(globalObject);
|
| 41 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 45 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 46 |
+
return utils.implForWrapper(wrapper);
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 50 |
+
Event._internalSetup(wrapper, globalObject);
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 54 |
+
privateData.wrapper = wrapper;
|
| 55 |
+
|
| 56 |
+
exports._internalSetup(wrapper, globalObject);
|
| 57 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 58 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 59 |
+
configurable: true
|
| 60 |
+
});
|
| 61 |
+
|
| 62 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 63 |
+
if (Impl.init) {
|
| 64 |
+
Impl.init(wrapper[implSymbol]);
|
| 65 |
+
}
|
| 66 |
+
return wrapper;
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
exports.new = (globalObject, newTarget) => {
|
| 70 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 71 |
+
|
| 72 |
+
exports._internalSetup(wrapper, globalObject);
|
| 73 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 74 |
+
value: Object.create(Impl.implementation.prototype),
|
| 75 |
+
configurable: true
|
| 76 |
+
});
|
| 77 |
+
|
| 78 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 79 |
+
if (Impl.init) {
|
| 80 |
+
Impl.init(wrapper[implSymbol]);
|
| 81 |
+
}
|
| 82 |
+
return wrapper[implSymbol];
|
| 83 |
+
};
|
| 84 |
+
|
| 85 |
+
const exposed = new Set(["Window"]);
|
| 86 |
+
|
| 87 |
+
exports.install = (globalObject, globalNames) => {
|
| 88 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 89 |
+
return;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 93 |
+
class PromiseRejectionEvent extends globalObject.Event {
|
| 94 |
+
constructor(type, eventInitDict) {
|
| 95 |
+
if (arguments.length < 2) {
|
| 96 |
+
throw new globalObject.TypeError(
|
| 97 |
+
`Failed to construct 'PromiseRejectionEvent': 2 arguments required, but only ${arguments.length} present.`
|
| 98 |
+
);
|
| 99 |
+
}
|
| 100 |
+
const args = [];
|
| 101 |
+
{
|
| 102 |
+
let curArg = arguments[0];
|
| 103 |
+
curArg = conversions["DOMString"](curArg, {
|
| 104 |
+
context: "Failed to construct 'PromiseRejectionEvent': parameter 1",
|
| 105 |
+
globals: globalObject
|
| 106 |
+
});
|
| 107 |
+
args.push(curArg);
|
| 108 |
+
}
|
| 109 |
+
{
|
| 110 |
+
let curArg = arguments[1];
|
| 111 |
+
curArg = PromiseRejectionEventInit.convert(globalObject, curArg, {
|
| 112 |
+
context: "Failed to construct 'PromiseRejectionEvent': parameter 2"
|
| 113 |
+
});
|
| 114 |
+
args.push(curArg);
|
| 115 |
+
}
|
| 116 |
+
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
get promise() {
|
| 120 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 121 |
+
|
| 122 |
+
if (!exports.is(esValue)) {
|
| 123 |
+
throw new globalObject.TypeError(
|
| 124 |
+
"'get promise' called on an object that is not a valid instance of PromiseRejectionEvent."
|
| 125 |
+
);
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
return esValue[implSymbol]["promise"];
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
get reason() {
|
| 132 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 133 |
+
|
| 134 |
+
if (!exports.is(esValue)) {
|
| 135 |
+
throw new globalObject.TypeError(
|
| 136 |
+
"'get reason' called on an object that is not a valid instance of PromiseRejectionEvent."
|
| 137 |
+
);
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
return esValue[implSymbol]["reason"];
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
Object.defineProperties(PromiseRejectionEvent.prototype, {
|
| 144 |
+
promise: { enumerable: true },
|
| 145 |
+
reason: { enumerable: true },
|
| 146 |
+
[Symbol.toStringTag]: { value: "PromiseRejectionEvent", configurable: true }
|
| 147 |
+
});
|
| 148 |
+
ctorRegistry[interfaceName] = PromiseRejectionEvent;
|
| 149 |
+
|
| 150 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 151 |
+
configurable: true,
|
| 152 |
+
writable: true,
|
| 153 |
+
value: PromiseRejectionEvent
|
| 154 |
+
});
|
| 155 |
+
};
|
| 156 |
+
|
| 157 |
+
const Impl = require("../events/PromiseRejectionEvent-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/PromiseRejectionEventInit.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const EventInit = require("./EventInit.js");
|
| 7 |
+
|
| 8 |
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
| 9 |
+
EventInit._convertInherit(globalObject, obj, ret, { context });
|
| 10 |
+
|
| 11 |
+
{
|
| 12 |
+
const key = "promise";
|
| 13 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 14 |
+
if (value !== undefined) {
|
| 15 |
+
value = conversions["object"](value, { context: context + " has member 'promise' that", globals: globalObject });
|
| 16 |
+
|
| 17 |
+
ret[key] = value;
|
| 18 |
+
} else {
|
| 19 |
+
throw new globalObject.TypeError("promise is required in 'PromiseRejectionEventInit'");
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
{
|
| 24 |
+
const key = "reason";
|
| 25 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 26 |
+
if (value !== undefined) {
|
| 27 |
+
value = conversions["any"](value, { context: context + " has member 'reason' that", globals: globalObject });
|
| 28 |
+
|
| 29 |
+
ret[key] = value;
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
};
|
| 33 |
+
|
| 34 |
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
| 35 |
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
| 36 |
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
const ret = Object.create(null);
|
| 40 |
+
exports._convertInherit(globalObject, obj, ret, { context });
|
| 41 |
+
return ret;
|
| 42 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/RadioNodeList.js
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
const NodeList = require("./NodeList.js");
|
| 9 |
+
|
| 10 |
+
const interfaceName = "RadioNodeList";
|
| 11 |
+
|
| 12 |
+
exports.is = value => {
|
| 13 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 14 |
+
};
|
| 15 |
+
exports.isImpl = value => {
|
| 16 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 19 |
+
if (exports.is(value)) {
|
| 20 |
+
return utils.implForWrapper(value);
|
| 21 |
+
}
|
| 22 |
+
throw new globalObject.TypeError(`${context} is not of type 'RadioNodeList'.`);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
function makeWrapper(globalObject, newTarget) {
|
| 26 |
+
let proto;
|
| 27 |
+
if (newTarget !== undefined) {
|
| 28 |
+
proto = newTarget.prototype;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!utils.isObject(proto)) {
|
| 32 |
+
proto = globalObject[ctorRegistrySymbol]["RadioNodeList"].prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
return Object.create(proto);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
function makeProxy(wrapper, globalObject) {
|
| 39 |
+
let proxyHandler = proxyHandlerCache.get(globalObject);
|
| 40 |
+
if (proxyHandler === undefined) {
|
| 41 |
+
proxyHandler = new ProxyHandler(globalObject);
|
| 42 |
+
proxyHandlerCache.set(globalObject, proxyHandler);
|
| 43 |
+
}
|
| 44 |
+
return new Proxy(wrapper, proxyHandler);
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 48 |
+
const wrapper = makeWrapper(globalObject);
|
| 49 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 53 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 54 |
+
return utils.implForWrapper(wrapper);
|
| 55 |
+
};
|
| 56 |
+
|
| 57 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 58 |
+
NodeList._internalSetup(wrapper, globalObject);
|
| 59 |
+
};
|
| 60 |
+
|
| 61 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 62 |
+
privateData.wrapper = wrapper;
|
| 63 |
+
|
| 64 |
+
exports._internalSetup(wrapper, globalObject);
|
| 65 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 66 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 67 |
+
configurable: true
|
| 68 |
+
});
|
| 69 |
+
|
| 70 |
+
wrapper = makeProxy(wrapper, globalObject);
|
| 71 |
+
|
| 72 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 73 |
+
if (Impl.init) {
|
| 74 |
+
Impl.init(wrapper[implSymbol]);
|
| 75 |
+
}
|
| 76 |
+
return wrapper;
|
| 77 |
+
};
|
| 78 |
+
|
| 79 |
+
exports.new = (globalObject, newTarget) => {
|
| 80 |
+
let wrapper = makeWrapper(globalObject, newTarget);
|
| 81 |
+
|
| 82 |
+
exports._internalSetup(wrapper, globalObject);
|
| 83 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 84 |
+
value: Object.create(Impl.implementation.prototype),
|
| 85 |
+
configurable: true
|
| 86 |
+
});
|
| 87 |
+
|
| 88 |
+
wrapper = makeProxy(wrapper, globalObject);
|
| 89 |
+
|
| 90 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 91 |
+
if (Impl.init) {
|
| 92 |
+
Impl.init(wrapper[implSymbol]);
|
| 93 |
+
}
|
| 94 |
+
return wrapper[implSymbol];
|
| 95 |
+
};
|
| 96 |
+
|
| 97 |
+
const exposed = new Set(["Window"]);
|
| 98 |
+
|
| 99 |
+
exports.install = (globalObject, globalNames) => {
|
| 100 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 101 |
+
return;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 105 |
+
class RadioNodeList extends globalObject.NodeList {
|
| 106 |
+
constructor() {
|
| 107 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
get value() {
|
| 111 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 112 |
+
|
| 113 |
+
if (!exports.is(esValue)) {
|
| 114 |
+
throw new globalObject.TypeError(
|
| 115 |
+
"'get value' called on an object that is not a valid instance of RadioNodeList."
|
| 116 |
+
);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
return esValue[implSymbol]["value"];
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
set value(V) {
|
| 123 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 124 |
+
|
| 125 |
+
if (!exports.is(esValue)) {
|
| 126 |
+
throw new globalObject.TypeError(
|
| 127 |
+
"'set value' called on an object that is not a valid instance of RadioNodeList."
|
| 128 |
+
);
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
V = conversions["DOMString"](V, {
|
| 132 |
+
context: "Failed to set the 'value' property on 'RadioNodeList': The provided value",
|
| 133 |
+
globals: globalObject
|
| 134 |
+
});
|
| 135 |
+
|
| 136 |
+
esValue[implSymbol]["value"] = V;
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
Object.defineProperties(RadioNodeList.prototype, {
|
| 140 |
+
value: { enumerable: true },
|
| 141 |
+
[Symbol.toStringTag]: { value: "RadioNodeList", configurable: true },
|
| 142 |
+
[Symbol.iterator]: { value: globalObject.Array.prototype[Symbol.iterator], configurable: true, writable: true }
|
| 143 |
+
});
|
| 144 |
+
ctorRegistry[interfaceName] = RadioNodeList;
|
| 145 |
+
|
| 146 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 147 |
+
configurable: true,
|
| 148 |
+
writable: true,
|
| 149 |
+
value: RadioNodeList
|
| 150 |
+
});
|
| 151 |
+
};
|
| 152 |
+
|
| 153 |
+
const proxyHandlerCache = new WeakMap();
|
| 154 |
+
class ProxyHandler {
|
| 155 |
+
constructor(globalObject) {
|
| 156 |
+
this._globalObject = globalObject;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
get(target, P, receiver) {
|
| 160 |
+
if (typeof P === "symbol") {
|
| 161 |
+
return Reflect.get(target, P, receiver);
|
| 162 |
+
}
|
| 163 |
+
const desc = this.getOwnPropertyDescriptor(target, P);
|
| 164 |
+
if (desc === undefined) {
|
| 165 |
+
const parent = Object.getPrototypeOf(target);
|
| 166 |
+
if (parent === null) {
|
| 167 |
+
return undefined;
|
| 168 |
+
}
|
| 169 |
+
return Reflect.get(target, P, receiver);
|
| 170 |
+
}
|
| 171 |
+
if (!desc.get && !desc.set) {
|
| 172 |
+
return desc.value;
|
| 173 |
+
}
|
| 174 |
+
const getter = desc.get;
|
| 175 |
+
if (getter === undefined) {
|
| 176 |
+
return undefined;
|
| 177 |
+
}
|
| 178 |
+
return Reflect.apply(getter, receiver, []);
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
has(target, P) {
|
| 182 |
+
if (typeof P === "symbol") {
|
| 183 |
+
return Reflect.has(target, P);
|
| 184 |
+
}
|
| 185 |
+
const desc = this.getOwnPropertyDescriptor(target, P);
|
| 186 |
+
if (desc !== undefined) {
|
| 187 |
+
return true;
|
| 188 |
+
}
|
| 189 |
+
const parent = Object.getPrototypeOf(target);
|
| 190 |
+
if (parent !== null) {
|
| 191 |
+
return Reflect.has(parent, P);
|
| 192 |
+
}
|
| 193 |
+
return false;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
ownKeys(target) {
|
| 197 |
+
const keys = new Set();
|
| 198 |
+
|
| 199 |
+
for (const key of target[implSymbol][utils.supportedPropertyIndices]) {
|
| 200 |
+
keys.add(`${key}`);
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
for (const key of Reflect.ownKeys(target)) {
|
| 204 |
+
keys.add(key);
|
| 205 |
+
}
|
| 206 |
+
return [...keys];
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
getOwnPropertyDescriptor(target, P) {
|
| 210 |
+
if (typeof P === "symbol") {
|
| 211 |
+
return Reflect.getOwnPropertyDescriptor(target, P);
|
| 212 |
+
}
|
| 213 |
+
let ignoreNamedProps = false;
|
| 214 |
+
|
| 215 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 216 |
+
const index = P >>> 0;
|
| 217 |
+
const indexedValue = target[implSymbol].item(index);
|
| 218 |
+
if (indexedValue !== null) {
|
| 219 |
+
return {
|
| 220 |
+
writable: false,
|
| 221 |
+
enumerable: true,
|
| 222 |
+
configurable: true,
|
| 223 |
+
value: utils.tryWrapperForImpl(indexedValue)
|
| 224 |
+
};
|
| 225 |
+
}
|
| 226 |
+
ignoreNamedProps = true;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
return Reflect.getOwnPropertyDescriptor(target, P);
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
set(target, P, V, receiver) {
|
| 233 |
+
if (typeof P === "symbol") {
|
| 234 |
+
return Reflect.set(target, P, V, receiver);
|
| 235 |
+
}
|
| 236 |
+
// The `receiver` argument refers to the Proxy exotic object or an object
|
| 237 |
+
// that inherits from it, whereas `target` refers to the Proxy target:
|
| 238 |
+
if (target[implSymbol][utils.wrapperSymbol] === receiver) {
|
| 239 |
+
const globalObject = this._globalObject;
|
| 240 |
+
}
|
| 241 |
+
let ownDesc;
|
| 242 |
+
|
| 243 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 244 |
+
const index = P >>> 0;
|
| 245 |
+
const indexedValue = target[implSymbol].item(index);
|
| 246 |
+
if (indexedValue !== null) {
|
| 247 |
+
ownDesc = {
|
| 248 |
+
writable: false,
|
| 249 |
+
enumerable: true,
|
| 250 |
+
configurable: true,
|
| 251 |
+
value: utils.tryWrapperForImpl(indexedValue)
|
| 252 |
+
};
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
if (ownDesc === undefined) {
|
| 257 |
+
ownDesc = Reflect.getOwnPropertyDescriptor(target, P);
|
| 258 |
+
}
|
| 259 |
+
return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc);
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
defineProperty(target, P, desc) {
|
| 263 |
+
if (typeof P === "symbol") {
|
| 264 |
+
return Reflect.defineProperty(target, P, desc);
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
const globalObject = this._globalObject;
|
| 268 |
+
|
| 269 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 270 |
+
return false;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
return Reflect.defineProperty(target, P, desc);
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
deleteProperty(target, P) {
|
| 277 |
+
if (typeof P === "symbol") {
|
| 278 |
+
return Reflect.deleteProperty(target, P);
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
const globalObject = this._globalObject;
|
| 282 |
+
|
| 283 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 284 |
+
const index = P >>> 0;
|
| 285 |
+
return !(target[implSymbol].item(index) !== null);
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
return Reflect.deleteProperty(target, P);
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
preventExtensions() {
|
| 292 |
+
return false;
|
| 293 |
+
}
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
const Impl = require("../nodes/RadioNodeList-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/Range.js
ADDED
|
@@ -0,0 +1,641 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const Node = require("./Node.js");
|
| 7 |
+
const ceReactionsPreSteps_helpers_custom_elements = require("../helpers/custom-elements.js").ceReactionsPreSteps;
|
| 8 |
+
const ceReactionsPostSteps_helpers_custom_elements = require("../helpers/custom-elements.js").ceReactionsPostSteps;
|
| 9 |
+
const implSymbol = utils.implSymbol;
|
| 10 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 11 |
+
const AbstractRange = require("./AbstractRange.js");
|
| 12 |
+
|
| 13 |
+
const interfaceName = "Range";
|
| 14 |
+
|
| 15 |
+
exports.is = value => {
|
| 16 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.isImpl = value => {
|
| 19 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 20 |
+
};
|
| 21 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 22 |
+
if (exports.is(value)) {
|
| 23 |
+
return utils.implForWrapper(value);
|
| 24 |
+
}
|
| 25 |
+
throw new globalObject.TypeError(`${context} is not of type 'Range'.`);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
function makeWrapper(globalObject, newTarget) {
|
| 29 |
+
let proto;
|
| 30 |
+
if (newTarget !== undefined) {
|
| 31 |
+
proto = newTarget.prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
if (!utils.isObject(proto)) {
|
| 35 |
+
proto = globalObject[ctorRegistrySymbol]["Range"].prototype;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
return Object.create(proto);
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 42 |
+
const wrapper = makeWrapper(globalObject);
|
| 43 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 44 |
+
};
|
| 45 |
+
|
| 46 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 47 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 48 |
+
return utils.implForWrapper(wrapper);
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 52 |
+
AbstractRange._internalSetup(wrapper, globalObject);
|
| 53 |
+
};
|
| 54 |
+
|
| 55 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 56 |
+
privateData.wrapper = wrapper;
|
| 57 |
+
|
| 58 |
+
exports._internalSetup(wrapper, globalObject);
|
| 59 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 60 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 61 |
+
configurable: true
|
| 62 |
+
});
|
| 63 |
+
|
| 64 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 65 |
+
if (Impl.init) {
|
| 66 |
+
Impl.init(wrapper[implSymbol]);
|
| 67 |
+
}
|
| 68 |
+
return wrapper;
|
| 69 |
+
};
|
| 70 |
+
|
| 71 |
+
exports.new = (globalObject, newTarget) => {
|
| 72 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 73 |
+
|
| 74 |
+
exports._internalSetup(wrapper, globalObject);
|
| 75 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 76 |
+
value: Object.create(Impl.implementation.prototype),
|
| 77 |
+
configurable: true
|
| 78 |
+
});
|
| 79 |
+
|
| 80 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 81 |
+
if (Impl.init) {
|
| 82 |
+
Impl.init(wrapper[implSymbol]);
|
| 83 |
+
}
|
| 84 |
+
return wrapper[implSymbol];
|
| 85 |
+
};
|
| 86 |
+
|
| 87 |
+
const exposed = new Set(["Window"]);
|
| 88 |
+
|
| 89 |
+
exports.install = (globalObject, globalNames) => {
|
| 90 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 91 |
+
return;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 95 |
+
class Range extends globalObject.AbstractRange {
|
| 96 |
+
constructor() {
|
| 97 |
+
return exports.setup(Object.create(new.target.prototype), globalObject, undefined);
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
setStart(node, offset) {
|
| 101 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 102 |
+
if (!exports.is(esValue)) {
|
| 103 |
+
throw new globalObject.TypeError("'setStart' called on an object that is not a valid instance of Range.");
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
if (arguments.length < 2) {
|
| 107 |
+
throw new globalObject.TypeError(
|
| 108 |
+
`Failed to execute 'setStart' on 'Range': 2 arguments required, but only ${arguments.length} present.`
|
| 109 |
+
);
|
| 110 |
+
}
|
| 111 |
+
const args = [];
|
| 112 |
+
{
|
| 113 |
+
let curArg = arguments[0];
|
| 114 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 115 |
+
context: "Failed to execute 'setStart' on 'Range': parameter 1"
|
| 116 |
+
});
|
| 117 |
+
args.push(curArg);
|
| 118 |
+
}
|
| 119 |
+
{
|
| 120 |
+
let curArg = arguments[1];
|
| 121 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 122 |
+
context: "Failed to execute 'setStart' on 'Range': parameter 2",
|
| 123 |
+
globals: globalObject
|
| 124 |
+
});
|
| 125 |
+
args.push(curArg);
|
| 126 |
+
}
|
| 127 |
+
return esValue[implSymbol].setStart(...args);
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
setEnd(node, offset) {
|
| 131 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 132 |
+
if (!exports.is(esValue)) {
|
| 133 |
+
throw new globalObject.TypeError("'setEnd' called on an object that is not a valid instance of Range.");
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
if (arguments.length < 2) {
|
| 137 |
+
throw new globalObject.TypeError(
|
| 138 |
+
`Failed to execute 'setEnd' on 'Range': 2 arguments required, but only ${arguments.length} present.`
|
| 139 |
+
);
|
| 140 |
+
}
|
| 141 |
+
const args = [];
|
| 142 |
+
{
|
| 143 |
+
let curArg = arguments[0];
|
| 144 |
+
curArg = Node.convert(globalObject, curArg, { context: "Failed to execute 'setEnd' on 'Range': parameter 1" });
|
| 145 |
+
args.push(curArg);
|
| 146 |
+
}
|
| 147 |
+
{
|
| 148 |
+
let curArg = arguments[1];
|
| 149 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 150 |
+
context: "Failed to execute 'setEnd' on 'Range': parameter 2",
|
| 151 |
+
globals: globalObject
|
| 152 |
+
});
|
| 153 |
+
args.push(curArg);
|
| 154 |
+
}
|
| 155 |
+
return esValue[implSymbol].setEnd(...args);
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
setStartBefore(node) {
|
| 159 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 160 |
+
if (!exports.is(esValue)) {
|
| 161 |
+
throw new globalObject.TypeError("'setStartBefore' called on an object that is not a valid instance of Range.");
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
if (arguments.length < 1) {
|
| 165 |
+
throw new globalObject.TypeError(
|
| 166 |
+
`Failed to execute 'setStartBefore' on 'Range': 1 argument required, but only ${arguments.length} present.`
|
| 167 |
+
);
|
| 168 |
+
}
|
| 169 |
+
const args = [];
|
| 170 |
+
{
|
| 171 |
+
let curArg = arguments[0];
|
| 172 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 173 |
+
context: "Failed to execute 'setStartBefore' on 'Range': parameter 1"
|
| 174 |
+
});
|
| 175 |
+
args.push(curArg);
|
| 176 |
+
}
|
| 177 |
+
return esValue[implSymbol].setStartBefore(...args);
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
setStartAfter(node) {
|
| 181 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 182 |
+
if (!exports.is(esValue)) {
|
| 183 |
+
throw new globalObject.TypeError("'setStartAfter' called on an object that is not a valid instance of Range.");
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
if (arguments.length < 1) {
|
| 187 |
+
throw new globalObject.TypeError(
|
| 188 |
+
`Failed to execute 'setStartAfter' on 'Range': 1 argument required, but only ${arguments.length} present.`
|
| 189 |
+
);
|
| 190 |
+
}
|
| 191 |
+
const args = [];
|
| 192 |
+
{
|
| 193 |
+
let curArg = arguments[0];
|
| 194 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 195 |
+
context: "Failed to execute 'setStartAfter' on 'Range': parameter 1"
|
| 196 |
+
});
|
| 197 |
+
args.push(curArg);
|
| 198 |
+
}
|
| 199 |
+
return esValue[implSymbol].setStartAfter(...args);
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
setEndBefore(node) {
|
| 203 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 204 |
+
if (!exports.is(esValue)) {
|
| 205 |
+
throw new globalObject.TypeError("'setEndBefore' called on an object that is not a valid instance of Range.");
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
if (arguments.length < 1) {
|
| 209 |
+
throw new globalObject.TypeError(
|
| 210 |
+
`Failed to execute 'setEndBefore' on 'Range': 1 argument required, but only ${arguments.length} present.`
|
| 211 |
+
);
|
| 212 |
+
}
|
| 213 |
+
const args = [];
|
| 214 |
+
{
|
| 215 |
+
let curArg = arguments[0];
|
| 216 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 217 |
+
context: "Failed to execute 'setEndBefore' on 'Range': parameter 1"
|
| 218 |
+
});
|
| 219 |
+
args.push(curArg);
|
| 220 |
+
}
|
| 221 |
+
return esValue[implSymbol].setEndBefore(...args);
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
setEndAfter(node) {
|
| 225 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 226 |
+
if (!exports.is(esValue)) {
|
| 227 |
+
throw new globalObject.TypeError("'setEndAfter' called on an object that is not a valid instance of Range.");
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
if (arguments.length < 1) {
|
| 231 |
+
throw new globalObject.TypeError(
|
| 232 |
+
`Failed to execute 'setEndAfter' on 'Range': 1 argument required, but only ${arguments.length} present.`
|
| 233 |
+
);
|
| 234 |
+
}
|
| 235 |
+
const args = [];
|
| 236 |
+
{
|
| 237 |
+
let curArg = arguments[0];
|
| 238 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 239 |
+
context: "Failed to execute 'setEndAfter' on 'Range': parameter 1"
|
| 240 |
+
});
|
| 241 |
+
args.push(curArg);
|
| 242 |
+
}
|
| 243 |
+
return esValue[implSymbol].setEndAfter(...args);
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
collapse() {
|
| 247 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 248 |
+
if (!exports.is(esValue)) {
|
| 249 |
+
throw new globalObject.TypeError("'collapse' called on an object that is not a valid instance of Range.");
|
| 250 |
+
}
|
| 251 |
+
const args = [];
|
| 252 |
+
{
|
| 253 |
+
let curArg = arguments[0];
|
| 254 |
+
if (curArg !== undefined) {
|
| 255 |
+
curArg = conversions["boolean"](curArg, {
|
| 256 |
+
context: "Failed to execute 'collapse' on 'Range': parameter 1",
|
| 257 |
+
globals: globalObject
|
| 258 |
+
});
|
| 259 |
+
} else {
|
| 260 |
+
curArg = false;
|
| 261 |
+
}
|
| 262 |
+
args.push(curArg);
|
| 263 |
+
}
|
| 264 |
+
return esValue[implSymbol].collapse(...args);
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
selectNode(node) {
|
| 268 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 269 |
+
if (!exports.is(esValue)) {
|
| 270 |
+
throw new globalObject.TypeError("'selectNode' called on an object that is not a valid instance of Range.");
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
if (arguments.length < 1) {
|
| 274 |
+
throw new globalObject.TypeError(
|
| 275 |
+
`Failed to execute 'selectNode' on 'Range': 1 argument required, but only ${arguments.length} present.`
|
| 276 |
+
);
|
| 277 |
+
}
|
| 278 |
+
const args = [];
|
| 279 |
+
{
|
| 280 |
+
let curArg = arguments[0];
|
| 281 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 282 |
+
context: "Failed to execute 'selectNode' on 'Range': parameter 1"
|
| 283 |
+
});
|
| 284 |
+
args.push(curArg);
|
| 285 |
+
}
|
| 286 |
+
return esValue[implSymbol].selectNode(...args);
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
selectNodeContents(node) {
|
| 290 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 291 |
+
if (!exports.is(esValue)) {
|
| 292 |
+
throw new globalObject.TypeError(
|
| 293 |
+
"'selectNodeContents' called on an object that is not a valid instance of Range."
|
| 294 |
+
);
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
if (arguments.length < 1) {
|
| 298 |
+
throw new globalObject.TypeError(
|
| 299 |
+
`Failed to execute 'selectNodeContents' on 'Range': 1 argument required, but only ${arguments.length} present.`
|
| 300 |
+
);
|
| 301 |
+
}
|
| 302 |
+
const args = [];
|
| 303 |
+
{
|
| 304 |
+
let curArg = arguments[0];
|
| 305 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 306 |
+
context: "Failed to execute 'selectNodeContents' on 'Range': parameter 1"
|
| 307 |
+
});
|
| 308 |
+
args.push(curArg);
|
| 309 |
+
}
|
| 310 |
+
return esValue[implSymbol].selectNodeContents(...args);
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
compareBoundaryPoints(how, sourceRange) {
|
| 314 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 315 |
+
if (!exports.is(esValue)) {
|
| 316 |
+
throw new globalObject.TypeError(
|
| 317 |
+
"'compareBoundaryPoints' called on an object that is not a valid instance of Range."
|
| 318 |
+
);
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
if (arguments.length < 2) {
|
| 322 |
+
throw new globalObject.TypeError(
|
| 323 |
+
`Failed to execute 'compareBoundaryPoints' on 'Range': 2 arguments required, but only ${arguments.length} present.`
|
| 324 |
+
);
|
| 325 |
+
}
|
| 326 |
+
const args = [];
|
| 327 |
+
{
|
| 328 |
+
let curArg = arguments[0];
|
| 329 |
+
curArg = conversions["unsigned short"](curArg, {
|
| 330 |
+
context: "Failed to execute 'compareBoundaryPoints' on 'Range': parameter 1",
|
| 331 |
+
globals: globalObject
|
| 332 |
+
});
|
| 333 |
+
args.push(curArg);
|
| 334 |
+
}
|
| 335 |
+
{
|
| 336 |
+
let curArg = arguments[1];
|
| 337 |
+
curArg = exports.convert(globalObject, curArg, {
|
| 338 |
+
context: "Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2"
|
| 339 |
+
});
|
| 340 |
+
args.push(curArg);
|
| 341 |
+
}
|
| 342 |
+
return esValue[implSymbol].compareBoundaryPoints(...args);
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
deleteContents() {
|
| 346 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 347 |
+
if (!exports.is(esValue)) {
|
| 348 |
+
throw new globalObject.TypeError("'deleteContents' called on an object that is not a valid instance of Range.");
|
| 349 |
+
}
|
| 350 |
+
|
| 351 |
+
ceReactionsPreSteps_helpers_custom_elements(globalObject);
|
| 352 |
+
try {
|
| 353 |
+
return esValue[implSymbol].deleteContents();
|
| 354 |
+
} finally {
|
| 355 |
+
ceReactionsPostSteps_helpers_custom_elements(globalObject);
|
| 356 |
+
}
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
extractContents() {
|
| 360 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 361 |
+
if (!exports.is(esValue)) {
|
| 362 |
+
throw new globalObject.TypeError(
|
| 363 |
+
"'extractContents' called on an object that is not a valid instance of Range."
|
| 364 |
+
);
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
ceReactionsPreSteps_helpers_custom_elements(globalObject);
|
| 368 |
+
try {
|
| 369 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].extractContents());
|
| 370 |
+
} finally {
|
| 371 |
+
ceReactionsPostSteps_helpers_custom_elements(globalObject);
|
| 372 |
+
}
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
cloneContents() {
|
| 376 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 377 |
+
if (!exports.is(esValue)) {
|
| 378 |
+
throw new globalObject.TypeError("'cloneContents' called on an object that is not a valid instance of Range.");
|
| 379 |
+
}
|
| 380 |
+
|
| 381 |
+
ceReactionsPreSteps_helpers_custom_elements(globalObject);
|
| 382 |
+
try {
|
| 383 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].cloneContents());
|
| 384 |
+
} finally {
|
| 385 |
+
ceReactionsPostSteps_helpers_custom_elements(globalObject);
|
| 386 |
+
}
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
insertNode(node) {
|
| 390 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 391 |
+
if (!exports.is(esValue)) {
|
| 392 |
+
throw new globalObject.TypeError("'insertNode' called on an object that is not a valid instance of Range.");
|
| 393 |
+
}
|
| 394 |
+
|
| 395 |
+
if (arguments.length < 1) {
|
| 396 |
+
throw new globalObject.TypeError(
|
| 397 |
+
`Failed to execute 'insertNode' on 'Range': 1 argument required, but only ${arguments.length} present.`
|
| 398 |
+
);
|
| 399 |
+
}
|
| 400 |
+
const args = [];
|
| 401 |
+
{
|
| 402 |
+
let curArg = arguments[0];
|
| 403 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 404 |
+
context: "Failed to execute 'insertNode' on 'Range': parameter 1"
|
| 405 |
+
});
|
| 406 |
+
args.push(curArg);
|
| 407 |
+
}
|
| 408 |
+
ceReactionsPreSteps_helpers_custom_elements(globalObject);
|
| 409 |
+
try {
|
| 410 |
+
return esValue[implSymbol].insertNode(...args);
|
| 411 |
+
} finally {
|
| 412 |
+
ceReactionsPostSteps_helpers_custom_elements(globalObject);
|
| 413 |
+
}
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
surroundContents(newParent) {
|
| 417 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 418 |
+
if (!exports.is(esValue)) {
|
| 419 |
+
throw new globalObject.TypeError(
|
| 420 |
+
"'surroundContents' called on an object that is not a valid instance of Range."
|
| 421 |
+
);
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
if (arguments.length < 1) {
|
| 425 |
+
throw new globalObject.TypeError(
|
| 426 |
+
`Failed to execute 'surroundContents' on 'Range': 1 argument required, but only ${arguments.length} present.`
|
| 427 |
+
);
|
| 428 |
+
}
|
| 429 |
+
const args = [];
|
| 430 |
+
{
|
| 431 |
+
let curArg = arguments[0];
|
| 432 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 433 |
+
context: "Failed to execute 'surroundContents' on 'Range': parameter 1"
|
| 434 |
+
});
|
| 435 |
+
args.push(curArg);
|
| 436 |
+
}
|
| 437 |
+
ceReactionsPreSteps_helpers_custom_elements(globalObject);
|
| 438 |
+
try {
|
| 439 |
+
return esValue[implSymbol].surroundContents(...args);
|
| 440 |
+
} finally {
|
| 441 |
+
ceReactionsPostSteps_helpers_custom_elements(globalObject);
|
| 442 |
+
}
|
| 443 |
+
}
|
| 444 |
+
|
| 445 |
+
cloneRange() {
|
| 446 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 447 |
+
if (!exports.is(esValue)) {
|
| 448 |
+
throw new globalObject.TypeError("'cloneRange' called on an object that is not a valid instance of Range.");
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].cloneRange());
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
detach() {
|
| 455 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 456 |
+
if (!exports.is(esValue)) {
|
| 457 |
+
throw new globalObject.TypeError("'detach' called on an object that is not a valid instance of Range.");
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
return esValue[implSymbol].detach();
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
isPointInRange(node, offset) {
|
| 464 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 465 |
+
if (!exports.is(esValue)) {
|
| 466 |
+
throw new globalObject.TypeError("'isPointInRange' called on an object that is not a valid instance of Range.");
|
| 467 |
+
}
|
| 468 |
+
|
| 469 |
+
if (arguments.length < 2) {
|
| 470 |
+
throw new globalObject.TypeError(
|
| 471 |
+
`Failed to execute 'isPointInRange' on 'Range': 2 arguments required, but only ${arguments.length} present.`
|
| 472 |
+
);
|
| 473 |
+
}
|
| 474 |
+
const args = [];
|
| 475 |
+
{
|
| 476 |
+
let curArg = arguments[0];
|
| 477 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 478 |
+
context: "Failed to execute 'isPointInRange' on 'Range': parameter 1"
|
| 479 |
+
});
|
| 480 |
+
args.push(curArg);
|
| 481 |
+
}
|
| 482 |
+
{
|
| 483 |
+
let curArg = arguments[1];
|
| 484 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 485 |
+
context: "Failed to execute 'isPointInRange' on 'Range': parameter 2",
|
| 486 |
+
globals: globalObject
|
| 487 |
+
});
|
| 488 |
+
args.push(curArg);
|
| 489 |
+
}
|
| 490 |
+
return esValue[implSymbol].isPointInRange(...args);
|
| 491 |
+
}
|
| 492 |
+
|
| 493 |
+
comparePoint(node, offset) {
|
| 494 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 495 |
+
if (!exports.is(esValue)) {
|
| 496 |
+
throw new globalObject.TypeError("'comparePoint' called on an object that is not a valid instance of Range.");
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
if (arguments.length < 2) {
|
| 500 |
+
throw new globalObject.TypeError(
|
| 501 |
+
`Failed to execute 'comparePoint' on 'Range': 2 arguments required, but only ${arguments.length} present.`
|
| 502 |
+
);
|
| 503 |
+
}
|
| 504 |
+
const args = [];
|
| 505 |
+
{
|
| 506 |
+
let curArg = arguments[0];
|
| 507 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 508 |
+
context: "Failed to execute 'comparePoint' on 'Range': parameter 1"
|
| 509 |
+
});
|
| 510 |
+
args.push(curArg);
|
| 511 |
+
}
|
| 512 |
+
{
|
| 513 |
+
let curArg = arguments[1];
|
| 514 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 515 |
+
context: "Failed to execute 'comparePoint' on 'Range': parameter 2",
|
| 516 |
+
globals: globalObject
|
| 517 |
+
});
|
| 518 |
+
args.push(curArg);
|
| 519 |
+
}
|
| 520 |
+
return esValue[implSymbol].comparePoint(...args);
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
intersectsNode(node) {
|
| 524 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 525 |
+
if (!exports.is(esValue)) {
|
| 526 |
+
throw new globalObject.TypeError("'intersectsNode' called on an object that is not a valid instance of Range.");
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
if (arguments.length < 1) {
|
| 530 |
+
throw new globalObject.TypeError(
|
| 531 |
+
`Failed to execute 'intersectsNode' on 'Range': 1 argument required, but only ${arguments.length} present.`
|
| 532 |
+
);
|
| 533 |
+
}
|
| 534 |
+
const args = [];
|
| 535 |
+
{
|
| 536 |
+
let curArg = arguments[0];
|
| 537 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 538 |
+
context: "Failed to execute 'intersectsNode' on 'Range': parameter 1"
|
| 539 |
+
});
|
| 540 |
+
args.push(curArg);
|
| 541 |
+
}
|
| 542 |
+
return esValue[implSymbol].intersectsNode(...args);
|
| 543 |
+
}
|
| 544 |
+
|
| 545 |
+
toString() {
|
| 546 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 547 |
+
if (!exports.is(esValue)) {
|
| 548 |
+
throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of Range.");
|
| 549 |
+
}
|
| 550 |
+
|
| 551 |
+
return esValue[implSymbol].toString();
|
| 552 |
+
}
|
| 553 |
+
|
| 554 |
+
createContextualFragment(fragment) {
|
| 555 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 556 |
+
if (!exports.is(esValue)) {
|
| 557 |
+
throw new globalObject.TypeError(
|
| 558 |
+
"'createContextualFragment' called on an object that is not a valid instance of Range."
|
| 559 |
+
);
|
| 560 |
+
}
|
| 561 |
+
|
| 562 |
+
if (arguments.length < 1) {
|
| 563 |
+
throw new globalObject.TypeError(
|
| 564 |
+
`Failed to execute 'createContextualFragment' on 'Range': 1 argument required, but only ${arguments.length} present.`
|
| 565 |
+
);
|
| 566 |
+
}
|
| 567 |
+
const args = [];
|
| 568 |
+
{
|
| 569 |
+
let curArg = arguments[0];
|
| 570 |
+
curArg = conversions["DOMString"](curArg, {
|
| 571 |
+
context: "Failed to execute 'createContextualFragment' on 'Range': parameter 1",
|
| 572 |
+
globals: globalObject
|
| 573 |
+
});
|
| 574 |
+
args.push(curArg);
|
| 575 |
+
}
|
| 576 |
+
ceReactionsPreSteps_helpers_custom_elements(globalObject);
|
| 577 |
+
try {
|
| 578 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].createContextualFragment(...args));
|
| 579 |
+
} finally {
|
| 580 |
+
ceReactionsPostSteps_helpers_custom_elements(globalObject);
|
| 581 |
+
}
|
| 582 |
+
}
|
| 583 |
+
|
| 584 |
+
get commonAncestorContainer() {
|
| 585 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 586 |
+
|
| 587 |
+
if (!exports.is(esValue)) {
|
| 588 |
+
throw new globalObject.TypeError(
|
| 589 |
+
"'get commonAncestorContainer' called on an object that is not a valid instance of Range."
|
| 590 |
+
);
|
| 591 |
+
}
|
| 592 |
+
|
| 593 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["commonAncestorContainer"]);
|
| 594 |
+
}
|
| 595 |
+
}
|
| 596 |
+
Object.defineProperties(Range.prototype, {
|
| 597 |
+
setStart: { enumerable: true },
|
| 598 |
+
setEnd: { enumerable: true },
|
| 599 |
+
setStartBefore: { enumerable: true },
|
| 600 |
+
setStartAfter: { enumerable: true },
|
| 601 |
+
setEndBefore: { enumerable: true },
|
| 602 |
+
setEndAfter: { enumerable: true },
|
| 603 |
+
collapse: { enumerable: true },
|
| 604 |
+
selectNode: { enumerable: true },
|
| 605 |
+
selectNodeContents: { enumerable: true },
|
| 606 |
+
compareBoundaryPoints: { enumerable: true },
|
| 607 |
+
deleteContents: { enumerable: true },
|
| 608 |
+
extractContents: { enumerable: true },
|
| 609 |
+
cloneContents: { enumerable: true },
|
| 610 |
+
insertNode: { enumerable: true },
|
| 611 |
+
surroundContents: { enumerable: true },
|
| 612 |
+
cloneRange: { enumerable: true },
|
| 613 |
+
detach: { enumerable: true },
|
| 614 |
+
isPointInRange: { enumerable: true },
|
| 615 |
+
comparePoint: { enumerable: true },
|
| 616 |
+
intersectsNode: { enumerable: true },
|
| 617 |
+
toString: { enumerable: true },
|
| 618 |
+
createContextualFragment: { enumerable: true },
|
| 619 |
+
commonAncestorContainer: { enumerable: true },
|
| 620 |
+
[Symbol.toStringTag]: { value: "Range", configurable: true },
|
| 621 |
+
START_TO_START: { value: 0, enumerable: true },
|
| 622 |
+
START_TO_END: { value: 1, enumerable: true },
|
| 623 |
+
END_TO_END: { value: 2, enumerable: true },
|
| 624 |
+
END_TO_START: { value: 3, enumerable: true }
|
| 625 |
+
});
|
| 626 |
+
Object.defineProperties(Range, {
|
| 627 |
+
START_TO_START: { value: 0, enumerable: true },
|
| 628 |
+
START_TO_END: { value: 1, enumerable: true },
|
| 629 |
+
END_TO_END: { value: 2, enumerable: true },
|
| 630 |
+
END_TO_START: { value: 3, enumerable: true }
|
| 631 |
+
});
|
| 632 |
+
ctorRegistry[interfaceName] = Range;
|
| 633 |
+
|
| 634 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 635 |
+
configurable: true,
|
| 636 |
+
writable: true,
|
| 637 |
+
value: Range
|
| 638 |
+
});
|
| 639 |
+
};
|
| 640 |
+
|
| 641 |
+
const Impl = require("../range/Range-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedPreserveAspectRatio.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "SVGAnimatedPreserveAspectRatio";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGAnimatedPreserveAspectRatio'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["SVGAnimatedPreserveAspectRatio"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 38 |
+
const wrapper = makeWrapper(globalObject);
|
| 39 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 43 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 44 |
+
return utils.implForWrapper(wrapper);
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 48 |
+
|
| 49 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 50 |
+
privateData.wrapper = wrapper;
|
| 51 |
+
|
| 52 |
+
exports._internalSetup(wrapper, globalObject);
|
| 53 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 54 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 55 |
+
configurable: true
|
| 56 |
+
});
|
| 57 |
+
|
| 58 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 59 |
+
if (Impl.init) {
|
| 60 |
+
Impl.init(wrapper[implSymbol]);
|
| 61 |
+
}
|
| 62 |
+
return wrapper;
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
exports.new = (globalObject, newTarget) => {
|
| 66 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 67 |
+
|
| 68 |
+
exports._internalSetup(wrapper, globalObject);
|
| 69 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 70 |
+
value: Object.create(Impl.implementation.prototype),
|
| 71 |
+
configurable: true
|
| 72 |
+
});
|
| 73 |
+
|
| 74 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 75 |
+
if (Impl.init) {
|
| 76 |
+
Impl.init(wrapper[implSymbol]);
|
| 77 |
+
}
|
| 78 |
+
return wrapper[implSymbol];
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
const exposed = new Set(["Window"]);
|
| 82 |
+
|
| 83 |
+
exports.install = (globalObject, globalNames) => {
|
| 84 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 85 |
+
return;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 89 |
+
class SVGAnimatedPreserveAspectRatio {
|
| 90 |
+
constructor() {
|
| 91 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
get baseVal() {
|
| 95 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 96 |
+
|
| 97 |
+
if (!exports.is(esValue)) {
|
| 98 |
+
throw new globalObject.TypeError(
|
| 99 |
+
"'get baseVal' called on an object that is not a valid instance of SVGAnimatedPreserveAspectRatio."
|
| 100 |
+
);
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
return utils.getSameObject(this, "baseVal", () => {
|
| 104 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["baseVal"]);
|
| 105 |
+
});
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
get animVal() {
|
| 109 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 110 |
+
|
| 111 |
+
if (!exports.is(esValue)) {
|
| 112 |
+
throw new globalObject.TypeError(
|
| 113 |
+
"'get animVal' called on an object that is not a valid instance of SVGAnimatedPreserveAspectRatio."
|
| 114 |
+
);
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
return utils.getSameObject(this, "animVal", () => {
|
| 118 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["animVal"]);
|
| 119 |
+
});
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
Object.defineProperties(SVGAnimatedPreserveAspectRatio.prototype, {
|
| 123 |
+
baseVal: { enumerable: true },
|
| 124 |
+
animVal: { enumerable: true },
|
| 125 |
+
[Symbol.toStringTag]: { value: "SVGAnimatedPreserveAspectRatio", configurable: true }
|
| 126 |
+
});
|
| 127 |
+
ctorRegistry[interfaceName] = SVGAnimatedPreserveAspectRatio;
|
| 128 |
+
|
| 129 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 130 |
+
configurable: true,
|
| 131 |
+
writable: true,
|
| 132 |
+
value: SVGAnimatedPreserveAspectRatio
|
| 133 |
+
});
|
| 134 |
+
};
|
| 135 |
+
|
| 136 |
+
const Impl = require("../svg/SVGAnimatedPreserveAspectRatio-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedRect.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "SVGAnimatedRect";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGAnimatedRect'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["SVGAnimatedRect"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 38 |
+
const wrapper = makeWrapper(globalObject);
|
| 39 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 43 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 44 |
+
return utils.implForWrapper(wrapper);
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 48 |
+
|
| 49 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 50 |
+
privateData.wrapper = wrapper;
|
| 51 |
+
|
| 52 |
+
exports._internalSetup(wrapper, globalObject);
|
| 53 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 54 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 55 |
+
configurable: true
|
| 56 |
+
});
|
| 57 |
+
|
| 58 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 59 |
+
if (Impl.init) {
|
| 60 |
+
Impl.init(wrapper[implSymbol]);
|
| 61 |
+
}
|
| 62 |
+
return wrapper;
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
exports.new = (globalObject, newTarget) => {
|
| 66 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 67 |
+
|
| 68 |
+
exports._internalSetup(wrapper, globalObject);
|
| 69 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 70 |
+
value: Object.create(Impl.implementation.prototype),
|
| 71 |
+
configurable: true
|
| 72 |
+
});
|
| 73 |
+
|
| 74 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 75 |
+
if (Impl.init) {
|
| 76 |
+
Impl.init(wrapper[implSymbol]);
|
| 77 |
+
}
|
| 78 |
+
return wrapper[implSymbol];
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
const exposed = new Set(["Window"]);
|
| 82 |
+
|
| 83 |
+
exports.install = (globalObject, globalNames) => {
|
| 84 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 85 |
+
return;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 89 |
+
class SVGAnimatedRect {
|
| 90 |
+
constructor() {
|
| 91 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
get baseVal() {
|
| 95 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 96 |
+
|
| 97 |
+
if (!exports.is(esValue)) {
|
| 98 |
+
throw new globalObject.TypeError(
|
| 99 |
+
"'get baseVal' called on an object that is not a valid instance of SVGAnimatedRect."
|
| 100 |
+
);
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
return utils.getSameObject(this, "baseVal", () => {
|
| 104 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["baseVal"]);
|
| 105 |
+
});
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
get animVal() {
|
| 109 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 110 |
+
|
| 111 |
+
if (!exports.is(esValue)) {
|
| 112 |
+
throw new globalObject.TypeError(
|
| 113 |
+
"'get animVal' called on an object that is not a valid instance of SVGAnimatedRect."
|
| 114 |
+
);
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
return utils.getSameObject(this, "animVal", () => {
|
| 118 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["animVal"]);
|
| 119 |
+
});
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
Object.defineProperties(SVGAnimatedRect.prototype, {
|
| 123 |
+
baseVal: { enumerable: true },
|
| 124 |
+
animVal: { enumerable: true },
|
| 125 |
+
[Symbol.toStringTag]: { value: "SVGAnimatedRect", configurable: true }
|
| 126 |
+
});
|
| 127 |
+
ctorRegistry[interfaceName] = SVGAnimatedRect;
|
| 128 |
+
|
| 129 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 130 |
+
configurable: true,
|
| 131 |
+
writable: true,
|
| 132 |
+
value: SVGAnimatedRect
|
| 133 |
+
});
|
| 134 |
+
};
|
| 135 |
+
|
| 136 |
+
const Impl = require("../svg/SVGAnimatedRect-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGAnimatedString.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "SVGAnimatedString";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGAnimatedString'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["SVGAnimatedString"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 38 |
+
const wrapper = makeWrapper(globalObject);
|
| 39 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 43 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 44 |
+
return utils.implForWrapper(wrapper);
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 48 |
+
|
| 49 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 50 |
+
privateData.wrapper = wrapper;
|
| 51 |
+
|
| 52 |
+
exports._internalSetup(wrapper, globalObject);
|
| 53 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 54 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 55 |
+
configurable: true
|
| 56 |
+
});
|
| 57 |
+
|
| 58 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 59 |
+
if (Impl.init) {
|
| 60 |
+
Impl.init(wrapper[implSymbol]);
|
| 61 |
+
}
|
| 62 |
+
return wrapper;
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
exports.new = (globalObject, newTarget) => {
|
| 66 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 67 |
+
|
| 68 |
+
exports._internalSetup(wrapper, globalObject);
|
| 69 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 70 |
+
value: Object.create(Impl.implementation.prototype),
|
| 71 |
+
configurable: true
|
| 72 |
+
});
|
| 73 |
+
|
| 74 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 75 |
+
if (Impl.init) {
|
| 76 |
+
Impl.init(wrapper[implSymbol]);
|
| 77 |
+
}
|
| 78 |
+
return wrapper[implSymbol];
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
const exposed = new Set(["Window"]);
|
| 82 |
+
|
| 83 |
+
exports.install = (globalObject, globalNames) => {
|
| 84 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 85 |
+
return;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 89 |
+
class SVGAnimatedString {
|
| 90 |
+
constructor() {
|
| 91 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
get baseVal() {
|
| 95 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 96 |
+
|
| 97 |
+
if (!exports.is(esValue)) {
|
| 98 |
+
throw new globalObject.TypeError(
|
| 99 |
+
"'get baseVal' called on an object that is not a valid instance of SVGAnimatedString."
|
| 100 |
+
);
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
return esValue[implSymbol]["baseVal"];
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
set baseVal(V) {
|
| 107 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 108 |
+
|
| 109 |
+
if (!exports.is(esValue)) {
|
| 110 |
+
throw new globalObject.TypeError(
|
| 111 |
+
"'set baseVal' called on an object that is not a valid instance of SVGAnimatedString."
|
| 112 |
+
);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
V = conversions["DOMString"](V, {
|
| 116 |
+
context: "Failed to set the 'baseVal' property on 'SVGAnimatedString': The provided value",
|
| 117 |
+
globals: globalObject
|
| 118 |
+
});
|
| 119 |
+
|
| 120 |
+
esValue[implSymbol]["baseVal"] = V;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
get animVal() {
|
| 124 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 125 |
+
|
| 126 |
+
if (!exports.is(esValue)) {
|
| 127 |
+
throw new globalObject.TypeError(
|
| 128 |
+
"'get animVal' called on an object that is not a valid instance of SVGAnimatedString."
|
| 129 |
+
);
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
return esValue[implSymbol]["animVal"];
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
Object.defineProperties(SVGAnimatedString.prototype, {
|
| 136 |
+
baseVal: { enumerable: true },
|
| 137 |
+
animVal: { enumerable: true },
|
| 138 |
+
[Symbol.toStringTag]: { value: "SVGAnimatedString", configurable: true }
|
| 139 |
+
});
|
| 140 |
+
ctorRegistry[interfaceName] = SVGAnimatedString;
|
| 141 |
+
|
| 142 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 143 |
+
configurable: true,
|
| 144 |
+
writable: true,
|
| 145 |
+
value: SVGAnimatedString
|
| 146 |
+
});
|
| 147 |
+
};
|
| 148 |
+
|
| 149 |
+
const Impl = require("../svg/SVGAnimatedString-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGBoundingBoxOptions.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
| 7 |
+
{
|
| 8 |
+
const key = "clipped";
|
| 9 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 10 |
+
if (value !== undefined) {
|
| 11 |
+
value = conversions["boolean"](value, { context: context + " has member 'clipped' that", globals: globalObject });
|
| 12 |
+
|
| 13 |
+
ret[key] = value;
|
| 14 |
+
} else {
|
| 15 |
+
ret[key] = false;
|
| 16 |
+
}
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
{
|
| 20 |
+
const key = "fill";
|
| 21 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 22 |
+
if (value !== undefined) {
|
| 23 |
+
value = conversions["boolean"](value, { context: context + " has member 'fill' that", globals: globalObject });
|
| 24 |
+
|
| 25 |
+
ret[key] = value;
|
| 26 |
+
} else {
|
| 27 |
+
ret[key] = true;
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
{
|
| 32 |
+
const key = "markers";
|
| 33 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 34 |
+
if (value !== undefined) {
|
| 35 |
+
value = conversions["boolean"](value, { context: context + " has member 'markers' that", globals: globalObject });
|
| 36 |
+
|
| 37 |
+
ret[key] = value;
|
| 38 |
+
} else {
|
| 39 |
+
ret[key] = false;
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
{
|
| 44 |
+
const key = "stroke";
|
| 45 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 46 |
+
if (value !== undefined) {
|
| 47 |
+
value = conversions["boolean"](value, { context: context + " has member 'stroke' that", globals: globalObject });
|
| 48 |
+
|
| 49 |
+
ret[key] = value;
|
| 50 |
+
} else {
|
| 51 |
+
ret[key] = false;
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
| 57 |
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
| 58 |
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
const ret = Object.create(null);
|
| 62 |
+
exports._convertInherit(globalObject, obj, ret, { context });
|
| 63 |
+
return ret;
|
| 64 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/SVGDefsElement.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
const SVGGraphicsElement = require("./SVGGraphicsElement.js");
|
| 9 |
+
|
| 10 |
+
const interfaceName = "SVGDefsElement";
|
| 11 |
+
|
| 12 |
+
exports.is = value => {
|
| 13 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 14 |
+
};
|
| 15 |
+
exports.isImpl = value => {
|
| 16 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 19 |
+
if (exports.is(value)) {
|
| 20 |
+
return utils.implForWrapper(value);
|
| 21 |
+
}
|
| 22 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGDefsElement'.`);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
function makeWrapper(globalObject, newTarget) {
|
| 26 |
+
let proto;
|
| 27 |
+
if (newTarget !== undefined) {
|
| 28 |
+
proto = newTarget.prototype;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!utils.isObject(proto)) {
|
| 32 |
+
proto = globalObject[ctorRegistrySymbol]["SVGDefsElement"].prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
return Object.create(proto);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 39 |
+
const wrapper = makeWrapper(globalObject);
|
| 40 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 44 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 45 |
+
return utils.implForWrapper(wrapper);
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 49 |
+
SVGGraphicsElement._internalSetup(wrapper, globalObject);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 53 |
+
privateData.wrapper = wrapper;
|
| 54 |
+
|
| 55 |
+
exports._internalSetup(wrapper, globalObject);
|
| 56 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 57 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 58 |
+
configurable: true
|
| 59 |
+
});
|
| 60 |
+
|
| 61 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 62 |
+
if (Impl.init) {
|
| 63 |
+
Impl.init(wrapper[implSymbol]);
|
| 64 |
+
}
|
| 65 |
+
return wrapper;
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports.new = (globalObject, newTarget) => {
|
| 69 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 70 |
+
|
| 71 |
+
exports._internalSetup(wrapper, globalObject);
|
| 72 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 73 |
+
value: Object.create(Impl.implementation.prototype),
|
| 74 |
+
configurable: true
|
| 75 |
+
});
|
| 76 |
+
|
| 77 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 78 |
+
if (Impl.init) {
|
| 79 |
+
Impl.init(wrapper[implSymbol]);
|
| 80 |
+
}
|
| 81 |
+
return wrapper[implSymbol];
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
const exposed = new Set(["Window"]);
|
| 85 |
+
|
| 86 |
+
exports.install = (globalObject, globalNames) => {
|
| 87 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 88 |
+
return;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 92 |
+
class SVGDefsElement extends globalObject.SVGGraphicsElement {
|
| 93 |
+
constructor() {
|
| 94 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
Object.defineProperties(SVGDefsElement.prototype, {
|
| 98 |
+
[Symbol.toStringTag]: { value: "SVGDefsElement", configurable: true }
|
| 99 |
+
});
|
| 100 |
+
ctorRegistry[interfaceName] = SVGDefsElement;
|
| 101 |
+
|
| 102 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 103 |
+
configurable: true,
|
| 104 |
+
writable: true,
|
| 105 |
+
value: SVGDefsElement
|
| 106 |
+
});
|
| 107 |
+
};
|
| 108 |
+
|
| 109 |
+
const Impl = require("../nodes/SVGDefsElement-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGDescElement.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
const SVGElement = require("./SVGElement.js");
|
| 9 |
+
|
| 10 |
+
const interfaceName = "SVGDescElement";
|
| 11 |
+
|
| 12 |
+
exports.is = value => {
|
| 13 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 14 |
+
};
|
| 15 |
+
exports.isImpl = value => {
|
| 16 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 19 |
+
if (exports.is(value)) {
|
| 20 |
+
return utils.implForWrapper(value);
|
| 21 |
+
}
|
| 22 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGDescElement'.`);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
function makeWrapper(globalObject, newTarget) {
|
| 26 |
+
let proto;
|
| 27 |
+
if (newTarget !== undefined) {
|
| 28 |
+
proto = newTarget.prototype;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!utils.isObject(proto)) {
|
| 32 |
+
proto = globalObject[ctorRegistrySymbol]["SVGDescElement"].prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
return Object.create(proto);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 39 |
+
const wrapper = makeWrapper(globalObject);
|
| 40 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 44 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 45 |
+
return utils.implForWrapper(wrapper);
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 49 |
+
SVGElement._internalSetup(wrapper, globalObject);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 53 |
+
privateData.wrapper = wrapper;
|
| 54 |
+
|
| 55 |
+
exports._internalSetup(wrapper, globalObject);
|
| 56 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 57 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 58 |
+
configurable: true
|
| 59 |
+
});
|
| 60 |
+
|
| 61 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 62 |
+
if (Impl.init) {
|
| 63 |
+
Impl.init(wrapper[implSymbol]);
|
| 64 |
+
}
|
| 65 |
+
return wrapper;
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports.new = (globalObject, newTarget) => {
|
| 69 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 70 |
+
|
| 71 |
+
exports._internalSetup(wrapper, globalObject);
|
| 72 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 73 |
+
value: Object.create(Impl.implementation.prototype),
|
| 74 |
+
configurable: true
|
| 75 |
+
});
|
| 76 |
+
|
| 77 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 78 |
+
if (Impl.init) {
|
| 79 |
+
Impl.init(wrapper[implSymbol]);
|
| 80 |
+
}
|
| 81 |
+
return wrapper[implSymbol];
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
const exposed = new Set(["Window"]);
|
| 85 |
+
|
| 86 |
+
exports.install = (globalObject, globalNames) => {
|
| 87 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 88 |
+
return;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 92 |
+
class SVGDescElement extends globalObject.SVGElement {
|
| 93 |
+
constructor() {
|
| 94 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
Object.defineProperties(SVGDescElement.prototype, {
|
| 98 |
+
[Symbol.toStringTag]: { value: "SVGDescElement", configurable: true }
|
| 99 |
+
});
|
| 100 |
+
ctorRegistry[interfaceName] = SVGDescElement;
|
| 101 |
+
|
| 102 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 103 |
+
configurable: true,
|
| 104 |
+
writable: true,
|
| 105 |
+
value: SVGDescElement
|
| 106 |
+
});
|
| 107 |
+
};
|
| 108 |
+
|
| 109 |
+
const Impl = require("../nodes/SVGDescElement-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGElement.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
node_modules/jsdom/lib/jsdom/living/generated/SVGGElement.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
const SVGGraphicsElement = require("./SVGGraphicsElement.js");
|
| 9 |
+
|
| 10 |
+
const interfaceName = "SVGGElement";
|
| 11 |
+
|
| 12 |
+
exports.is = value => {
|
| 13 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 14 |
+
};
|
| 15 |
+
exports.isImpl = value => {
|
| 16 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 19 |
+
if (exports.is(value)) {
|
| 20 |
+
return utils.implForWrapper(value);
|
| 21 |
+
}
|
| 22 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGGElement'.`);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
function makeWrapper(globalObject, newTarget) {
|
| 26 |
+
let proto;
|
| 27 |
+
if (newTarget !== undefined) {
|
| 28 |
+
proto = newTarget.prototype;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!utils.isObject(proto)) {
|
| 32 |
+
proto = globalObject[ctorRegistrySymbol]["SVGGElement"].prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
return Object.create(proto);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 39 |
+
const wrapper = makeWrapper(globalObject);
|
| 40 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 44 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 45 |
+
return utils.implForWrapper(wrapper);
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 49 |
+
SVGGraphicsElement._internalSetup(wrapper, globalObject);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 53 |
+
privateData.wrapper = wrapper;
|
| 54 |
+
|
| 55 |
+
exports._internalSetup(wrapper, globalObject);
|
| 56 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 57 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 58 |
+
configurable: true
|
| 59 |
+
});
|
| 60 |
+
|
| 61 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 62 |
+
if (Impl.init) {
|
| 63 |
+
Impl.init(wrapper[implSymbol]);
|
| 64 |
+
}
|
| 65 |
+
return wrapper;
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports.new = (globalObject, newTarget) => {
|
| 69 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 70 |
+
|
| 71 |
+
exports._internalSetup(wrapper, globalObject);
|
| 72 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 73 |
+
value: Object.create(Impl.implementation.prototype),
|
| 74 |
+
configurable: true
|
| 75 |
+
});
|
| 76 |
+
|
| 77 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 78 |
+
if (Impl.init) {
|
| 79 |
+
Impl.init(wrapper[implSymbol]);
|
| 80 |
+
}
|
| 81 |
+
return wrapper[implSymbol];
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
const exposed = new Set(["Window"]);
|
| 85 |
+
|
| 86 |
+
exports.install = (globalObject, globalNames) => {
|
| 87 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 88 |
+
return;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 92 |
+
class SVGGElement extends globalObject.SVGGraphicsElement {
|
| 93 |
+
constructor() {
|
| 94 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
Object.defineProperties(SVGGElement.prototype, {
|
| 98 |
+
[Symbol.toStringTag]: { value: "SVGGElement", configurable: true }
|
| 99 |
+
});
|
| 100 |
+
ctorRegistry[interfaceName] = SVGGElement;
|
| 101 |
+
|
| 102 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 103 |
+
configurable: true,
|
| 104 |
+
writable: true,
|
| 105 |
+
value: SVGGElement
|
| 106 |
+
});
|
| 107 |
+
};
|
| 108 |
+
|
| 109 |
+
const Impl = require("../nodes/SVGGElement-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGGraphicsElement.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
const SVGElement = require("./SVGElement.js");
|
| 9 |
+
|
| 10 |
+
const interfaceName = "SVGGraphicsElement";
|
| 11 |
+
|
| 12 |
+
exports.is = value => {
|
| 13 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 14 |
+
};
|
| 15 |
+
exports.isImpl = value => {
|
| 16 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 19 |
+
if (exports.is(value)) {
|
| 20 |
+
return utils.implForWrapper(value);
|
| 21 |
+
}
|
| 22 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGGraphicsElement'.`);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
function makeWrapper(globalObject, newTarget) {
|
| 26 |
+
let proto;
|
| 27 |
+
if (newTarget !== undefined) {
|
| 28 |
+
proto = newTarget.prototype;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!utils.isObject(proto)) {
|
| 32 |
+
proto = globalObject[ctorRegistrySymbol]["SVGGraphicsElement"].prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
return Object.create(proto);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 39 |
+
const wrapper = makeWrapper(globalObject);
|
| 40 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 44 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 45 |
+
return utils.implForWrapper(wrapper);
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 49 |
+
SVGElement._internalSetup(wrapper, globalObject);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 53 |
+
privateData.wrapper = wrapper;
|
| 54 |
+
|
| 55 |
+
exports._internalSetup(wrapper, globalObject);
|
| 56 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 57 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 58 |
+
configurable: true
|
| 59 |
+
});
|
| 60 |
+
|
| 61 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 62 |
+
if (Impl.init) {
|
| 63 |
+
Impl.init(wrapper[implSymbol]);
|
| 64 |
+
}
|
| 65 |
+
return wrapper;
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports.new = (globalObject, newTarget) => {
|
| 69 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 70 |
+
|
| 71 |
+
exports._internalSetup(wrapper, globalObject);
|
| 72 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 73 |
+
value: Object.create(Impl.implementation.prototype),
|
| 74 |
+
configurable: true
|
| 75 |
+
});
|
| 76 |
+
|
| 77 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 78 |
+
if (Impl.init) {
|
| 79 |
+
Impl.init(wrapper[implSymbol]);
|
| 80 |
+
}
|
| 81 |
+
return wrapper[implSymbol];
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
const exposed = new Set(["Window"]);
|
| 85 |
+
|
| 86 |
+
exports.install = (globalObject, globalNames) => {
|
| 87 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 88 |
+
return;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 92 |
+
class SVGGraphicsElement extends globalObject.SVGElement {
|
| 93 |
+
constructor() {
|
| 94 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
get requiredExtensions() {
|
| 98 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 99 |
+
|
| 100 |
+
if (!exports.is(esValue)) {
|
| 101 |
+
throw new globalObject.TypeError(
|
| 102 |
+
"'get requiredExtensions' called on an object that is not a valid instance of SVGGraphicsElement."
|
| 103 |
+
);
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
return utils.getSameObject(this, "requiredExtensions", () => {
|
| 107 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["requiredExtensions"]);
|
| 108 |
+
});
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
get systemLanguage() {
|
| 112 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 113 |
+
|
| 114 |
+
if (!exports.is(esValue)) {
|
| 115 |
+
throw new globalObject.TypeError(
|
| 116 |
+
"'get systemLanguage' called on an object that is not a valid instance of SVGGraphicsElement."
|
| 117 |
+
);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
return utils.getSameObject(this, "systemLanguage", () => {
|
| 121 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["systemLanguage"]);
|
| 122 |
+
});
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
Object.defineProperties(SVGGraphicsElement.prototype, {
|
| 126 |
+
requiredExtensions: { enumerable: true },
|
| 127 |
+
systemLanguage: { enumerable: true },
|
| 128 |
+
[Symbol.toStringTag]: { value: "SVGGraphicsElement", configurable: true }
|
| 129 |
+
});
|
| 130 |
+
ctorRegistry[interfaceName] = SVGGraphicsElement;
|
| 131 |
+
|
| 132 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 133 |
+
configurable: true,
|
| 134 |
+
writable: true,
|
| 135 |
+
value: SVGGraphicsElement
|
| 136 |
+
});
|
| 137 |
+
};
|
| 138 |
+
|
| 139 |
+
const Impl = require("../nodes/SVGGraphicsElement-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGMetadataElement.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
const SVGElement = require("./SVGElement.js");
|
| 9 |
+
|
| 10 |
+
const interfaceName = "SVGMetadataElement";
|
| 11 |
+
|
| 12 |
+
exports.is = value => {
|
| 13 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 14 |
+
};
|
| 15 |
+
exports.isImpl = value => {
|
| 16 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 19 |
+
if (exports.is(value)) {
|
| 20 |
+
return utils.implForWrapper(value);
|
| 21 |
+
}
|
| 22 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGMetadataElement'.`);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
function makeWrapper(globalObject, newTarget) {
|
| 26 |
+
let proto;
|
| 27 |
+
if (newTarget !== undefined) {
|
| 28 |
+
proto = newTarget.prototype;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!utils.isObject(proto)) {
|
| 32 |
+
proto = globalObject[ctorRegistrySymbol]["SVGMetadataElement"].prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
return Object.create(proto);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 39 |
+
const wrapper = makeWrapper(globalObject);
|
| 40 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 44 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 45 |
+
return utils.implForWrapper(wrapper);
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 49 |
+
SVGElement._internalSetup(wrapper, globalObject);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 53 |
+
privateData.wrapper = wrapper;
|
| 54 |
+
|
| 55 |
+
exports._internalSetup(wrapper, globalObject);
|
| 56 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 57 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 58 |
+
configurable: true
|
| 59 |
+
});
|
| 60 |
+
|
| 61 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 62 |
+
if (Impl.init) {
|
| 63 |
+
Impl.init(wrapper[implSymbol]);
|
| 64 |
+
}
|
| 65 |
+
return wrapper;
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports.new = (globalObject, newTarget) => {
|
| 69 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 70 |
+
|
| 71 |
+
exports._internalSetup(wrapper, globalObject);
|
| 72 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 73 |
+
value: Object.create(Impl.implementation.prototype),
|
| 74 |
+
configurable: true
|
| 75 |
+
});
|
| 76 |
+
|
| 77 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 78 |
+
if (Impl.init) {
|
| 79 |
+
Impl.init(wrapper[implSymbol]);
|
| 80 |
+
}
|
| 81 |
+
return wrapper[implSymbol];
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
const exposed = new Set(["Window"]);
|
| 85 |
+
|
| 86 |
+
exports.install = (globalObject, globalNames) => {
|
| 87 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 88 |
+
return;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 92 |
+
class SVGMetadataElement extends globalObject.SVGElement {
|
| 93 |
+
constructor() {
|
| 94 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
Object.defineProperties(SVGMetadataElement.prototype, {
|
| 98 |
+
[Symbol.toStringTag]: { value: "SVGMetadataElement", configurable: true }
|
| 99 |
+
});
|
| 100 |
+
ctorRegistry[interfaceName] = SVGMetadataElement;
|
| 101 |
+
|
| 102 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 103 |
+
configurable: true,
|
| 104 |
+
writable: true,
|
| 105 |
+
value: SVGMetadataElement
|
| 106 |
+
});
|
| 107 |
+
};
|
| 108 |
+
|
| 109 |
+
const Impl = require("../nodes/SVGMetadataElement-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGNumber.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "SVGNumber";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGNumber'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["SVGNumber"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 38 |
+
const wrapper = makeWrapper(globalObject);
|
| 39 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 43 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 44 |
+
return utils.implForWrapper(wrapper);
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 48 |
+
|
| 49 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 50 |
+
privateData.wrapper = wrapper;
|
| 51 |
+
|
| 52 |
+
exports._internalSetup(wrapper, globalObject);
|
| 53 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 54 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 55 |
+
configurable: true
|
| 56 |
+
});
|
| 57 |
+
|
| 58 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 59 |
+
if (Impl.init) {
|
| 60 |
+
Impl.init(wrapper[implSymbol]);
|
| 61 |
+
}
|
| 62 |
+
return wrapper;
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
exports.new = (globalObject, newTarget) => {
|
| 66 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 67 |
+
|
| 68 |
+
exports._internalSetup(wrapper, globalObject);
|
| 69 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 70 |
+
value: Object.create(Impl.implementation.prototype),
|
| 71 |
+
configurable: true
|
| 72 |
+
});
|
| 73 |
+
|
| 74 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 75 |
+
if (Impl.init) {
|
| 76 |
+
Impl.init(wrapper[implSymbol]);
|
| 77 |
+
}
|
| 78 |
+
return wrapper[implSymbol];
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
const exposed = new Set(["Window"]);
|
| 82 |
+
|
| 83 |
+
exports.install = (globalObject, globalNames) => {
|
| 84 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 85 |
+
return;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 89 |
+
class SVGNumber {
|
| 90 |
+
constructor() {
|
| 91 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
get value() {
|
| 95 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 96 |
+
|
| 97 |
+
if (!exports.is(esValue)) {
|
| 98 |
+
throw new globalObject.TypeError("'get value' called on an object that is not a valid instance of SVGNumber.");
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
return esValue[implSymbol]["value"];
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
set value(V) {
|
| 105 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 106 |
+
|
| 107 |
+
if (!exports.is(esValue)) {
|
| 108 |
+
throw new globalObject.TypeError("'set value' called on an object that is not a valid instance of SVGNumber.");
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
V = conversions["float"](V, {
|
| 112 |
+
context: "Failed to set the 'value' property on 'SVGNumber': The provided value",
|
| 113 |
+
globals: globalObject
|
| 114 |
+
});
|
| 115 |
+
|
| 116 |
+
esValue[implSymbol]["value"] = V;
|
| 117 |
+
}
|
| 118 |
+
}
|
| 119 |
+
Object.defineProperties(SVGNumber.prototype, {
|
| 120 |
+
value: { enumerable: true },
|
| 121 |
+
[Symbol.toStringTag]: { value: "SVGNumber", configurable: true }
|
| 122 |
+
});
|
| 123 |
+
ctorRegistry[interfaceName] = SVGNumber;
|
| 124 |
+
|
| 125 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 126 |
+
configurable: true,
|
| 127 |
+
writable: true,
|
| 128 |
+
value: SVGNumber
|
| 129 |
+
});
|
| 130 |
+
};
|
| 131 |
+
|
| 132 |
+
const Impl = require("../svg/SVGNumber-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGPreserveAspectRatio.js
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "SVGPreserveAspectRatio";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGPreserveAspectRatio'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["SVGPreserveAspectRatio"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 38 |
+
const wrapper = makeWrapper(globalObject);
|
| 39 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 43 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 44 |
+
return utils.implForWrapper(wrapper);
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 48 |
+
|
| 49 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 50 |
+
privateData.wrapper = wrapper;
|
| 51 |
+
|
| 52 |
+
exports._internalSetup(wrapper, globalObject);
|
| 53 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 54 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 55 |
+
configurable: true
|
| 56 |
+
});
|
| 57 |
+
|
| 58 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 59 |
+
if (Impl.init) {
|
| 60 |
+
Impl.init(wrapper[implSymbol]);
|
| 61 |
+
}
|
| 62 |
+
return wrapper;
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
exports.new = (globalObject, newTarget) => {
|
| 66 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 67 |
+
|
| 68 |
+
exports._internalSetup(wrapper, globalObject);
|
| 69 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 70 |
+
value: Object.create(Impl.implementation.prototype),
|
| 71 |
+
configurable: true
|
| 72 |
+
});
|
| 73 |
+
|
| 74 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 75 |
+
if (Impl.init) {
|
| 76 |
+
Impl.init(wrapper[implSymbol]);
|
| 77 |
+
}
|
| 78 |
+
return wrapper[implSymbol];
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
const exposed = new Set(["Window"]);
|
| 82 |
+
|
| 83 |
+
exports.install = (globalObject, globalNames) => {
|
| 84 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 85 |
+
return;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 89 |
+
class SVGPreserveAspectRatio {
|
| 90 |
+
constructor() {
|
| 91 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
get align() {
|
| 95 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 96 |
+
|
| 97 |
+
if (!exports.is(esValue)) {
|
| 98 |
+
throw new globalObject.TypeError(
|
| 99 |
+
"'get align' called on an object that is not a valid instance of SVGPreserveAspectRatio."
|
| 100 |
+
);
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
return esValue[implSymbol]["align"];
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
set align(V) {
|
| 107 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 108 |
+
|
| 109 |
+
if (!exports.is(esValue)) {
|
| 110 |
+
throw new globalObject.TypeError(
|
| 111 |
+
"'set align' called on an object that is not a valid instance of SVGPreserveAspectRatio."
|
| 112 |
+
);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
V = conversions["unsigned short"](V, {
|
| 116 |
+
context: "Failed to set the 'align' property on 'SVGPreserveAspectRatio': The provided value",
|
| 117 |
+
globals: globalObject
|
| 118 |
+
});
|
| 119 |
+
|
| 120 |
+
esValue[implSymbol]["align"] = V;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
get meetOrSlice() {
|
| 124 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 125 |
+
|
| 126 |
+
if (!exports.is(esValue)) {
|
| 127 |
+
throw new globalObject.TypeError(
|
| 128 |
+
"'get meetOrSlice' called on an object that is not a valid instance of SVGPreserveAspectRatio."
|
| 129 |
+
);
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
return esValue[implSymbol]["meetOrSlice"];
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
set meetOrSlice(V) {
|
| 136 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 137 |
+
|
| 138 |
+
if (!exports.is(esValue)) {
|
| 139 |
+
throw new globalObject.TypeError(
|
| 140 |
+
"'set meetOrSlice' called on an object that is not a valid instance of SVGPreserveAspectRatio."
|
| 141 |
+
);
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
V = conversions["unsigned short"](V, {
|
| 145 |
+
context: "Failed to set the 'meetOrSlice' property on 'SVGPreserveAspectRatio': The provided value",
|
| 146 |
+
globals: globalObject
|
| 147 |
+
});
|
| 148 |
+
|
| 149 |
+
esValue[implSymbol]["meetOrSlice"] = V;
|
| 150 |
+
}
|
| 151 |
+
}
|
| 152 |
+
Object.defineProperties(SVGPreserveAspectRatio.prototype, {
|
| 153 |
+
align: { enumerable: true },
|
| 154 |
+
meetOrSlice: { enumerable: true },
|
| 155 |
+
[Symbol.toStringTag]: { value: "SVGPreserveAspectRatio", configurable: true },
|
| 156 |
+
SVG_PRESERVEASPECTRATIO_UNKNOWN: { value: 0, enumerable: true },
|
| 157 |
+
SVG_PRESERVEASPECTRATIO_NONE: { value: 1, enumerable: true },
|
| 158 |
+
SVG_PRESERVEASPECTRATIO_XMINYMIN: { value: 2, enumerable: true },
|
| 159 |
+
SVG_PRESERVEASPECTRATIO_XMIDYMIN: { value: 3, enumerable: true },
|
| 160 |
+
SVG_PRESERVEASPECTRATIO_XMAXYMIN: { value: 4, enumerable: true },
|
| 161 |
+
SVG_PRESERVEASPECTRATIO_XMINYMID: { value: 5, enumerable: true },
|
| 162 |
+
SVG_PRESERVEASPECTRATIO_XMIDYMID: { value: 6, enumerable: true },
|
| 163 |
+
SVG_PRESERVEASPECTRATIO_XMAXYMID: { value: 7, enumerable: true },
|
| 164 |
+
SVG_PRESERVEASPECTRATIO_XMINYMAX: { value: 8, enumerable: true },
|
| 165 |
+
SVG_PRESERVEASPECTRATIO_XMIDYMAX: { value: 9, enumerable: true },
|
| 166 |
+
SVG_PRESERVEASPECTRATIO_XMAXYMAX: { value: 10, enumerable: true },
|
| 167 |
+
SVG_MEETORSLICE_UNKNOWN: { value: 0, enumerable: true },
|
| 168 |
+
SVG_MEETORSLICE_MEET: { value: 1, enumerable: true },
|
| 169 |
+
SVG_MEETORSLICE_SLICE: { value: 2, enumerable: true }
|
| 170 |
+
});
|
| 171 |
+
Object.defineProperties(SVGPreserveAspectRatio, {
|
| 172 |
+
SVG_PRESERVEASPECTRATIO_UNKNOWN: { value: 0, enumerable: true },
|
| 173 |
+
SVG_PRESERVEASPECTRATIO_NONE: { value: 1, enumerable: true },
|
| 174 |
+
SVG_PRESERVEASPECTRATIO_XMINYMIN: { value: 2, enumerable: true },
|
| 175 |
+
SVG_PRESERVEASPECTRATIO_XMIDYMIN: { value: 3, enumerable: true },
|
| 176 |
+
SVG_PRESERVEASPECTRATIO_XMAXYMIN: { value: 4, enumerable: true },
|
| 177 |
+
SVG_PRESERVEASPECTRATIO_XMINYMID: { value: 5, enumerable: true },
|
| 178 |
+
SVG_PRESERVEASPECTRATIO_XMIDYMID: { value: 6, enumerable: true },
|
| 179 |
+
SVG_PRESERVEASPECTRATIO_XMAXYMID: { value: 7, enumerable: true },
|
| 180 |
+
SVG_PRESERVEASPECTRATIO_XMINYMAX: { value: 8, enumerable: true },
|
| 181 |
+
SVG_PRESERVEASPECTRATIO_XMIDYMAX: { value: 9, enumerable: true },
|
| 182 |
+
SVG_PRESERVEASPECTRATIO_XMAXYMAX: { value: 10, enumerable: true },
|
| 183 |
+
SVG_MEETORSLICE_UNKNOWN: { value: 0, enumerable: true },
|
| 184 |
+
SVG_MEETORSLICE_MEET: { value: 1, enumerable: true },
|
| 185 |
+
SVG_MEETORSLICE_SLICE: { value: 2, enumerable: true }
|
| 186 |
+
});
|
| 187 |
+
ctorRegistry[interfaceName] = SVGPreserveAspectRatio;
|
| 188 |
+
|
| 189 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 190 |
+
configurable: true,
|
| 191 |
+
writable: true,
|
| 192 |
+
value: SVGPreserveAspectRatio
|
| 193 |
+
});
|
| 194 |
+
};
|
| 195 |
+
|
| 196 |
+
const Impl = require("../svg/SVGPreserveAspectRatio-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGRect.js
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "SVGRect";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGRect'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["SVGRect"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 38 |
+
const wrapper = makeWrapper(globalObject);
|
| 39 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 43 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 44 |
+
return utils.implForWrapper(wrapper);
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 48 |
+
|
| 49 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 50 |
+
privateData.wrapper = wrapper;
|
| 51 |
+
|
| 52 |
+
exports._internalSetup(wrapper, globalObject);
|
| 53 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 54 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 55 |
+
configurable: true
|
| 56 |
+
});
|
| 57 |
+
|
| 58 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 59 |
+
if (Impl.init) {
|
| 60 |
+
Impl.init(wrapper[implSymbol]);
|
| 61 |
+
}
|
| 62 |
+
return wrapper;
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
exports.new = (globalObject, newTarget) => {
|
| 66 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 67 |
+
|
| 68 |
+
exports._internalSetup(wrapper, globalObject);
|
| 69 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 70 |
+
value: Object.create(Impl.implementation.prototype),
|
| 71 |
+
configurable: true
|
| 72 |
+
});
|
| 73 |
+
|
| 74 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 75 |
+
if (Impl.init) {
|
| 76 |
+
Impl.init(wrapper[implSymbol]);
|
| 77 |
+
}
|
| 78 |
+
return wrapper[implSymbol];
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
const exposed = new Set(["Window"]);
|
| 82 |
+
|
| 83 |
+
exports.install = (globalObject, globalNames) => {
|
| 84 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 85 |
+
return;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 89 |
+
class SVGRect {
|
| 90 |
+
constructor() {
|
| 91 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
get x() {
|
| 95 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 96 |
+
|
| 97 |
+
if (!exports.is(esValue)) {
|
| 98 |
+
throw new globalObject.TypeError("'get x' called on an object that is not a valid instance of SVGRect.");
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
return esValue[implSymbol]["x"];
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
set x(V) {
|
| 105 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 106 |
+
|
| 107 |
+
if (!exports.is(esValue)) {
|
| 108 |
+
throw new globalObject.TypeError("'set x' called on an object that is not a valid instance of SVGRect.");
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
V = conversions["float"](V, {
|
| 112 |
+
context: "Failed to set the 'x' property on 'SVGRect': The provided value",
|
| 113 |
+
globals: globalObject
|
| 114 |
+
});
|
| 115 |
+
|
| 116 |
+
esValue[implSymbol]["x"] = V;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
get y() {
|
| 120 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 121 |
+
|
| 122 |
+
if (!exports.is(esValue)) {
|
| 123 |
+
throw new globalObject.TypeError("'get y' called on an object that is not a valid instance of SVGRect.");
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
return esValue[implSymbol]["y"];
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
set y(V) {
|
| 130 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 131 |
+
|
| 132 |
+
if (!exports.is(esValue)) {
|
| 133 |
+
throw new globalObject.TypeError("'set y' called on an object that is not a valid instance of SVGRect.");
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
V = conversions["float"](V, {
|
| 137 |
+
context: "Failed to set the 'y' property on 'SVGRect': The provided value",
|
| 138 |
+
globals: globalObject
|
| 139 |
+
});
|
| 140 |
+
|
| 141 |
+
esValue[implSymbol]["y"] = V;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
get width() {
|
| 145 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 146 |
+
|
| 147 |
+
if (!exports.is(esValue)) {
|
| 148 |
+
throw new globalObject.TypeError("'get width' called on an object that is not a valid instance of SVGRect.");
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
return esValue[implSymbol]["width"];
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
set width(V) {
|
| 155 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 156 |
+
|
| 157 |
+
if (!exports.is(esValue)) {
|
| 158 |
+
throw new globalObject.TypeError("'set width' called on an object that is not a valid instance of SVGRect.");
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
V = conversions["float"](V, {
|
| 162 |
+
context: "Failed to set the 'width' property on 'SVGRect': The provided value",
|
| 163 |
+
globals: globalObject
|
| 164 |
+
});
|
| 165 |
+
|
| 166 |
+
esValue[implSymbol]["width"] = V;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
get height() {
|
| 170 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 171 |
+
|
| 172 |
+
if (!exports.is(esValue)) {
|
| 173 |
+
throw new globalObject.TypeError("'get height' called on an object that is not a valid instance of SVGRect.");
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
return esValue[implSymbol]["height"];
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
set height(V) {
|
| 180 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 181 |
+
|
| 182 |
+
if (!exports.is(esValue)) {
|
| 183 |
+
throw new globalObject.TypeError("'set height' called on an object that is not a valid instance of SVGRect.");
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
V = conversions["float"](V, {
|
| 187 |
+
context: "Failed to set the 'height' property on 'SVGRect': The provided value",
|
| 188 |
+
globals: globalObject
|
| 189 |
+
});
|
| 190 |
+
|
| 191 |
+
esValue[implSymbol]["height"] = V;
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
Object.defineProperties(SVGRect.prototype, {
|
| 195 |
+
x: { enumerable: true },
|
| 196 |
+
y: { enumerable: true },
|
| 197 |
+
width: { enumerable: true },
|
| 198 |
+
height: { enumerable: true },
|
| 199 |
+
[Symbol.toStringTag]: { value: "SVGRect", configurable: true }
|
| 200 |
+
});
|
| 201 |
+
ctorRegistry[interfaceName] = SVGRect;
|
| 202 |
+
|
| 203 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 204 |
+
configurable: true,
|
| 205 |
+
writable: true,
|
| 206 |
+
value: SVGRect
|
| 207 |
+
});
|
| 208 |
+
};
|
| 209 |
+
|
| 210 |
+
const Impl = require("../svg/SVGRect-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGSVGElement.js
ADDED
|
@@ -0,0 +1,786 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const create_SVGAnimatedRect = require("./SVGAnimatedRect.js").create;
|
| 7 |
+
const create_SVGAnimatedPreserveAspectRatio = require("./SVGAnimatedPreserveAspectRatio.js").create;
|
| 8 |
+
const EventHandlerNonNull = require("./EventHandlerNonNull.js");
|
| 9 |
+
const OnBeforeUnloadEventHandlerNonNull = require("./OnBeforeUnloadEventHandlerNonNull.js");
|
| 10 |
+
const implSymbol = utils.implSymbol;
|
| 11 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 12 |
+
const SVGGraphicsElement = require("./SVGGraphicsElement.js");
|
| 13 |
+
|
| 14 |
+
const interfaceName = "SVGSVGElement";
|
| 15 |
+
|
| 16 |
+
exports.is = value => {
|
| 17 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 18 |
+
};
|
| 19 |
+
exports.isImpl = value => {
|
| 20 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 21 |
+
};
|
| 22 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 23 |
+
if (exports.is(value)) {
|
| 24 |
+
return utils.implForWrapper(value);
|
| 25 |
+
}
|
| 26 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGSVGElement'.`);
|
| 27 |
+
};
|
| 28 |
+
|
| 29 |
+
function makeWrapper(globalObject, newTarget) {
|
| 30 |
+
let proto;
|
| 31 |
+
if (newTarget !== undefined) {
|
| 32 |
+
proto = newTarget.prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
if (!utils.isObject(proto)) {
|
| 36 |
+
proto = globalObject[ctorRegistrySymbol]["SVGSVGElement"].prototype;
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
return Object.create(proto);
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 43 |
+
const wrapper = makeWrapper(globalObject);
|
| 44 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 48 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 49 |
+
return utils.implForWrapper(wrapper);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 53 |
+
SVGGraphicsElement._internalSetup(wrapper, globalObject);
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 57 |
+
privateData.wrapper = wrapper;
|
| 58 |
+
|
| 59 |
+
exports._internalSetup(wrapper, globalObject);
|
| 60 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 61 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 62 |
+
configurable: true
|
| 63 |
+
});
|
| 64 |
+
|
| 65 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 66 |
+
if (Impl.init) {
|
| 67 |
+
Impl.init(wrapper[implSymbol]);
|
| 68 |
+
}
|
| 69 |
+
return wrapper;
|
| 70 |
+
};
|
| 71 |
+
|
| 72 |
+
exports.new = (globalObject, newTarget) => {
|
| 73 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 74 |
+
|
| 75 |
+
exports._internalSetup(wrapper, globalObject);
|
| 76 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 77 |
+
value: Object.create(Impl.implementation.prototype),
|
| 78 |
+
configurable: true
|
| 79 |
+
});
|
| 80 |
+
|
| 81 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 82 |
+
if (Impl.init) {
|
| 83 |
+
Impl.init(wrapper[implSymbol]);
|
| 84 |
+
}
|
| 85 |
+
return wrapper[implSymbol];
|
| 86 |
+
};
|
| 87 |
+
|
| 88 |
+
const exposed = new Set(["Window"]);
|
| 89 |
+
|
| 90 |
+
exports.install = (globalObject, globalNames) => {
|
| 91 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 92 |
+
return;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 96 |
+
class SVGSVGElement extends globalObject.SVGGraphicsElement {
|
| 97 |
+
constructor() {
|
| 98 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
createSVGNumber() {
|
| 102 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 103 |
+
if (!exports.is(esValue)) {
|
| 104 |
+
throw new globalObject.TypeError(
|
| 105 |
+
"'createSVGNumber' called on an object that is not a valid instance of SVGSVGElement."
|
| 106 |
+
);
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].createSVGNumber());
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
createSVGRect() {
|
| 113 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 114 |
+
if (!exports.is(esValue)) {
|
| 115 |
+
throw new globalObject.TypeError(
|
| 116 |
+
"'createSVGRect' called on an object that is not a valid instance of SVGSVGElement."
|
| 117 |
+
);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].createSVGRect());
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
getElementById(elementId) {
|
| 124 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 125 |
+
if (!exports.is(esValue)) {
|
| 126 |
+
throw new globalObject.TypeError(
|
| 127 |
+
"'getElementById' called on an object that is not a valid instance of SVGSVGElement."
|
| 128 |
+
);
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
if (arguments.length < 1) {
|
| 132 |
+
throw new globalObject.TypeError(
|
| 133 |
+
`Failed to execute 'getElementById' on 'SVGSVGElement': 1 argument required, but only ${arguments.length} present.`
|
| 134 |
+
);
|
| 135 |
+
}
|
| 136 |
+
const args = [];
|
| 137 |
+
{
|
| 138 |
+
let curArg = arguments[0];
|
| 139 |
+
curArg = conversions["DOMString"](curArg, {
|
| 140 |
+
context: "Failed to execute 'getElementById' on 'SVGSVGElement': parameter 1",
|
| 141 |
+
globals: globalObject
|
| 142 |
+
});
|
| 143 |
+
args.push(curArg);
|
| 144 |
+
}
|
| 145 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].getElementById(...args));
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
suspendRedraw(maxWaitMilliseconds) {
|
| 149 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 150 |
+
if (!exports.is(esValue)) {
|
| 151 |
+
throw new globalObject.TypeError(
|
| 152 |
+
"'suspendRedraw' called on an object that is not a valid instance of SVGSVGElement."
|
| 153 |
+
);
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
if (arguments.length < 1) {
|
| 157 |
+
throw new globalObject.TypeError(
|
| 158 |
+
`Failed to execute 'suspendRedraw' on 'SVGSVGElement': 1 argument required, but only ${arguments.length} present.`
|
| 159 |
+
);
|
| 160 |
+
}
|
| 161 |
+
const args = [];
|
| 162 |
+
{
|
| 163 |
+
let curArg = arguments[0];
|
| 164 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 165 |
+
context: "Failed to execute 'suspendRedraw' on 'SVGSVGElement': parameter 1",
|
| 166 |
+
globals: globalObject
|
| 167 |
+
});
|
| 168 |
+
args.push(curArg);
|
| 169 |
+
}
|
| 170 |
+
return esValue[implSymbol].suspendRedraw(...args);
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
unsuspendRedraw(suspendHandleID) {
|
| 174 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 175 |
+
if (!exports.is(esValue)) {
|
| 176 |
+
throw new globalObject.TypeError(
|
| 177 |
+
"'unsuspendRedraw' called on an object that is not a valid instance of SVGSVGElement."
|
| 178 |
+
);
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
if (arguments.length < 1) {
|
| 182 |
+
throw new globalObject.TypeError(
|
| 183 |
+
`Failed to execute 'unsuspendRedraw' on 'SVGSVGElement': 1 argument required, but only ${arguments.length} present.`
|
| 184 |
+
);
|
| 185 |
+
}
|
| 186 |
+
const args = [];
|
| 187 |
+
{
|
| 188 |
+
let curArg = arguments[0];
|
| 189 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 190 |
+
context: "Failed to execute 'unsuspendRedraw' on 'SVGSVGElement': parameter 1",
|
| 191 |
+
globals: globalObject
|
| 192 |
+
});
|
| 193 |
+
args.push(curArg);
|
| 194 |
+
}
|
| 195 |
+
return esValue[implSymbol].unsuspendRedraw(...args);
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
unsuspendRedrawAll() {
|
| 199 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 200 |
+
if (!exports.is(esValue)) {
|
| 201 |
+
throw new globalObject.TypeError(
|
| 202 |
+
"'unsuspendRedrawAll' called on an object that is not a valid instance of SVGSVGElement."
|
| 203 |
+
);
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
return esValue[implSymbol].unsuspendRedrawAll();
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
forceRedraw() {
|
| 210 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 211 |
+
if (!exports.is(esValue)) {
|
| 212 |
+
throw new globalObject.TypeError(
|
| 213 |
+
"'forceRedraw' called on an object that is not a valid instance of SVGSVGElement."
|
| 214 |
+
);
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
return esValue[implSymbol].forceRedraw();
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
get viewBox() {
|
| 221 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 222 |
+
|
| 223 |
+
if (!exports.is(esValue)) {
|
| 224 |
+
throw new globalObject.TypeError(
|
| 225 |
+
"'get viewBox' called on an object that is not a valid instance of SVGSVGElement."
|
| 226 |
+
);
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
return utils.getSameObject(this, "viewBox", () => {
|
| 230 |
+
return create_SVGAnimatedRect(globalObject, [], {
|
| 231 |
+
element: esValue[implSymbol],
|
| 232 |
+
attribute: "viewBox"
|
| 233 |
+
});
|
| 234 |
+
});
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
get preserveAspectRatio() {
|
| 238 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 239 |
+
|
| 240 |
+
if (!exports.is(esValue)) {
|
| 241 |
+
throw new globalObject.TypeError(
|
| 242 |
+
"'get preserveAspectRatio' called on an object that is not a valid instance of SVGSVGElement."
|
| 243 |
+
);
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
return utils.getSameObject(this, "preserveAspectRatio", () => {
|
| 247 |
+
return create_SVGAnimatedPreserveAspectRatio(globalObject, [], {
|
| 248 |
+
element: esValue[implSymbol]
|
| 249 |
+
});
|
| 250 |
+
});
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
get onafterprint() {
|
| 254 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 255 |
+
|
| 256 |
+
if (!exports.is(esValue)) {
|
| 257 |
+
throw new globalObject.TypeError(
|
| 258 |
+
"'get onafterprint' called on an object that is not a valid instance of SVGSVGElement."
|
| 259 |
+
);
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onafterprint"]);
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
set onafterprint(V) {
|
| 266 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 267 |
+
|
| 268 |
+
if (!exports.is(esValue)) {
|
| 269 |
+
throw new globalObject.TypeError(
|
| 270 |
+
"'set onafterprint' called on an object that is not a valid instance of SVGSVGElement."
|
| 271 |
+
);
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
if (!utils.isObject(V)) {
|
| 275 |
+
V = null;
|
| 276 |
+
} else {
|
| 277 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 278 |
+
context: "Failed to set the 'onafterprint' property on 'SVGSVGElement': The provided value"
|
| 279 |
+
});
|
| 280 |
+
}
|
| 281 |
+
esValue[implSymbol]["onafterprint"] = V;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
get onbeforeprint() {
|
| 285 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 286 |
+
|
| 287 |
+
if (!exports.is(esValue)) {
|
| 288 |
+
throw new globalObject.TypeError(
|
| 289 |
+
"'get onbeforeprint' called on an object that is not a valid instance of SVGSVGElement."
|
| 290 |
+
);
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onbeforeprint"]);
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
set onbeforeprint(V) {
|
| 297 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 298 |
+
|
| 299 |
+
if (!exports.is(esValue)) {
|
| 300 |
+
throw new globalObject.TypeError(
|
| 301 |
+
"'set onbeforeprint' called on an object that is not a valid instance of SVGSVGElement."
|
| 302 |
+
);
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
if (!utils.isObject(V)) {
|
| 306 |
+
V = null;
|
| 307 |
+
} else {
|
| 308 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 309 |
+
context: "Failed to set the 'onbeforeprint' property on 'SVGSVGElement': The provided value"
|
| 310 |
+
});
|
| 311 |
+
}
|
| 312 |
+
esValue[implSymbol]["onbeforeprint"] = V;
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
get onbeforeunload() {
|
| 316 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 317 |
+
|
| 318 |
+
if (!exports.is(esValue)) {
|
| 319 |
+
throw new globalObject.TypeError(
|
| 320 |
+
"'get onbeforeunload' called on an object that is not a valid instance of SVGSVGElement."
|
| 321 |
+
);
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onbeforeunload"]);
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
set onbeforeunload(V) {
|
| 328 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 329 |
+
|
| 330 |
+
if (!exports.is(esValue)) {
|
| 331 |
+
throw new globalObject.TypeError(
|
| 332 |
+
"'set onbeforeunload' called on an object that is not a valid instance of SVGSVGElement."
|
| 333 |
+
);
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
if (!utils.isObject(V)) {
|
| 337 |
+
V = null;
|
| 338 |
+
} else {
|
| 339 |
+
V = OnBeforeUnloadEventHandlerNonNull.convert(globalObject, V, {
|
| 340 |
+
context: "Failed to set the 'onbeforeunload' property on 'SVGSVGElement': The provided value"
|
| 341 |
+
});
|
| 342 |
+
}
|
| 343 |
+
esValue[implSymbol]["onbeforeunload"] = V;
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
get onhashchange() {
|
| 347 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 348 |
+
|
| 349 |
+
if (!exports.is(esValue)) {
|
| 350 |
+
throw new globalObject.TypeError(
|
| 351 |
+
"'get onhashchange' called on an object that is not a valid instance of SVGSVGElement."
|
| 352 |
+
);
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onhashchange"]);
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
set onhashchange(V) {
|
| 359 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 360 |
+
|
| 361 |
+
if (!exports.is(esValue)) {
|
| 362 |
+
throw new globalObject.TypeError(
|
| 363 |
+
"'set onhashchange' called on an object that is not a valid instance of SVGSVGElement."
|
| 364 |
+
);
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
if (!utils.isObject(V)) {
|
| 368 |
+
V = null;
|
| 369 |
+
} else {
|
| 370 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 371 |
+
context: "Failed to set the 'onhashchange' property on 'SVGSVGElement': The provided value"
|
| 372 |
+
});
|
| 373 |
+
}
|
| 374 |
+
esValue[implSymbol]["onhashchange"] = V;
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
get onlanguagechange() {
|
| 378 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 379 |
+
|
| 380 |
+
if (!exports.is(esValue)) {
|
| 381 |
+
throw new globalObject.TypeError(
|
| 382 |
+
"'get onlanguagechange' called on an object that is not a valid instance of SVGSVGElement."
|
| 383 |
+
);
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onlanguagechange"]);
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
set onlanguagechange(V) {
|
| 390 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 391 |
+
|
| 392 |
+
if (!exports.is(esValue)) {
|
| 393 |
+
throw new globalObject.TypeError(
|
| 394 |
+
"'set onlanguagechange' called on an object that is not a valid instance of SVGSVGElement."
|
| 395 |
+
);
|
| 396 |
+
}
|
| 397 |
+
|
| 398 |
+
if (!utils.isObject(V)) {
|
| 399 |
+
V = null;
|
| 400 |
+
} else {
|
| 401 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 402 |
+
context: "Failed to set the 'onlanguagechange' property on 'SVGSVGElement': The provided value"
|
| 403 |
+
});
|
| 404 |
+
}
|
| 405 |
+
esValue[implSymbol]["onlanguagechange"] = V;
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
get onmessage() {
|
| 409 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 410 |
+
|
| 411 |
+
if (!exports.is(esValue)) {
|
| 412 |
+
throw new globalObject.TypeError(
|
| 413 |
+
"'get onmessage' called on an object that is not a valid instance of SVGSVGElement."
|
| 414 |
+
);
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onmessage"]);
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
set onmessage(V) {
|
| 421 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 422 |
+
|
| 423 |
+
if (!exports.is(esValue)) {
|
| 424 |
+
throw new globalObject.TypeError(
|
| 425 |
+
"'set onmessage' called on an object that is not a valid instance of SVGSVGElement."
|
| 426 |
+
);
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
if (!utils.isObject(V)) {
|
| 430 |
+
V = null;
|
| 431 |
+
} else {
|
| 432 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 433 |
+
context: "Failed to set the 'onmessage' property on 'SVGSVGElement': The provided value"
|
| 434 |
+
});
|
| 435 |
+
}
|
| 436 |
+
esValue[implSymbol]["onmessage"] = V;
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
get onmessageerror() {
|
| 440 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 441 |
+
|
| 442 |
+
if (!exports.is(esValue)) {
|
| 443 |
+
throw new globalObject.TypeError(
|
| 444 |
+
"'get onmessageerror' called on an object that is not a valid instance of SVGSVGElement."
|
| 445 |
+
);
|
| 446 |
+
}
|
| 447 |
+
|
| 448 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onmessageerror"]);
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
set onmessageerror(V) {
|
| 452 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 453 |
+
|
| 454 |
+
if (!exports.is(esValue)) {
|
| 455 |
+
throw new globalObject.TypeError(
|
| 456 |
+
"'set onmessageerror' called on an object that is not a valid instance of SVGSVGElement."
|
| 457 |
+
);
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
if (!utils.isObject(V)) {
|
| 461 |
+
V = null;
|
| 462 |
+
} else {
|
| 463 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 464 |
+
context: "Failed to set the 'onmessageerror' property on 'SVGSVGElement': The provided value"
|
| 465 |
+
});
|
| 466 |
+
}
|
| 467 |
+
esValue[implSymbol]["onmessageerror"] = V;
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
get onoffline() {
|
| 471 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 472 |
+
|
| 473 |
+
if (!exports.is(esValue)) {
|
| 474 |
+
throw new globalObject.TypeError(
|
| 475 |
+
"'get onoffline' called on an object that is not a valid instance of SVGSVGElement."
|
| 476 |
+
);
|
| 477 |
+
}
|
| 478 |
+
|
| 479 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onoffline"]);
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
set onoffline(V) {
|
| 483 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 484 |
+
|
| 485 |
+
if (!exports.is(esValue)) {
|
| 486 |
+
throw new globalObject.TypeError(
|
| 487 |
+
"'set onoffline' called on an object that is not a valid instance of SVGSVGElement."
|
| 488 |
+
);
|
| 489 |
+
}
|
| 490 |
+
|
| 491 |
+
if (!utils.isObject(V)) {
|
| 492 |
+
V = null;
|
| 493 |
+
} else {
|
| 494 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 495 |
+
context: "Failed to set the 'onoffline' property on 'SVGSVGElement': The provided value"
|
| 496 |
+
});
|
| 497 |
+
}
|
| 498 |
+
esValue[implSymbol]["onoffline"] = V;
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
+
get ononline() {
|
| 502 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 503 |
+
|
| 504 |
+
if (!exports.is(esValue)) {
|
| 505 |
+
throw new globalObject.TypeError(
|
| 506 |
+
"'get ononline' called on an object that is not a valid instance of SVGSVGElement."
|
| 507 |
+
);
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["ononline"]);
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
set ononline(V) {
|
| 514 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 515 |
+
|
| 516 |
+
if (!exports.is(esValue)) {
|
| 517 |
+
throw new globalObject.TypeError(
|
| 518 |
+
"'set ononline' called on an object that is not a valid instance of SVGSVGElement."
|
| 519 |
+
);
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
if (!utils.isObject(V)) {
|
| 523 |
+
V = null;
|
| 524 |
+
} else {
|
| 525 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 526 |
+
context: "Failed to set the 'ononline' property on 'SVGSVGElement': The provided value"
|
| 527 |
+
});
|
| 528 |
+
}
|
| 529 |
+
esValue[implSymbol]["ononline"] = V;
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
get onpagehide() {
|
| 533 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 534 |
+
|
| 535 |
+
if (!exports.is(esValue)) {
|
| 536 |
+
throw new globalObject.TypeError(
|
| 537 |
+
"'get onpagehide' called on an object that is not a valid instance of SVGSVGElement."
|
| 538 |
+
);
|
| 539 |
+
}
|
| 540 |
+
|
| 541 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onpagehide"]);
|
| 542 |
+
}
|
| 543 |
+
|
| 544 |
+
set onpagehide(V) {
|
| 545 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 546 |
+
|
| 547 |
+
if (!exports.is(esValue)) {
|
| 548 |
+
throw new globalObject.TypeError(
|
| 549 |
+
"'set onpagehide' called on an object that is not a valid instance of SVGSVGElement."
|
| 550 |
+
);
|
| 551 |
+
}
|
| 552 |
+
|
| 553 |
+
if (!utils.isObject(V)) {
|
| 554 |
+
V = null;
|
| 555 |
+
} else {
|
| 556 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 557 |
+
context: "Failed to set the 'onpagehide' property on 'SVGSVGElement': The provided value"
|
| 558 |
+
});
|
| 559 |
+
}
|
| 560 |
+
esValue[implSymbol]["onpagehide"] = V;
|
| 561 |
+
}
|
| 562 |
+
|
| 563 |
+
get onpageshow() {
|
| 564 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 565 |
+
|
| 566 |
+
if (!exports.is(esValue)) {
|
| 567 |
+
throw new globalObject.TypeError(
|
| 568 |
+
"'get onpageshow' called on an object that is not a valid instance of SVGSVGElement."
|
| 569 |
+
);
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onpageshow"]);
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
set onpageshow(V) {
|
| 576 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 577 |
+
|
| 578 |
+
if (!exports.is(esValue)) {
|
| 579 |
+
throw new globalObject.TypeError(
|
| 580 |
+
"'set onpageshow' called on an object that is not a valid instance of SVGSVGElement."
|
| 581 |
+
);
|
| 582 |
+
}
|
| 583 |
+
|
| 584 |
+
if (!utils.isObject(V)) {
|
| 585 |
+
V = null;
|
| 586 |
+
} else {
|
| 587 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 588 |
+
context: "Failed to set the 'onpageshow' property on 'SVGSVGElement': The provided value"
|
| 589 |
+
});
|
| 590 |
+
}
|
| 591 |
+
esValue[implSymbol]["onpageshow"] = V;
|
| 592 |
+
}
|
| 593 |
+
|
| 594 |
+
get onpopstate() {
|
| 595 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 596 |
+
|
| 597 |
+
if (!exports.is(esValue)) {
|
| 598 |
+
throw new globalObject.TypeError(
|
| 599 |
+
"'get onpopstate' called on an object that is not a valid instance of SVGSVGElement."
|
| 600 |
+
);
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onpopstate"]);
|
| 604 |
+
}
|
| 605 |
+
|
| 606 |
+
set onpopstate(V) {
|
| 607 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 608 |
+
|
| 609 |
+
if (!exports.is(esValue)) {
|
| 610 |
+
throw new globalObject.TypeError(
|
| 611 |
+
"'set onpopstate' called on an object that is not a valid instance of SVGSVGElement."
|
| 612 |
+
);
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
if (!utils.isObject(V)) {
|
| 616 |
+
V = null;
|
| 617 |
+
} else {
|
| 618 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 619 |
+
context: "Failed to set the 'onpopstate' property on 'SVGSVGElement': The provided value"
|
| 620 |
+
});
|
| 621 |
+
}
|
| 622 |
+
esValue[implSymbol]["onpopstate"] = V;
|
| 623 |
+
}
|
| 624 |
+
|
| 625 |
+
get onrejectionhandled() {
|
| 626 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 627 |
+
|
| 628 |
+
if (!exports.is(esValue)) {
|
| 629 |
+
throw new globalObject.TypeError(
|
| 630 |
+
"'get onrejectionhandled' called on an object that is not a valid instance of SVGSVGElement."
|
| 631 |
+
);
|
| 632 |
+
}
|
| 633 |
+
|
| 634 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onrejectionhandled"]);
|
| 635 |
+
}
|
| 636 |
+
|
| 637 |
+
set onrejectionhandled(V) {
|
| 638 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 639 |
+
|
| 640 |
+
if (!exports.is(esValue)) {
|
| 641 |
+
throw new globalObject.TypeError(
|
| 642 |
+
"'set onrejectionhandled' called on an object that is not a valid instance of SVGSVGElement."
|
| 643 |
+
);
|
| 644 |
+
}
|
| 645 |
+
|
| 646 |
+
if (!utils.isObject(V)) {
|
| 647 |
+
V = null;
|
| 648 |
+
} else {
|
| 649 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 650 |
+
context: "Failed to set the 'onrejectionhandled' property on 'SVGSVGElement': The provided value"
|
| 651 |
+
});
|
| 652 |
+
}
|
| 653 |
+
esValue[implSymbol]["onrejectionhandled"] = V;
|
| 654 |
+
}
|
| 655 |
+
|
| 656 |
+
get onstorage() {
|
| 657 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 658 |
+
|
| 659 |
+
if (!exports.is(esValue)) {
|
| 660 |
+
throw new globalObject.TypeError(
|
| 661 |
+
"'get onstorage' called on an object that is not a valid instance of SVGSVGElement."
|
| 662 |
+
);
|
| 663 |
+
}
|
| 664 |
+
|
| 665 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onstorage"]);
|
| 666 |
+
}
|
| 667 |
+
|
| 668 |
+
set onstorage(V) {
|
| 669 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 670 |
+
|
| 671 |
+
if (!exports.is(esValue)) {
|
| 672 |
+
throw new globalObject.TypeError(
|
| 673 |
+
"'set onstorage' called on an object that is not a valid instance of SVGSVGElement."
|
| 674 |
+
);
|
| 675 |
+
}
|
| 676 |
+
|
| 677 |
+
if (!utils.isObject(V)) {
|
| 678 |
+
V = null;
|
| 679 |
+
} else {
|
| 680 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 681 |
+
context: "Failed to set the 'onstorage' property on 'SVGSVGElement': The provided value"
|
| 682 |
+
});
|
| 683 |
+
}
|
| 684 |
+
esValue[implSymbol]["onstorage"] = V;
|
| 685 |
+
}
|
| 686 |
+
|
| 687 |
+
get onunhandledrejection() {
|
| 688 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 689 |
+
|
| 690 |
+
if (!exports.is(esValue)) {
|
| 691 |
+
throw new globalObject.TypeError(
|
| 692 |
+
"'get onunhandledrejection' called on an object that is not a valid instance of SVGSVGElement."
|
| 693 |
+
);
|
| 694 |
+
}
|
| 695 |
+
|
| 696 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onunhandledrejection"]);
|
| 697 |
+
}
|
| 698 |
+
|
| 699 |
+
set onunhandledrejection(V) {
|
| 700 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 701 |
+
|
| 702 |
+
if (!exports.is(esValue)) {
|
| 703 |
+
throw new globalObject.TypeError(
|
| 704 |
+
"'set onunhandledrejection' called on an object that is not a valid instance of SVGSVGElement."
|
| 705 |
+
);
|
| 706 |
+
}
|
| 707 |
+
|
| 708 |
+
if (!utils.isObject(V)) {
|
| 709 |
+
V = null;
|
| 710 |
+
} else {
|
| 711 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 712 |
+
context: "Failed to set the 'onunhandledrejection' property on 'SVGSVGElement': The provided value"
|
| 713 |
+
});
|
| 714 |
+
}
|
| 715 |
+
esValue[implSymbol]["onunhandledrejection"] = V;
|
| 716 |
+
}
|
| 717 |
+
|
| 718 |
+
get onunload() {
|
| 719 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 720 |
+
|
| 721 |
+
if (!exports.is(esValue)) {
|
| 722 |
+
throw new globalObject.TypeError(
|
| 723 |
+
"'get onunload' called on an object that is not a valid instance of SVGSVGElement."
|
| 724 |
+
);
|
| 725 |
+
}
|
| 726 |
+
|
| 727 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["onunload"]);
|
| 728 |
+
}
|
| 729 |
+
|
| 730 |
+
set onunload(V) {
|
| 731 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 732 |
+
|
| 733 |
+
if (!exports.is(esValue)) {
|
| 734 |
+
throw new globalObject.TypeError(
|
| 735 |
+
"'set onunload' called on an object that is not a valid instance of SVGSVGElement."
|
| 736 |
+
);
|
| 737 |
+
}
|
| 738 |
+
|
| 739 |
+
if (!utils.isObject(V)) {
|
| 740 |
+
V = null;
|
| 741 |
+
} else {
|
| 742 |
+
V = EventHandlerNonNull.convert(globalObject, V, {
|
| 743 |
+
context: "Failed to set the 'onunload' property on 'SVGSVGElement': The provided value"
|
| 744 |
+
});
|
| 745 |
+
}
|
| 746 |
+
esValue[implSymbol]["onunload"] = V;
|
| 747 |
+
}
|
| 748 |
+
}
|
| 749 |
+
Object.defineProperties(SVGSVGElement.prototype, {
|
| 750 |
+
createSVGNumber: { enumerable: true },
|
| 751 |
+
createSVGRect: { enumerable: true },
|
| 752 |
+
getElementById: { enumerable: true },
|
| 753 |
+
suspendRedraw: { enumerable: true },
|
| 754 |
+
unsuspendRedraw: { enumerable: true },
|
| 755 |
+
unsuspendRedrawAll: { enumerable: true },
|
| 756 |
+
forceRedraw: { enumerable: true },
|
| 757 |
+
viewBox: { enumerable: true },
|
| 758 |
+
preserveAspectRatio: { enumerable: true },
|
| 759 |
+
onafterprint: { enumerable: true },
|
| 760 |
+
onbeforeprint: { enumerable: true },
|
| 761 |
+
onbeforeunload: { enumerable: true },
|
| 762 |
+
onhashchange: { enumerable: true },
|
| 763 |
+
onlanguagechange: { enumerable: true },
|
| 764 |
+
onmessage: { enumerable: true },
|
| 765 |
+
onmessageerror: { enumerable: true },
|
| 766 |
+
onoffline: { enumerable: true },
|
| 767 |
+
ononline: { enumerable: true },
|
| 768 |
+
onpagehide: { enumerable: true },
|
| 769 |
+
onpageshow: { enumerable: true },
|
| 770 |
+
onpopstate: { enumerable: true },
|
| 771 |
+
onrejectionhandled: { enumerable: true },
|
| 772 |
+
onstorage: { enumerable: true },
|
| 773 |
+
onunhandledrejection: { enumerable: true },
|
| 774 |
+
onunload: { enumerable: true },
|
| 775 |
+
[Symbol.toStringTag]: { value: "SVGSVGElement", configurable: true }
|
| 776 |
+
});
|
| 777 |
+
ctorRegistry[interfaceName] = SVGSVGElement;
|
| 778 |
+
|
| 779 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 780 |
+
configurable: true,
|
| 781 |
+
writable: true,
|
| 782 |
+
value: SVGSVGElement
|
| 783 |
+
});
|
| 784 |
+
};
|
| 785 |
+
|
| 786 |
+
const Impl = require("../nodes/SVGSVGElement-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGStringList.js
ADDED
|
@@ -0,0 +1,511 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "SVGStringList";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGStringList'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["SVGStringList"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
function makeProxy(wrapper, globalObject) {
|
| 38 |
+
let proxyHandler = proxyHandlerCache.get(globalObject);
|
| 39 |
+
if (proxyHandler === undefined) {
|
| 40 |
+
proxyHandler = new ProxyHandler(globalObject);
|
| 41 |
+
proxyHandlerCache.set(globalObject, proxyHandler);
|
| 42 |
+
}
|
| 43 |
+
return new Proxy(wrapper, proxyHandler);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 47 |
+
const wrapper = makeWrapper(globalObject);
|
| 48 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 52 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 53 |
+
return utils.implForWrapper(wrapper);
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 57 |
+
|
| 58 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 59 |
+
privateData.wrapper = wrapper;
|
| 60 |
+
|
| 61 |
+
exports._internalSetup(wrapper, globalObject);
|
| 62 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 63 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 64 |
+
configurable: true
|
| 65 |
+
});
|
| 66 |
+
|
| 67 |
+
wrapper = makeProxy(wrapper, globalObject);
|
| 68 |
+
|
| 69 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 70 |
+
if (Impl.init) {
|
| 71 |
+
Impl.init(wrapper[implSymbol]);
|
| 72 |
+
}
|
| 73 |
+
return wrapper;
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
exports.new = (globalObject, newTarget) => {
|
| 77 |
+
let wrapper = makeWrapper(globalObject, newTarget);
|
| 78 |
+
|
| 79 |
+
exports._internalSetup(wrapper, globalObject);
|
| 80 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 81 |
+
value: Object.create(Impl.implementation.prototype),
|
| 82 |
+
configurable: true
|
| 83 |
+
});
|
| 84 |
+
|
| 85 |
+
wrapper = makeProxy(wrapper, globalObject);
|
| 86 |
+
|
| 87 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 88 |
+
if (Impl.init) {
|
| 89 |
+
Impl.init(wrapper[implSymbol]);
|
| 90 |
+
}
|
| 91 |
+
return wrapper[implSymbol];
|
| 92 |
+
};
|
| 93 |
+
|
| 94 |
+
const exposed = new Set(["Window"]);
|
| 95 |
+
|
| 96 |
+
exports.install = (globalObject, globalNames) => {
|
| 97 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 98 |
+
return;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 102 |
+
class SVGStringList {
|
| 103 |
+
constructor() {
|
| 104 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
clear() {
|
| 108 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 109 |
+
if (!exports.is(esValue)) {
|
| 110 |
+
throw new globalObject.TypeError("'clear' called on an object that is not a valid instance of SVGStringList.");
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
return esValue[implSymbol].clear();
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
initialize(newItem) {
|
| 117 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 118 |
+
if (!exports.is(esValue)) {
|
| 119 |
+
throw new globalObject.TypeError(
|
| 120 |
+
"'initialize' called on an object that is not a valid instance of SVGStringList."
|
| 121 |
+
);
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
if (arguments.length < 1) {
|
| 125 |
+
throw new globalObject.TypeError(
|
| 126 |
+
`Failed to execute 'initialize' on 'SVGStringList': 1 argument required, but only ${arguments.length} present.`
|
| 127 |
+
);
|
| 128 |
+
}
|
| 129 |
+
const args = [];
|
| 130 |
+
{
|
| 131 |
+
let curArg = arguments[0];
|
| 132 |
+
curArg = conversions["DOMString"](curArg, {
|
| 133 |
+
context: "Failed to execute 'initialize' on 'SVGStringList': parameter 1",
|
| 134 |
+
globals: globalObject
|
| 135 |
+
});
|
| 136 |
+
args.push(curArg);
|
| 137 |
+
}
|
| 138 |
+
return esValue[implSymbol].initialize(...args);
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
getItem(index) {
|
| 142 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 143 |
+
if (!exports.is(esValue)) {
|
| 144 |
+
throw new globalObject.TypeError(
|
| 145 |
+
"'getItem' called on an object that is not a valid instance of SVGStringList."
|
| 146 |
+
);
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
if (arguments.length < 1) {
|
| 150 |
+
throw new globalObject.TypeError(
|
| 151 |
+
`Failed to execute 'getItem' on 'SVGStringList': 1 argument required, but only ${arguments.length} present.`
|
| 152 |
+
);
|
| 153 |
+
}
|
| 154 |
+
const args = [];
|
| 155 |
+
{
|
| 156 |
+
let curArg = arguments[0];
|
| 157 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 158 |
+
context: "Failed to execute 'getItem' on 'SVGStringList': parameter 1",
|
| 159 |
+
globals: globalObject
|
| 160 |
+
});
|
| 161 |
+
args.push(curArg);
|
| 162 |
+
}
|
| 163 |
+
return esValue[implSymbol].getItem(...args);
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
insertItemBefore(newItem, index) {
|
| 167 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 168 |
+
if (!exports.is(esValue)) {
|
| 169 |
+
throw new globalObject.TypeError(
|
| 170 |
+
"'insertItemBefore' called on an object that is not a valid instance of SVGStringList."
|
| 171 |
+
);
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
if (arguments.length < 2) {
|
| 175 |
+
throw new globalObject.TypeError(
|
| 176 |
+
`Failed to execute 'insertItemBefore' on 'SVGStringList': 2 arguments required, but only ${arguments.length} present.`
|
| 177 |
+
);
|
| 178 |
+
}
|
| 179 |
+
const args = [];
|
| 180 |
+
{
|
| 181 |
+
let curArg = arguments[0];
|
| 182 |
+
curArg = conversions["DOMString"](curArg, {
|
| 183 |
+
context: "Failed to execute 'insertItemBefore' on 'SVGStringList': parameter 1",
|
| 184 |
+
globals: globalObject
|
| 185 |
+
});
|
| 186 |
+
args.push(curArg);
|
| 187 |
+
}
|
| 188 |
+
{
|
| 189 |
+
let curArg = arguments[1];
|
| 190 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 191 |
+
context: "Failed to execute 'insertItemBefore' on 'SVGStringList': parameter 2",
|
| 192 |
+
globals: globalObject
|
| 193 |
+
});
|
| 194 |
+
args.push(curArg);
|
| 195 |
+
}
|
| 196 |
+
return esValue[implSymbol].insertItemBefore(...args);
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
replaceItem(newItem, index) {
|
| 200 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 201 |
+
if (!exports.is(esValue)) {
|
| 202 |
+
throw new globalObject.TypeError(
|
| 203 |
+
"'replaceItem' called on an object that is not a valid instance of SVGStringList."
|
| 204 |
+
);
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
if (arguments.length < 2) {
|
| 208 |
+
throw new globalObject.TypeError(
|
| 209 |
+
`Failed to execute 'replaceItem' on 'SVGStringList': 2 arguments required, but only ${arguments.length} present.`
|
| 210 |
+
);
|
| 211 |
+
}
|
| 212 |
+
const args = [];
|
| 213 |
+
{
|
| 214 |
+
let curArg = arguments[0];
|
| 215 |
+
curArg = conversions["DOMString"](curArg, {
|
| 216 |
+
context: "Failed to execute 'replaceItem' on 'SVGStringList': parameter 1",
|
| 217 |
+
globals: globalObject
|
| 218 |
+
});
|
| 219 |
+
args.push(curArg);
|
| 220 |
+
}
|
| 221 |
+
{
|
| 222 |
+
let curArg = arguments[1];
|
| 223 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 224 |
+
context: "Failed to execute 'replaceItem' on 'SVGStringList': parameter 2",
|
| 225 |
+
globals: globalObject
|
| 226 |
+
});
|
| 227 |
+
args.push(curArg);
|
| 228 |
+
}
|
| 229 |
+
return esValue[implSymbol].replaceItem(...args);
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
removeItem(index) {
|
| 233 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 234 |
+
if (!exports.is(esValue)) {
|
| 235 |
+
throw new globalObject.TypeError(
|
| 236 |
+
"'removeItem' called on an object that is not a valid instance of SVGStringList."
|
| 237 |
+
);
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
if (arguments.length < 1) {
|
| 241 |
+
throw new globalObject.TypeError(
|
| 242 |
+
`Failed to execute 'removeItem' on 'SVGStringList': 1 argument required, but only ${arguments.length} present.`
|
| 243 |
+
);
|
| 244 |
+
}
|
| 245 |
+
const args = [];
|
| 246 |
+
{
|
| 247 |
+
let curArg = arguments[0];
|
| 248 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 249 |
+
context: "Failed to execute 'removeItem' on 'SVGStringList': parameter 1",
|
| 250 |
+
globals: globalObject
|
| 251 |
+
});
|
| 252 |
+
args.push(curArg);
|
| 253 |
+
}
|
| 254 |
+
return esValue[implSymbol].removeItem(...args);
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
appendItem(newItem) {
|
| 258 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 259 |
+
if (!exports.is(esValue)) {
|
| 260 |
+
throw new globalObject.TypeError(
|
| 261 |
+
"'appendItem' called on an object that is not a valid instance of SVGStringList."
|
| 262 |
+
);
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
if (arguments.length < 1) {
|
| 266 |
+
throw new globalObject.TypeError(
|
| 267 |
+
`Failed to execute 'appendItem' on 'SVGStringList': 1 argument required, but only ${arguments.length} present.`
|
| 268 |
+
);
|
| 269 |
+
}
|
| 270 |
+
const args = [];
|
| 271 |
+
{
|
| 272 |
+
let curArg = arguments[0];
|
| 273 |
+
curArg = conversions["DOMString"](curArg, {
|
| 274 |
+
context: "Failed to execute 'appendItem' on 'SVGStringList': parameter 1",
|
| 275 |
+
globals: globalObject
|
| 276 |
+
});
|
| 277 |
+
args.push(curArg);
|
| 278 |
+
}
|
| 279 |
+
return esValue[implSymbol].appendItem(...args);
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
get length() {
|
| 283 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 284 |
+
|
| 285 |
+
if (!exports.is(esValue)) {
|
| 286 |
+
throw new globalObject.TypeError(
|
| 287 |
+
"'get length' called on an object that is not a valid instance of SVGStringList."
|
| 288 |
+
);
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
return esValue[implSymbol]["length"];
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
get numberOfItems() {
|
| 295 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 296 |
+
|
| 297 |
+
if (!exports.is(esValue)) {
|
| 298 |
+
throw new globalObject.TypeError(
|
| 299 |
+
"'get numberOfItems' called on an object that is not a valid instance of SVGStringList."
|
| 300 |
+
);
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
return esValue[implSymbol]["numberOfItems"];
|
| 304 |
+
}
|
| 305 |
+
}
|
| 306 |
+
Object.defineProperties(SVGStringList.prototype, {
|
| 307 |
+
clear: { enumerable: true },
|
| 308 |
+
initialize: { enumerable: true },
|
| 309 |
+
getItem: { enumerable: true },
|
| 310 |
+
insertItemBefore: { enumerable: true },
|
| 311 |
+
replaceItem: { enumerable: true },
|
| 312 |
+
removeItem: { enumerable: true },
|
| 313 |
+
appendItem: { enumerable: true },
|
| 314 |
+
length: { enumerable: true },
|
| 315 |
+
numberOfItems: { enumerable: true },
|
| 316 |
+
[Symbol.toStringTag]: { value: "SVGStringList", configurable: true },
|
| 317 |
+
[Symbol.iterator]: { value: globalObject.Array.prototype[Symbol.iterator], configurable: true, writable: true }
|
| 318 |
+
});
|
| 319 |
+
ctorRegistry[interfaceName] = SVGStringList;
|
| 320 |
+
|
| 321 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 322 |
+
configurable: true,
|
| 323 |
+
writable: true,
|
| 324 |
+
value: SVGStringList
|
| 325 |
+
});
|
| 326 |
+
};
|
| 327 |
+
|
| 328 |
+
const proxyHandlerCache = new WeakMap();
|
| 329 |
+
class ProxyHandler {
|
| 330 |
+
constructor(globalObject) {
|
| 331 |
+
this._globalObject = globalObject;
|
| 332 |
+
}
|
| 333 |
+
|
| 334 |
+
get(target, P, receiver) {
|
| 335 |
+
if (typeof P === "symbol") {
|
| 336 |
+
return Reflect.get(target, P, receiver);
|
| 337 |
+
}
|
| 338 |
+
const desc = this.getOwnPropertyDescriptor(target, P);
|
| 339 |
+
if (desc === undefined) {
|
| 340 |
+
const parent = Object.getPrototypeOf(target);
|
| 341 |
+
if (parent === null) {
|
| 342 |
+
return undefined;
|
| 343 |
+
}
|
| 344 |
+
return Reflect.get(target, P, receiver);
|
| 345 |
+
}
|
| 346 |
+
if (!desc.get && !desc.set) {
|
| 347 |
+
return desc.value;
|
| 348 |
+
}
|
| 349 |
+
const getter = desc.get;
|
| 350 |
+
if (getter === undefined) {
|
| 351 |
+
return undefined;
|
| 352 |
+
}
|
| 353 |
+
return Reflect.apply(getter, receiver, []);
|
| 354 |
+
}
|
| 355 |
+
|
| 356 |
+
has(target, P) {
|
| 357 |
+
if (typeof P === "symbol") {
|
| 358 |
+
return Reflect.has(target, P);
|
| 359 |
+
}
|
| 360 |
+
const desc = this.getOwnPropertyDescriptor(target, P);
|
| 361 |
+
if (desc !== undefined) {
|
| 362 |
+
return true;
|
| 363 |
+
}
|
| 364 |
+
const parent = Object.getPrototypeOf(target);
|
| 365 |
+
if (parent !== null) {
|
| 366 |
+
return Reflect.has(parent, P);
|
| 367 |
+
}
|
| 368 |
+
return false;
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
ownKeys(target) {
|
| 372 |
+
const keys = new Set();
|
| 373 |
+
|
| 374 |
+
for (const key of target[implSymbol][utils.supportedPropertyIndices]) {
|
| 375 |
+
keys.add(`${key}`);
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
for (const key of Reflect.ownKeys(target)) {
|
| 379 |
+
keys.add(key);
|
| 380 |
+
}
|
| 381 |
+
return [...keys];
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
getOwnPropertyDescriptor(target, P) {
|
| 385 |
+
if (typeof P === "symbol") {
|
| 386 |
+
return Reflect.getOwnPropertyDescriptor(target, P);
|
| 387 |
+
}
|
| 388 |
+
let ignoreNamedProps = false;
|
| 389 |
+
|
| 390 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 391 |
+
const index = P >>> 0;
|
| 392 |
+
|
| 393 |
+
if (target[implSymbol][utils.supportsPropertyIndex](index)) {
|
| 394 |
+
const indexedValue = target[implSymbol].getItem(index);
|
| 395 |
+
return {
|
| 396 |
+
writable: true,
|
| 397 |
+
enumerable: true,
|
| 398 |
+
configurable: true,
|
| 399 |
+
value: utils.tryWrapperForImpl(indexedValue)
|
| 400 |
+
};
|
| 401 |
+
}
|
| 402 |
+
ignoreNamedProps = true;
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
return Reflect.getOwnPropertyDescriptor(target, P);
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
set(target, P, V, receiver) {
|
| 409 |
+
if (typeof P === "symbol") {
|
| 410 |
+
return Reflect.set(target, P, V, receiver);
|
| 411 |
+
}
|
| 412 |
+
// The `receiver` argument refers to the Proxy exotic object or an object
|
| 413 |
+
// that inherits from it, whereas `target` refers to the Proxy target:
|
| 414 |
+
if (target[implSymbol][utils.wrapperSymbol] === receiver) {
|
| 415 |
+
const globalObject = this._globalObject;
|
| 416 |
+
|
| 417 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 418 |
+
const index = P >>> 0;
|
| 419 |
+
let indexedValue = V;
|
| 420 |
+
|
| 421 |
+
indexedValue = conversions["DOMString"](indexedValue, {
|
| 422 |
+
context: "Failed to set the " + index + " property on 'SVGStringList': The provided value",
|
| 423 |
+
globals: globalObject
|
| 424 |
+
});
|
| 425 |
+
|
| 426 |
+
const creating = !target[implSymbol][utils.supportsPropertyIndex](index);
|
| 427 |
+
if (creating) {
|
| 428 |
+
target[implSymbol][utils.indexedSetNew](index, indexedValue);
|
| 429 |
+
} else {
|
| 430 |
+
target[implSymbol][utils.indexedSetExisting](index, indexedValue);
|
| 431 |
+
}
|
| 432 |
+
|
| 433 |
+
return true;
|
| 434 |
+
}
|
| 435 |
+
}
|
| 436 |
+
let ownDesc;
|
| 437 |
+
|
| 438 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 439 |
+
const index = P >>> 0;
|
| 440 |
+
|
| 441 |
+
if (target[implSymbol][utils.supportsPropertyIndex](index)) {
|
| 442 |
+
const indexedValue = target[implSymbol].getItem(index);
|
| 443 |
+
ownDesc = {
|
| 444 |
+
writable: true,
|
| 445 |
+
enumerable: true,
|
| 446 |
+
configurable: true,
|
| 447 |
+
value: utils.tryWrapperForImpl(indexedValue)
|
| 448 |
+
};
|
| 449 |
+
}
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
if (ownDesc === undefined) {
|
| 453 |
+
ownDesc = Reflect.getOwnPropertyDescriptor(target, P);
|
| 454 |
+
}
|
| 455 |
+
return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc);
|
| 456 |
+
}
|
| 457 |
+
|
| 458 |
+
defineProperty(target, P, desc) {
|
| 459 |
+
if (typeof P === "symbol") {
|
| 460 |
+
return Reflect.defineProperty(target, P, desc);
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
const globalObject = this._globalObject;
|
| 464 |
+
|
| 465 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 466 |
+
if (desc.get || desc.set) {
|
| 467 |
+
return false;
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
const index = P >>> 0;
|
| 471 |
+
let indexedValue = desc.value;
|
| 472 |
+
|
| 473 |
+
indexedValue = conversions["DOMString"](indexedValue, {
|
| 474 |
+
context: "Failed to set the " + index + " property on 'SVGStringList': The provided value",
|
| 475 |
+
globals: globalObject
|
| 476 |
+
});
|
| 477 |
+
|
| 478 |
+
const creating = !target[implSymbol][utils.supportsPropertyIndex](index);
|
| 479 |
+
if (creating) {
|
| 480 |
+
target[implSymbol][utils.indexedSetNew](index, indexedValue);
|
| 481 |
+
} else {
|
| 482 |
+
target[implSymbol][utils.indexedSetExisting](index, indexedValue);
|
| 483 |
+
}
|
| 484 |
+
|
| 485 |
+
return true;
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
return Reflect.defineProperty(target, P, desc);
|
| 489 |
+
}
|
| 490 |
+
|
| 491 |
+
deleteProperty(target, P) {
|
| 492 |
+
if (typeof P === "symbol") {
|
| 493 |
+
return Reflect.deleteProperty(target, P);
|
| 494 |
+
}
|
| 495 |
+
|
| 496 |
+
const globalObject = this._globalObject;
|
| 497 |
+
|
| 498 |
+
if (utils.isArrayIndexPropName(P)) {
|
| 499 |
+
const index = P >>> 0;
|
| 500 |
+
return !target[implSymbol][utils.supportsPropertyIndex](index);
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
return Reflect.deleteProperty(target, P);
|
| 504 |
+
}
|
| 505 |
+
|
| 506 |
+
preventExtensions() {
|
| 507 |
+
return false;
|
| 508 |
+
}
|
| 509 |
+
}
|
| 510 |
+
|
| 511 |
+
const Impl = require("../svg/SVGStringList-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGSwitchElement.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
const SVGGraphicsElement = require("./SVGGraphicsElement.js");
|
| 9 |
+
|
| 10 |
+
const interfaceName = "SVGSwitchElement";
|
| 11 |
+
|
| 12 |
+
exports.is = value => {
|
| 13 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 14 |
+
};
|
| 15 |
+
exports.isImpl = value => {
|
| 16 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 19 |
+
if (exports.is(value)) {
|
| 20 |
+
return utils.implForWrapper(value);
|
| 21 |
+
}
|
| 22 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGSwitchElement'.`);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
function makeWrapper(globalObject, newTarget) {
|
| 26 |
+
let proto;
|
| 27 |
+
if (newTarget !== undefined) {
|
| 28 |
+
proto = newTarget.prototype;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!utils.isObject(proto)) {
|
| 32 |
+
proto = globalObject[ctorRegistrySymbol]["SVGSwitchElement"].prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
return Object.create(proto);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 39 |
+
const wrapper = makeWrapper(globalObject);
|
| 40 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 44 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 45 |
+
return utils.implForWrapper(wrapper);
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 49 |
+
SVGGraphicsElement._internalSetup(wrapper, globalObject);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 53 |
+
privateData.wrapper = wrapper;
|
| 54 |
+
|
| 55 |
+
exports._internalSetup(wrapper, globalObject);
|
| 56 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 57 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 58 |
+
configurable: true
|
| 59 |
+
});
|
| 60 |
+
|
| 61 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 62 |
+
if (Impl.init) {
|
| 63 |
+
Impl.init(wrapper[implSymbol]);
|
| 64 |
+
}
|
| 65 |
+
return wrapper;
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports.new = (globalObject, newTarget) => {
|
| 69 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 70 |
+
|
| 71 |
+
exports._internalSetup(wrapper, globalObject);
|
| 72 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 73 |
+
value: Object.create(Impl.implementation.prototype),
|
| 74 |
+
configurable: true
|
| 75 |
+
});
|
| 76 |
+
|
| 77 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 78 |
+
if (Impl.init) {
|
| 79 |
+
Impl.init(wrapper[implSymbol]);
|
| 80 |
+
}
|
| 81 |
+
return wrapper[implSymbol];
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
const exposed = new Set(["Window"]);
|
| 85 |
+
|
| 86 |
+
exports.install = (globalObject, globalNames) => {
|
| 87 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 88 |
+
return;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 92 |
+
class SVGSwitchElement extends globalObject.SVGGraphicsElement {
|
| 93 |
+
constructor() {
|
| 94 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
Object.defineProperties(SVGSwitchElement.prototype, {
|
| 98 |
+
[Symbol.toStringTag]: { value: "SVGSwitchElement", configurable: true }
|
| 99 |
+
});
|
| 100 |
+
ctorRegistry[interfaceName] = SVGSwitchElement;
|
| 101 |
+
|
| 102 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 103 |
+
configurable: true,
|
| 104 |
+
writable: true,
|
| 105 |
+
value: SVGSwitchElement
|
| 106 |
+
});
|
| 107 |
+
};
|
| 108 |
+
|
| 109 |
+
const Impl = require("../nodes/SVGSwitchElement-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGSymbolElement.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const create_SVGAnimatedRect = require("./SVGAnimatedRect.js").create;
|
| 7 |
+
const create_SVGAnimatedPreserveAspectRatio = require("./SVGAnimatedPreserveAspectRatio.js").create;
|
| 8 |
+
const implSymbol = utils.implSymbol;
|
| 9 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 10 |
+
const SVGGraphicsElement = require("./SVGGraphicsElement.js");
|
| 11 |
+
|
| 12 |
+
const interfaceName = "SVGSymbolElement";
|
| 13 |
+
|
| 14 |
+
exports.is = value => {
|
| 15 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.isImpl = value => {
|
| 18 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 19 |
+
};
|
| 20 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 21 |
+
if (exports.is(value)) {
|
| 22 |
+
return utils.implForWrapper(value);
|
| 23 |
+
}
|
| 24 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGSymbolElement'.`);
|
| 25 |
+
};
|
| 26 |
+
|
| 27 |
+
function makeWrapper(globalObject, newTarget) {
|
| 28 |
+
let proto;
|
| 29 |
+
if (newTarget !== undefined) {
|
| 30 |
+
proto = newTarget.prototype;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
if (!utils.isObject(proto)) {
|
| 34 |
+
proto = globalObject[ctorRegistrySymbol]["SVGSymbolElement"].prototype;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
return Object.create(proto);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 41 |
+
const wrapper = makeWrapper(globalObject);
|
| 42 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 43 |
+
};
|
| 44 |
+
|
| 45 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 46 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 47 |
+
return utils.implForWrapper(wrapper);
|
| 48 |
+
};
|
| 49 |
+
|
| 50 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 51 |
+
SVGGraphicsElement._internalSetup(wrapper, globalObject);
|
| 52 |
+
};
|
| 53 |
+
|
| 54 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 55 |
+
privateData.wrapper = wrapper;
|
| 56 |
+
|
| 57 |
+
exports._internalSetup(wrapper, globalObject);
|
| 58 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 59 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 60 |
+
configurable: true
|
| 61 |
+
});
|
| 62 |
+
|
| 63 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 64 |
+
if (Impl.init) {
|
| 65 |
+
Impl.init(wrapper[implSymbol]);
|
| 66 |
+
}
|
| 67 |
+
return wrapper;
|
| 68 |
+
};
|
| 69 |
+
|
| 70 |
+
exports.new = (globalObject, newTarget) => {
|
| 71 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 72 |
+
|
| 73 |
+
exports._internalSetup(wrapper, globalObject);
|
| 74 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 75 |
+
value: Object.create(Impl.implementation.prototype),
|
| 76 |
+
configurable: true
|
| 77 |
+
});
|
| 78 |
+
|
| 79 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 80 |
+
if (Impl.init) {
|
| 81 |
+
Impl.init(wrapper[implSymbol]);
|
| 82 |
+
}
|
| 83 |
+
return wrapper[implSymbol];
|
| 84 |
+
};
|
| 85 |
+
|
| 86 |
+
const exposed = new Set(["Window"]);
|
| 87 |
+
|
| 88 |
+
exports.install = (globalObject, globalNames) => {
|
| 89 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 90 |
+
return;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 94 |
+
class SVGSymbolElement extends globalObject.SVGGraphicsElement {
|
| 95 |
+
constructor() {
|
| 96 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
get viewBox() {
|
| 100 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 101 |
+
|
| 102 |
+
if (!exports.is(esValue)) {
|
| 103 |
+
throw new globalObject.TypeError(
|
| 104 |
+
"'get viewBox' called on an object that is not a valid instance of SVGSymbolElement."
|
| 105 |
+
);
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
return utils.getSameObject(this, "viewBox", () => {
|
| 109 |
+
return create_SVGAnimatedRect(globalObject, [], {
|
| 110 |
+
element: esValue[implSymbol],
|
| 111 |
+
attribute: "viewBox"
|
| 112 |
+
});
|
| 113 |
+
});
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
get preserveAspectRatio() {
|
| 117 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 118 |
+
|
| 119 |
+
if (!exports.is(esValue)) {
|
| 120 |
+
throw new globalObject.TypeError(
|
| 121 |
+
"'get preserveAspectRatio' called on an object that is not a valid instance of SVGSymbolElement."
|
| 122 |
+
);
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
return utils.getSameObject(this, "preserveAspectRatio", () => {
|
| 126 |
+
return create_SVGAnimatedPreserveAspectRatio(globalObject, [], {
|
| 127 |
+
element: esValue[implSymbol]
|
| 128 |
+
});
|
| 129 |
+
});
|
| 130 |
+
}
|
| 131 |
+
}
|
| 132 |
+
Object.defineProperties(SVGSymbolElement.prototype, {
|
| 133 |
+
viewBox: { enumerable: true },
|
| 134 |
+
preserveAspectRatio: { enumerable: true },
|
| 135 |
+
[Symbol.toStringTag]: { value: "SVGSymbolElement", configurable: true }
|
| 136 |
+
});
|
| 137 |
+
ctorRegistry[interfaceName] = SVGSymbolElement;
|
| 138 |
+
|
| 139 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 140 |
+
configurable: true,
|
| 141 |
+
writable: true,
|
| 142 |
+
value: SVGSymbolElement
|
| 143 |
+
});
|
| 144 |
+
};
|
| 145 |
+
|
| 146 |
+
const Impl = require("../nodes/SVGSymbolElement-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SVGTitleElement.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
const SVGElement = require("./SVGElement.js");
|
| 9 |
+
|
| 10 |
+
const interfaceName = "SVGTitleElement";
|
| 11 |
+
|
| 12 |
+
exports.is = value => {
|
| 13 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 14 |
+
};
|
| 15 |
+
exports.isImpl = value => {
|
| 16 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 19 |
+
if (exports.is(value)) {
|
| 20 |
+
return utils.implForWrapper(value);
|
| 21 |
+
}
|
| 22 |
+
throw new globalObject.TypeError(`${context} is not of type 'SVGTitleElement'.`);
|
| 23 |
+
};
|
| 24 |
+
|
| 25 |
+
function makeWrapper(globalObject, newTarget) {
|
| 26 |
+
let proto;
|
| 27 |
+
if (newTarget !== undefined) {
|
| 28 |
+
proto = newTarget.prototype;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
if (!utils.isObject(proto)) {
|
| 32 |
+
proto = globalObject[ctorRegistrySymbol]["SVGTitleElement"].prototype;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
return Object.create(proto);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 39 |
+
const wrapper = makeWrapper(globalObject);
|
| 40 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 44 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 45 |
+
return utils.implForWrapper(wrapper);
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 49 |
+
SVGElement._internalSetup(wrapper, globalObject);
|
| 50 |
+
};
|
| 51 |
+
|
| 52 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 53 |
+
privateData.wrapper = wrapper;
|
| 54 |
+
|
| 55 |
+
exports._internalSetup(wrapper, globalObject);
|
| 56 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 57 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 58 |
+
configurable: true
|
| 59 |
+
});
|
| 60 |
+
|
| 61 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 62 |
+
if (Impl.init) {
|
| 63 |
+
Impl.init(wrapper[implSymbol]);
|
| 64 |
+
}
|
| 65 |
+
return wrapper;
|
| 66 |
+
};
|
| 67 |
+
|
| 68 |
+
exports.new = (globalObject, newTarget) => {
|
| 69 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 70 |
+
|
| 71 |
+
exports._internalSetup(wrapper, globalObject);
|
| 72 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 73 |
+
value: Object.create(Impl.implementation.prototype),
|
| 74 |
+
configurable: true
|
| 75 |
+
});
|
| 76 |
+
|
| 77 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 78 |
+
if (Impl.init) {
|
| 79 |
+
Impl.init(wrapper[implSymbol]);
|
| 80 |
+
}
|
| 81 |
+
return wrapper[implSymbol];
|
| 82 |
+
};
|
| 83 |
+
|
| 84 |
+
const exposed = new Set(["Window"]);
|
| 85 |
+
|
| 86 |
+
exports.install = (globalObject, globalNames) => {
|
| 87 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 88 |
+
return;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 92 |
+
class SVGTitleElement extends globalObject.SVGElement {
|
| 93 |
+
constructor() {
|
| 94 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
Object.defineProperties(SVGTitleElement.prototype, {
|
| 98 |
+
[Symbol.toStringTag]: { value: "SVGTitleElement", configurable: true }
|
| 99 |
+
});
|
| 100 |
+
ctorRegistry[interfaceName] = SVGTitleElement;
|
| 101 |
+
|
| 102 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 103 |
+
configurable: true,
|
| 104 |
+
writable: true,
|
| 105 |
+
value: SVGTitleElement
|
| 106 |
+
});
|
| 107 |
+
};
|
| 108 |
+
|
| 109 |
+
const Impl = require("../nodes/SVGTitleElement-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/Screen.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "Screen";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'Screen'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["Screen"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 38 |
+
const wrapper = makeWrapper(globalObject);
|
| 39 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 43 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 44 |
+
return utils.implForWrapper(wrapper);
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 48 |
+
|
| 49 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 50 |
+
privateData.wrapper = wrapper;
|
| 51 |
+
|
| 52 |
+
exports._internalSetup(wrapper, globalObject);
|
| 53 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 54 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 55 |
+
configurable: true
|
| 56 |
+
});
|
| 57 |
+
|
| 58 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 59 |
+
if (Impl.init) {
|
| 60 |
+
Impl.init(wrapper[implSymbol]);
|
| 61 |
+
}
|
| 62 |
+
return wrapper;
|
| 63 |
+
};
|
| 64 |
+
|
| 65 |
+
exports.new = (globalObject, newTarget) => {
|
| 66 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 67 |
+
|
| 68 |
+
exports._internalSetup(wrapper, globalObject);
|
| 69 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 70 |
+
value: Object.create(Impl.implementation.prototype),
|
| 71 |
+
configurable: true
|
| 72 |
+
});
|
| 73 |
+
|
| 74 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 75 |
+
if (Impl.init) {
|
| 76 |
+
Impl.init(wrapper[implSymbol]);
|
| 77 |
+
}
|
| 78 |
+
return wrapper[implSymbol];
|
| 79 |
+
};
|
| 80 |
+
|
| 81 |
+
const exposed = new Set(["Window"]);
|
| 82 |
+
|
| 83 |
+
exports.install = (globalObject, globalNames) => {
|
| 84 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 85 |
+
return;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 89 |
+
class Screen {
|
| 90 |
+
constructor() {
|
| 91 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
get availWidth() {
|
| 95 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 96 |
+
|
| 97 |
+
if (!exports.is(esValue)) {
|
| 98 |
+
throw new globalObject.TypeError(
|
| 99 |
+
"'get availWidth' called on an object that is not a valid instance of Screen."
|
| 100 |
+
);
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
return esValue[implSymbol]["availWidth"];
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
get availHeight() {
|
| 107 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 108 |
+
|
| 109 |
+
if (!exports.is(esValue)) {
|
| 110 |
+
throw new globalObject.TypeError(
|
| 111 |
+
"'get availHeight' called on an object that is not a valid instance of Screen."
|
| 112 |
+
);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
return esValue[implSymbol]["availHeight"];
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
get width() {
|
| 119 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 120 |
+
|
| 121 |
+
if (!exports.is(esValue)) {
|
| 122 |
+
throw new globalObject.TypeError("'get width' called on an object that is not a valid instance of Screen.");
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
return esValue[implSymbol]["width"];
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
get height() {
|
| 129 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 130 |
+
|
| 131 |
+
if (!exports.is(esValue)) {
|
| 132 |
+
throw new globalObject.TypeError("'get height' called on an object that is not a valid instance of Screen.");
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
return esValue[implSymbol]["height"];
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
get colorDepth() {
|
| 139 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 140 |
+
|
| 141 |
+
if (!exports.is(esValue)) {
|
| 142 |
+
throw new globalObject.TypeError(
|
| 143 |
+
"'get colorDepth' called on an object that is not a valid instance of Screen."
|
| 144 |
+
);
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
return esValue[implSymbol]["colorDepth"];
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
get pixelDepth() {
|
| 151 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 152 |
+
|
| 153 |
+
if (!exports.is(esValue)) {
|
| 154 |
+
throw new globalObject.TypeError(
|
| 155 |
+
"'get pixelDepth' called on an object that is not a valid instance of Screen."
|
| 156 |
+
);
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
return esValue[implSymbol]["pixelDepth"];
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
Object.defineProperties(Screen.prototype, {
|
| 163 |
+
availWidth: { enumerable: true },
|
| 164 |
+
availHeight: { enumerable: true },
|
| 165 |
+
width: { enumerable: true },
|
| 166 |
+
height: { enumerable: true },
|
| 167 |
+
colorDepth: { enumerable: true },
|
| 168 |
+
pixelDepth: { enumerable: true },
|
| 169 |
+
[Symbol.toStringTag]: { value: "Screen", configurable: true }
|
| 170 |
+
});
|
| 171 |
+
ctorRegistry[interfaceName] = Screen;
|
| 172 |
+
|
| 173 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 174 |
+
configurable: true,
|
| 175 |
+
writable: true,
|
| 176 |
+
value: Screen
|
| 177 |
+
});
|
| 178 |
+
};
|
| 179 |
+
|
| 180 |
+
const Impl = require("../window/Screen-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/ScrollBehavior.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const enumerationValues = new Set(["auto", "instant", "smooth"]);
|
| 4 |
+
exports.enumerationValues = enumerationValues;
|
| 5 |
+
|
| 6 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 7 |
+
const string = `${value}`;
|
| 8 |
+
if (!enumerationValues.has(string)) {
|
| 9 |
+
throw new globalObject.TypeError(`${context} '${string}' is not a valid enumeration value for ScrollBehavior`);
|
| 10 |
+
}
|
| 11 |
+
return string;
|
| 12 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const ScrollLogicalPosition = require("./ScrollLogicalPosition.js");
|
| 7 |
+
const ScrollOptions = require("./ScrollOptions.js");
|
| 8 |
+
|
| 9 |
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
| 10 |
+
ScrollOptions._convertInherit(globalObject, obj, ret, { context });
|
| 11 |
+
|
| 12 |
+
{
|
| 13 |
+
const key = "block";
|
| 14 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 15 |
+
if (value !== undefined) {
|
| 16 |
+
value = ScrollLogicalPosition.convert(globalObject, value, { context: context + " has member 'block' that" });
|
| 17 |
+
|
| 18 |
+
ret[key] = value;
|
| 19 |
+
} else {
|
| 20 |
+
ret[key] = "start";
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
{
|
| 25 |
+
const key = "inline";
|
| 26 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 27 |
+
if (value !== undefined) {
|
| 28 |
+
value = ScrollLogicalPosition.convert(globalObject, value, { context: context + " has member 'inline' that" });
|
| 29 |
+
|
| 30 |
+
ret[key] = value;
|
| 31 |
+
} else {
|
| 32 |
+
ret[key] = "nearest";
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
};
|
| 36 |
+
|
| 37 |
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
| 38 |
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
| 39 |
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
const ret = Object.create(null);
|
| 43 |
+
exports._convertInherit(globalObject, obj, ret, { context });
|
| 44 |
+
return ret;
|
| 45 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/ScrollLogicalPosition.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const enumerationValues = new Set(["start", "center", "end", "nearest"]);
|
| 4 |
+
exports.enumerationValues = enumerationValues;
|
| 5 |
+
|
| 6 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 7 |
+
const string = `${value}`;
|
| 8 |
+
if (!enumerationValues.has(string)) {
|
| 9 |
+
throw new globalObject.TypeError(
|
| 10 |
+
`${context} '${string}' is not a valid enumeration value for ScrollLogicalPosition`
|
| 11 |
+
);
|
| 12 |
+
}
|
| 13 |
+
return string;
|
| 14 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/ScrollOptions.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const ScrollBehavior = require("./ScrollBehavior.js");
|
| 7 |
+
|
| 8 |
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
| 9 |
+
{
|
| 10 |
+
const key = "behavior";
|
| 11 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 12 |
+
if (value !== undefined) {
|
| 13 |
+
value = ScrollBehavior.convert(globalObject, value, { context: context + " has member 'behavior' that" });
|
| 14 |
+
|
| 15 |
+
ret[key] = value;
|
| 16 |
+
} else {
|
| 17 |
+
ret[key] = "auto";
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
};
|
| 21 |
+
|
| 22 |
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
| 23 |
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
| 24 |
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
const ret = Object.create(null);
|
| 28 |
+
exports._convertInherit(globalObject, obj, ret, { context });
|
| 29 |
+
return ret;
|
| 30 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/ScrollRestoration.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const enumerationValues = new Set(["auto", "manual"]);
|
| 4 |
+
exports.enumerationValues = enumerationValues;
|
| 5 |
+
|
| 6 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 7 |
+
const string = `${value}`;
|
| 8 |
+
if (!enumerationValues.has(string)) {
|
| 9 |
+
throw new globalObject.TypeError(`${context} '${string}' is not a valid enumeration value for ScrollRestoration`);
|
| 10 |
+
}
|
| 11 |
+
return string;
|
| 12 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/Selection.js
ADDED
|
@@ -0,0 +1,569 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const Range = require("./Range.js");
|
| 7 |
+
const Node = require("./Node.js");
|
| 8 |
+
const ceReactionsPreSteps_helpers_custom_elements = require("../helpers/custom-elements.js").ceReactionsPreSteps;
|
| 9 |
+
const ceReactionsPostSteps_helpers_custom_elements = require("../helpers/custom-elements.js").ceReactionsPostSteps;
|
| 10 |
+
const implSymbol = utils.implSymbol;
|
| 11 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 12 |
+
|
| 13 |
+
const interfaceName = "Selection";
|
| 14 |
+
|
| 15 |
+
exports.is = value => {
|
| 16 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 17 |
+
};
|
| 18 |
+
exports.isImpl = value => {
|
| 19 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 20 |
+
};
|
| 21 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 22 |
+
if (exports.is(value)) {
|
| 23 |
+
return utils.implForWrapper(value);
|
| 24 |
+
}
|
| 25 |
+
throw new globalObject.TypeError(`${context} is not of type 'Selection'.`);
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
function makeWrapper(globalObject, newTarget) {
|
| 29 |
+
let proto;
|
| 30 |
+
if (newTarget !== undefined) {
|
| 31 |
+
proto = newTarget.prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
if (!utils.isObject(proto)) {
|
| 35 |
+
proto = globalObject[ctorRegistrySymbol]["Selection"].prototype;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
return Object.create(proto);
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 42 |
+
const wrapper = makeWrapper(globalObject);
|
| 43 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 44 |
+
};
|
| 45 |
+
|
| 46 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 47 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 48 |
+
return utils.implForWrapper(wrapper);
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 52 |
+
|
| 53 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 54 |
+
privateData.wrapper = wrapper;
|
| 55 |
+
|
| 56 |
+
exports._internalSetup(wrapper, globalObject);
|
| 57 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 58 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 59 |
+
configurable: true
|
| 60 |
+
});
|
| 61 |
+
|
| 62 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 63 |
+
if (Impl.init) {
|
| 64 |
+
Impl.init(wrapper[implSymbol]);
|
| 65 |
+
}
|
| 66 |
+
return wrapper;
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
exports.new = (globalObject, newTarget) => {
|
| 70 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 71 |
+
|
| 72 |
+
exports._internalSetup(wrapper, globalObject);
|
| 73 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 74 |
+
value: Object.create(Impl.implementation.prototype),
|
| 75 |
+
configurable: true
|
| 76 |
+
});
|
| 77 |
+
|
| 78 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 79 |
+
if (Impl.init) {
|
| 80 |
+
Impl.init(wrapper[implSymbol]);
|
| 81 |
+
}
|
| 82 |
+
return wrapper[implSymbol];
|
| 83 |
+
};
|
| 84 |
+
|
| 85 |
+
const exposed = new Set(["Window"]);
|
| 86 |
+
|
| 87 |
+
exports.install = (globalObject, globalNames) => {
|
| 88 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 89 |
+
return;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 93 |
+
class Selection {
|
| 94 |
+
constructor() {
|
| 95 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
getRangeAt(index) {
|
| 99 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 100 |
+
if (!exports.is(esValue)) {
|
| 101 |
+
throw new globalObject.TypeError("'getRangeAt' called on an object that is not a valid instance of Selection.");
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
if (arguments.length < 1) {
|
| 105 |
+
throw new globalObject.TypeError(
|
| 106 |
+
`Failed to execute 'getRangeAt' on 'Selection': 1 argument required, but only ${arguments.length} present.`
|
| 107 |
+
);
|
| 108 |
+
}
|
| 109 |
+
const args = [];
|
| 110 |
+
{
|
| 111 |
+
let curArg = arguments[0];
|
| 112 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 113 |
+
context: "Failed to execute 'getRangeAt' on 'Selection': parameter 1",
|
| 114 |
+
globals: globalObject
|
| 115 |
+
});
|
| 116 |
+
args.push(curArg);
|
| 117 |
+
}
|
| 118 |
+
return utils.tryWrapperForImpl(esValue[implSymbol].getRangeAt(...args));
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
addRange(range) {
|
| 122 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 123 |
+
if (!exports.is(esValue)) {
|
| 124 |
+
throw new globalObject.TypeError("'addRange' called on an object that is not a valid instance of Selection.");
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
if (arguments.length < 1) {
|
| 128 |
+
throw new globalObject.TypeError(
|
| 129 |
+
`Failed to execute 'addRange' on 'Selection': 1 argument required, but only ${arguments.length} present.`
|
| 130 |
+
);
|
| 131 |
+
}
|
| 132 |
+
const args = [];
|
| 133 |
+
{
|
| 134 |
+
let curArg = arguments[0];
|
| 135 |
+
curArg = Range.convert(globalObject, curArg, {
|
| 136 |
+
context: "Failed to execute 'addRange' on 'Selection': parameter 1"
|
| 137 |
+
});
|
| 138 |
+
args.push(curArg);
|
| 139 |
+
}
|
| 140 |
+
return esValue[implSymbol].addRange(...args);
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
removeRange(range) {
|
| 144 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 145 |
+
if (!exports.is(esValue)) {
|
| 146 |
+
throw new globalObject.TypeError(
|
| 147 |
+
"'removeRange' called on an object that is not a valid instance of Selection."
|
| 148 |
+
);
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
if (arguments.length < 1) {
|
| 152 |
+
throw new globalObject.TypeError(
|
| 153 |
+
`Failed to execute 'removeRange' on 'Selection': 1 argument required, but only ${arguments.length} present.`
|
| 154 |
+
);
|
| 155 |
+
}
|
| 156 |
+
const args = [];
|
| 157 |
+
{
|
| 158 |
+
let curArg = arguments[0];
|
| 159 |
+
curArg = Range.convert(globalObject, curArg, {
|
| 160 |
+
context: "Failed to execute 'removeRange' on 'Selection': parameter 1"
|
| 161 |
+
});
|
| 162 |
+
args.push(curArg);
|
| 163 |
+
}
|
| 164 |
+
return esValue[implSymbol].removeRange(...args);
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
removeAllRanges() {
|
| 168 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 169 |
+
if (!exports.is(esValue)) {
|
| 170 |
+
throw new globalObject.TypeError(
|
| 171 |
+
"'removeAllRanges' called on an object that is not a valid instance of Selection."
|
| 172 |
+
);
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
return esValue[implSymbol].removeAllRanges();
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
empty() {
|
| 179 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 180 |
+
if (!exports.is(esValue)) {
|
| 181 |
+
throw new globalObject.TypeError("'empty' called on an object that is not a valid instance of Selection.");
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
return esValue[implSymbol].empty();
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
collapse(node) {
|
| 188 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 189 |
+
if (!exports.is(esValue)) {
|
| 190 |
+
throw new globalObject.TypeError("'collapse' called on an object that is not a valid instance of Selection.");
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
if (arguments.length < 1) {
|
| 194 |
+
throw new globalObject.TypeError(
|
| 195 |
+
`Failed to execute 'collapse' on 'Selection': 1 argument required, but only ${arguments.length} present.`
|
| 196 |
+
);
|
| 197 |
+
}
|
| 198 |
+
const args = [];
|
| 199 |
+
{
|
| 200 |
+
let curArg = arguments[0];
|
| 201 |
+
if (curArg === null || curArg === undefined) {
|
| 202 |
+
curArg = null;
|
| 203 |
+
} else {
|
| 204 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 205 |
+
context: "Failed to execute 'collapse' on 'Selection': parameter 1"
|
| 206 |
+
});
|
| 207 |
+
}
|
| 208 |
+
args.push(curArg);
|
| 209 |
+
}
|
| 210 |
+
{
|
| 211 |
+
let curArg = arguments[1];
|
| 212 |
+
if (curArg !== undefined) {
|
| 213 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 214 |
+
context: "Failed to execute 'collapse' on 'Selection': parameter 2",
|
| 215 |
+
globals: globalObject
|
| 216 |
+
});
|
| 217 |
+
} else {
|
| 218 |
+
curArg = 0;
|
| 219 |
+
}
|
| 220 |
+
args.push(curArg);
|
| 221 |
+
}
|
| 222 |
+
return esValue[implSymbol].collapse(...args);
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
setPosition(node) {
|
| 226 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 227 |
+
if (!exports.is(esValue)) {
|
| 228 |
+
throw new globalObject.TypeError(
|
| 229 |
+
"'setPosition' called on an object that is not a valid instance of Selection."
|
| 230 |
+
);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
if (arguments.length < 1) {
|
| 234 |
+
throw new globalObject.TypeError(
|
| 235 |
+
`Failed to execute 'setPosition' on 'Selection': 1 argument required, but only ${arguments.length} present.`
|
| 236 |
+
);
|
| 237 |
+
}
|
| 238 |
+
const args = [];
|
| 239 |
+
{
|
| 240 |
+
let curArg = arguments[0];
|
| 241 |
+
if (curArg === null || curArg === undefined) {
|
| 242 |
+
curArg = null;
|
| 243 |
+
} else {
|
| 244 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 245 |
+
context: "Failed to execute 'setPosition' on 'Selection': parameter 1"
|
| 246 |
+
});
|
| 247 |
+
}
|
| 248 |
+
args.push(curArg);
|
| 249 |
+
}
|
| 250 |
+
{
|
| 251 |
+
let curArg = arguments[1];
|
| 252 |
+
if (curArg !== undefined) {
|
| 253 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 254 |
+
context: "Failed to execute 'setPosition' on 'Selection': parameter 2",
|
| 255 |
+
globals: globalObject
|
| 256 |
+
});
|
| 257 |
+
} else {
|
| 258 |
+
curArg = 0;
|
| 259 |
+
}
|
| 260 |
+
args.push(curArg);
|
| 261 |
+
}
|
| 262 |
+
return esValue[implSymbol].setPosition(...args);
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
collapseToStart() {
|
| 266 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 267 |
+
if (!exports.is(esValue)) {
|
| 268 |
+
throw new globalObject.TypeError(
|
| 269 |
+
"'collapseToStart' called on an object that is not a valid instance of Selection."
|
| 270 |
+
);
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
return esValue[implSymbol].collapseToStart();
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
collapseToEnd() {
|
| 277 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 278 |
+
if (!exports.is(esValue)) {
|
| 279 |
+
throw new globalObject.TypeError(
|
| 280 |
+
"'collapseToEnd' called on an object that is not a valid instance of Selection."
|
| 281 |
+
);
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
return esValue[implSymbol].collapseToEnd();
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
extend(node) {
|
| 288 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 289 |
+
if (!exports.is(esValue)) {
|
| 290 |
+
throw new globalObject.TypeError("'extend' called on an object that is not a valid instance of Selection.");
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
if (arguments.length < 1) {
|
| 294 |
+
throw new globalObject.TypeError(
|
| 295 |
+
`Failed to execute 'extend' on 'Selection': 1 argument required, but only ${arguments.length} present.`
|
| 296 |
+
);
|
| 297 |
+
}
|
| 298 |
+
const args = [];
|
| 299 |
+
{
|
| 300 |
+
let curArg = arguments[0];
|
| 301 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 302 |
+
context: "Failed to execute 'extend' on 'Selection': parameter 1"
|
| 303 |
+
});
|
| 304 |
+
args.push(curArg);
|
| 305 |
+
}
|
| 306 |
+
{
|
| 307 |
+
let curArg = arguments[1];
|
| 308 |
+
if (curArg !== undefined) {
|
| 309 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 310 |
+
context: "Failed to execute 'extend' on 'Selection': parameter 2",
|
| 311 |
+
globals: globalObject
|
| 312 |
+
});
|
| 313 |
+
} else {
|
| 314 |
+
curArg = 0;
|
| 315 |
+
}
|
| 316 |
+
args.push(curArg);
|
| 317 |
+
}
|
| 318 |
+
return esValue[implSymbol].extend(...args);
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset) {
|
| 322 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 323 |
+
if (!exports.is(esValue)) {
|
| 324 |
+
throw new globalObject.TypeError(
|
| 325 |
+
"'setBaseAndExtent' called on an object that is not a valid instance of Selection."
|
| 326 |
+
);
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
if (arguments.length < 4) {
|
| 330 |
+
throw new globalObject.TypeError(
|
| 331 |
+
`Failed to execute 'setBaseAndExtent' on 'Selection': 4 arguments required, but only ${arguments.length} present.`
|
| 332 |
+
);
|
| 333 |
+
}
|
| 334 |
+
const args = [];
|
| 335 |
+
{
|
| 336 |
+
let curArg = arguments[0];
|
| 337 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 338 |
+
context: "Failed to execute 'setBaseAndExtent' on 'Selection': parameter 1"
|
| 339 |
+
});
|
| 340 |
+
args.push(curArg);
|
| 341 |
+
}
|
| 342 |
+
{
|
| 343 |
+
let curArg = arguments[1];
|
| 344 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 345 |
+
context: "Failed to execute 'setBaseAndExtent' on 'Selection': parameter 2",
|
| 346 |
+
globals: globalObject
|
| 347 |
+
});
|
| 348 |
+
args.push(curArg);
|
| 349 |
+
}
|
| 350 |
+
{
|
| 351 |
+
let curArg = arguments[2];
|
| 352 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 353 |
+
context: "Failed to execute 'setBaseAndExtent' on 'Selection': parameter 3"
|
| 354 |
+
});
|
| 355 |
+
args.push(curArg);
|
| 356 |
+
}
|
| 357 |
+
{
|
| 358 |
+
let curArg = arguments[3];
|
| 359 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 360 |
+
context: "Failed to execute 'setBaseAndExtent' on 'Selection': parameter 4",
|
| 361 |
+
globals: globalObject
|
| 362 |
+
});
|
| 363 |
+
args.push(curArg);
|
| 364 |
+
}
|
| 365 |
+
return esValue[implSymbol].setBaseAndExtent(...args);
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
selectAllChildren(node) {
|
| 369 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 370 |
+
if (!exports.is(esValue)) {
|
| 371 |
+
throw new globalObject.TypeError(
|
| 372 |
+
"'selectAllChildren' called on an object that is not a valid instance of Selection."
|
| 373 |
+
);
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
if (arguments.length < 1) {
|
| 377 |
+
throw new globalObject.TypeError(
|
| 378 |
+
`Failed to execute 'selectAllChildren' on 'Selection': 1 argument required, but only ${arguments.length} present.`
|
| 379 |
+
);
|
| 380 |
+
}
|
| 381 |
+
const args = [];
|
| 382 |
+
{
|
| 383 |
+
let curArg = arguments[0];
|
| 384 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 385 |
+
context: "Failed to execute 'selectAllChildren' on 'Selection': parameter 1"
|
| 386 |
+
});
|
| 387 |
+
args.push(curArg);
|
| 388 |
+
}
|
| 389 |
+
return esValue[implSymbol].selectAllChildren(...args);
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
deleteFromDocument() {
|
| 393 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 394 |
+
if (!exports.is(esValue)) {
|
| 395 |
+
throw new globalObject.TypeError(
|
| 396 |
+
"'deleteFromDocument' called on an object that is not a valid instance of Selection."
|
| 397 |
+
);
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
ceReactionsPreSteps_helpers_custom_elements(globalObject);
|
| 401 |
+
try {
|
| 402 |
+
return esValue[implSymbol].deleteFromDocument();
|
| 403 |
+
} finally {
|
| 404 |
+
ceReactionsPostSteps_helpers_custom_elements(globalObject);
|
| 405 |
+
}
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
containsNode(node) {
|
| 409 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 410 |
+
if (!exports.is(esValue)) {
|
| 411 |
+
throw new globalObject.TypeError(
|
| 412 |
+
"'containsNode' called on an object that is not a valid instance of Selection."
|
| 413 |
+
);
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
if (arguments.length < 1) {
|
| 417 |
+
throw new globalObject.TypeError(
|
| 418 |
+
`Failed to execute 'containsNode' on 'Selection': 1 argument required, but only ${arguments.length} present.`
|
| 419 |
+
);
|
| 420 |
+
}
|
| 421 |
+
const args = [];
|
| 422 |
+
{
|
| 423 |
+
let curArg = arguments[0];
|
| 424 |
+
curArg = Node.convert(globalObject, curArg, {
|
| 425 |
+
context: "Failed to execute 'containsNode' on 'Selection': parameter 1"
|
| 426 |
+
});
|
| 427 |
+
args.push(curArg);
|
| 428 |
+
}
|
| 429 |
+
{
|
| 430 |
+
let curArg = arguments[1];
|
| 431 |
+
if (curArg !== undefined) {
|
| 432 |
+
curArg = conversions["boolean"](curArg, {
|
| 433 |
+
context: "Failed to execute 'containsNode' on 'Selection': parameter 2",
|
| 434 |
+
globals: globalObject
|
| 435 |
+
});
|
| 436 |
+
} else {
|
| 437 |
+
curArg = false;
|
| 438 |
+
}
|
| 439 |
+
args.push(curArg);
|
| 440 |
+
}
|
| 441 |
+
return esValue[implSymbol].containsNode(...args);
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
toString() {
|
| 445 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 446 |
+
if (!exports.is(esValue)) {
|
| 447 |
+
throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of Selection.");
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
return esValue[implSymbol].toString();
|
| 451 |
+
}
|
| 452 |
+
|
| 453 |
+
get anchorNode() {
|
| 454 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 455 |
+
|
| 456 |
+
if (!exports.is(esValue)) {
|
| 457 |
+
throw new globalObject.TypeError(
|
| 458 |
+
"'get anchorNode' called on an object that is not a valid instance of Selection."
|
| 459 |
+
);
|
| 460 |
+
}
|
| 461 |
+
|
| 462 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["anchorNode"]);
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
get anchorOffset() {
|
| 466 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 467 |
+
|
| 468 |
+
if (!exports.is(esValue)) {
|
| 469 |
+
throw new globalObject.TypeError(
|
| 470 |
+
"'get anchorOffset' called on an object that is not a valid instance of Selection."
|
| 471 |
+
);
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
return esValue[implSymbol]["anchorOffset"];
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
get focusNode() {
|
| 478 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 479 |
+
|
| 480 |
+
if (!exports.is(esValue)) {
|
| 481 |
+
throw new globalObject.TypeError(
|
| 482 |
+
"'get focusNode' called on an object that is not a valid instance of Selection."
|
| 483 |
+
);
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["focusNode"]);
|
| 487 |
+
}
|
| 488 |
+
|
| 489 |
+
get focusOffset() {
|
| 490 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 491 |
+
|
| 492 |
+
if (!exports.is(esValue)) {
|
| 493 |
+
throw new globalObject.TypeError(
|
| 494 |
+
"'get focusOffset' called on an object that is not a valid instance of Selection."
|
| 495 |
+
);
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
return esValue[implSymbol]["focusOffset"];
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
+
get isCollapsed() {
|
| 502 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 503 |
+
|
| 504 |
+
if (!exports.is(esValue)) {
|
| 505 |
+
throw new globalObject.TypeError(
|
| 506 |
+
"'get isCollapsed' called on an object that is not a valid instance of Selection."
|
| 507 |
+
);
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
return esValue[implSymbol]["isCollapsed"];
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
get rangeCount() {
|
| 514 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 515 |
+
|
| 516 |
+
if (!exports.is(esValue)) {
|
| 517 |
+
throw new globalObject.TypeError(
|
| 518 |
+
"'get rangeCount' called on an object that is not a valid instance of Selection."
|
| 519 |
+
);
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
return esValue[implSymbol]["rangeCount"];
|
| 523 |
+
}
|
| 524 |
+
|
| 525 |
+
get type() {
|
| 526 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 527 |
+
|
| 528 |
+
if (!exports.is(esValue)) {
|
| 529 |
+
throw new globalObject.TypeError("'get type' called on an object that is not a valid instance of Selection.");
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
return esValue[implSymbol]["type"];
|
| 533 |
+
}
|
| 534 |
+
}
|
| 535 |
+
Object.defineProperties(Selection.prototype, {
|
| 536 |
+
getRangeAt: { enumerable: true },
|
| 537 |
+
addRange: { enumerable: true },
|
| 538 |
+
removeRange: { enumerable: true },
|
| 539 |
+
removeAllRanges: { enumerable: true },
|
| 540 |
+
empty: { enumerable: true },
|
| 541 |
+
collapse: { enumerable: true },
|
| 542 |
+
setPosition: { enumerable: true },
|
| 543 |
+
collapseToStart: { enumerable: true },
|
| 544 |
+
collapseToEnd: { enumerable: true },
|
| 545 |
+
extend: { enumerable: true },
|
| 546 |
+
setBaseAndExtent: { enumerable: true },
|
| 547 |
+
selectAllChildren: { enumerable: true },
|
| 548 |
+
deleteFromDocument: { enumerable: true },
|
| 549 |
+
containsNode: { enumerable: true },
|
| 550 |
+
toString: { enumerable: true },
|
| 551 |
+
anchorNode: { enumerable: true },
|
| 552 |
+
anchorOffset: { enumerable: true },
|
| 553 |
+
focusNode: { enumerable: true },
|
| 554 |
+
focusOffset: { enumerable: true },
|
| 555 |
+
isCollapsed: { enumerable: true },
|
| 556 |
+
rangeCount: { enumerable: true },
|
| 557 |
+
type: { enumerable: true },
|
| 558 |
+
[Symbol.toStringTag]: { value: "Selection", configurable: true }
|
| 559 |
+
});
|
| 560 |
+
ctorRegistry[interfaceName] = Selection;
|
| 561 |
+
|
| 562 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 563 |
+
configurable: true,
|
| 564 |
+
writable: true,
|
| 565 |
+
value: Selection
|
| 566 |
+
});
|
| 567 |
+
};
|
| 568 |
+
|
| 569 |
+
const Impl = require("../selection/Selection-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/SelectionMode.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const enumerationValues = new Set(["select", "start", "end", "preserve"]);
|
| 4 |
+
exports.enumerationValues = enumerationValues;
|
| 5 |
+
|
| 6 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 7 |
+
const string = `${value}`;
|
| 8 |
+
if (!enumerationValues.has(string)) {
|
| 9 |
+
throw new globalObject.TypeError(`${context} '${string}' is not a valid enumeration value for SelectionMode`);
|
| 10 |
+
}
|
| 11 |
+
return string;
|
| 12 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/ShadowRoot.js
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const ceReactionsPreSteps_helpers_custom_elements = require("../helpers/custom-elements.js").ceReactionsPreSteps;
|
| 7 |
+
const ceReactionsPostSteps_helpers_custom_elements = require("../helpers/custom-elements.js").ceReactionsPostSteps;
|
| 8 |
+
const implSymbol = utils.implSymbol;
|
| 9 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 10 |
+
const DocumentFragment = require("./DocumentFragment.js");
|
| 11 |
+
|
| 12 |
+
const interfaceName = "ShadowRoot";
|
| 13 |
+
|
| 14 |
+
exports.is = value => {
|
| 15 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.isImpl = value => {
|
| 18 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 19 |
+
};
|
| 20 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 21 |
+
if (exports.is(value)) {
|
| 22 |
+
return utils.implForWrapper(value);
|
| 23 |
+
}
|
| 24 |
+
throw new globalObject.TypeError(`${context} is not of type 'ShadowRoot'.`);
|
| 25 |
+
};
|
| 26 |
+
|
| 27 |
+
function makeWrapper(globalObject, newTarget) {
|
| 28 |
+
let proto;
|
| 29 |
+
if (newTarget !== undefined) {
|
| 30 |
+
proto = newTarget.prototype;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
if (!utils.isObject(proto)) {
|
| 34 |
+
proto = globalObject[ctorRegistrySymbol]["ShadowRoot"].prototype;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
return Object.create(proto);
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 41 |
+
const wrapper = makeWrapper(globalObject);
|
| 42 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 43 |
+
};
|
| 44 |
+
|
| 45 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 46 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 47 |
+
return utils.implForWrapper(wrapper);
|
| 48 |
+
};
|
| 49 |
+
|
| 50 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 51 |
+
DocumentFragment._internalSetup(wrapper, globalObject);
|
| 52 |
+
};
|
| 53 |
+
|
| 54 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 55 |
+
privateData.wrapper = wrapper;
|
| 56 |
+
|
| 57 |
+
exports._internalSetup(wrapper, globalObject);
|
| 58 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 59 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 60 |
+
configurable: true
|
| 61 |
+
});
|
| 62 |
+
|
| 63 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 64 |
+
if (Impl.init) {
|
| 65 |
+
Impl.init(wrapper[implSymbol]);
|
| 66 |
+
}
|
| 67 |
+
return wrapper;
|
| 68 |
+
};
|
| 69 |
+
|
| 70 |
+
exports.new = (globalObject, newTarget) => {
|
| 71 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 72 |
+
|
| 73 |
+
exports._internalSetup(wrapper, globalObject);
|
| 74 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 75 |
+
value: Object.create(Impl.implementation.prototype),
|
| 76 |
+
configurable: true
|
| 77 |
+
});
|
| 78 |
+
|
| 79 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 80 |
+
if (Impl.init) {
|
| 81 |
+
Impl.init(wrapper[implSymbol]);
|
| 82 |
+
}
|
| 83 |
+
return wrapper[implSymbol];
|
| 84 |
+
};
|
| 85 |
+
|
| 86 |
+
const exposed = new Set(["Window"]);
|
| 87 |
+
|
| 88 |
+
exports.install = (globalObject, globalNames) => {
|
| 89 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 90 |
+
return;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 94 |
+
class ShadowRoot extends globalObject.DocumentFragment {
|
| 95 |
+
constructor() {
|
| 96 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
get mode() {
|
| 100 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 101 |
+
|
| 102 |
+
if (!exports.is(esValue)) {
|
| 103 |
+
throw new globalObject.TypeError("'get mode' called on an object that is not a valid instance of ShadowRoot.");
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["mode"]);
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
get host() {
|
| 110 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 111 |
+
|
| 112 |
+
if (!exports.is(esValue)) {
|
| 113 |
+
throw new globalObject.TypeError("'get host' called on an object that is not a valid instance of ShadowRoot.");
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["host"]);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
get innerHTML() {
|
| 120 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 121 |
+
|
| 122 |
+
if (!exports.is(esValue)) {
|
| 123 |
+
throw new globalObject.TypeError(
|
| 124 |
+
"'get innerHTML' called on an object that is not a valid instance of ShadowRoot."
|
| 125 |
+
);
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
ceReactionsPreSteps_helpers_custom_elements(globalObject);
|
| 129 |
+
try {
|
| 130 |
+
return esValue[implSymbol]["innerHTML"];
|
| 131 |
+
} finally {
|
| 132 |
+
ceReactionsPostSteps_helpers_custom_elements(globalObject);
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
set innerHTML(V) {
|
| 137 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 138 |
+
|
| 139 |
+
if (!exports.is(esValue)) {
|
| 140 |
+
throw new globalObject.TypeError(
|
| 141 |
+
"'set innerHTML' called on an object that is not a valid instance of ShadowRoot."
|
| 142 |
+
);
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
V = conversions["DOMString"](V, {
|
| 146 |
+
context: "Failed to set the 'innerHTML' property on 'ShadowRoot': The provided value",
|
| 147 |
+
globals: globalObject,
|
| 148 |
+
treatNullAsEmptyString: true
|
| 149 |
+
});
|
| 150 |
+
|
| 151 |
+
ceReactionsPreSteps_helpers_custom_elements(globalObject);
|
| 152 |
+
try {
|
| 153 |
+
esValue[implSymbol]["innerHTML"] = V;
|
| 154 |
+
} finally {
|
| 155 |
+
ceReactionsPostSteps_helpers_custom_elements(globalObject);
|
| 156 |
+
}
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
get activeElement() {
|
| 160 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 161 |
+
|
| 162 |
+
if (!exports.is(esValue)) {
|
| 163 |
+
throw new globalObject.TypeError(
|
| 164 |
+
"'get activeElement' called on an object that is not a valid instance of ShadowRoot."
|
| 165 |
+
);
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
return utils.tryWrapperForImpl(esValue[implSymbol]["activeElement"]);
|
| 169 |
+
}
|
| 170 |
+
}
|
| 171 |
+
Object.defineProperties(ShadowRoot.prototype, {
|
| 172 |
+
mode: { enumerable: true },
|
| 173 |
+
host: { enumerable: true },
|
| 174 |
+
innerHTML: { enumerable: true },
|
| 175 |
+
activeElement: { enumerable: true },
|
| 176 |
+
[Symbol.toStringTag]: { value: "ShadowRoot", configurable: true }
|
| 177 |
+
});
|
| 178 |
+
ctorRegistry[interfaceName] = ShadowRoot;
|
| 179 |
+
|
| 180 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 181 |
+
configurable: true,
|
| 182 |
+
writable: true,
|
| 183 |
+
value: ShadowRoot
|
| 184 |
+
});
|
| 185 |
+
};
|
| 186 |
+
|
| 187 |
+
const Impl = require("../nodes/ShadowRoot-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/ShadowRootInit.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const ShadowRootMode = require("./ShadowRootMode.js");
|
| 7 |
+
|
| 8 |
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
| 9 |
+
{
|
| 10 |
+
const key = "mode";
|
| 11 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 12 |
+
if (value !== undefined) {
|
| 13 |
+
value = ShadowRootMode.convert(globalObject, value, { context: context + " has member 'mode' that" });
|
| 14 |
+
|
| 15 |
+
ret[key] = value;
|
| 16 |
+
} else {
|
| 17 |
+
throw new globalObject.TypeError("mode is required in 'ShadowRootInit'");
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
};
|
| 21 |
+
|
| 22 |
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
| 23 |
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
| 24 |
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
const ret = Object.create(null);
|
| 28 |
+
exports._convertInherit(globalObject, obj, ret, { context });
|
| 29 |
+
return ret;
|
| 30 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/ShadowRootMode.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const enumerationValues = new Set(["open", "closed"]);
|
| 4 |
+
exports.enumerationValues = enumerationValues;
|
| 5 |
+
|
| 6 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 7 |
+
const string = `${value}`;
|
| 8 |
+
if (!enumerationValues.has(string)) {
|
| 9 |
+
throw new globalObject.TypeError(`${context} '${string}' is not a valid enumeration value for ShadowRootMode`);
|
| 10 |
+
}
|
| 11 |
+
return string;
|
| 12 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/StaticRange.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const StaticRangeInit = require("./StaticRangeInit.js");
|
| 7 |
+
const implSymbol = utils.implSymbol;
|
| 8 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 9 |
+
const AbstractRange = require("./AbstractRange.js");
|
| 10 |
+
|
| 11 |
+
const interfaceName = "StaticRange";
|
| 12 |
+
|
| 13 |
+
exports.is = value => {
|
| 14 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 15 |
+
};
|
| 16 |
+
exports.isImpl = value => {
|
| 17 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 18 |
+
};
|
| 19 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 20 |
+
if (exports.is(value)) {
|
| 21 |
+
return utils.implForWrapper(value);
|
| 22 |
+
}
|
| 23 |
+
throw new globalObject.TypeError(`${context} is not of type 'StaticRange'.`);
|
| 24 |
+
};
|
| 25 |
+
|
| 26 |
+
function makeWrapper(globalObject, newTarget) {
|
| 27 |
+
let proto;
|
| 28 |
+
if (newTarget !== undefined) {
|
| 29 |
+
proto = newTarget.prototype;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
if (!utils.isObject(proto)) {
|
| 33 |
+
proto = globalObject[ctorRegistrySymbol]["StaticRange"].prototype;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
return Object.create(proto);
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 40 |
+
const wrapper = makeWrapper(globalObject);
|
| 41 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 45 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 46 |
+
return utils.implForWrapper(wrapper);
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
exports._internalSetup = (wrapper, globalObject) => {
|
| 50 |
+
AbstractRange._internalSetup(wrapper, globalObject);
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 54 |
+
privateData.wrapper = wrapper;
|
| 55 |
+
|
| 56 |
+
exports._internalSetup(wrapper, globalObject);
|
| 57 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 58 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 59 |
+
configurable: true
|
| 60 |
+
});
|
| 61 |
+
|
| 62 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 63 |
+
if (Impl.init) {
|
| 64 |
+
Impl.init(wrapper[implSymbol]);
|
| 65 |
+
}
|
| 66 |
+
return wrapper;
|
| 67 |
+
};
|
| 68 |
+
|
| 69 |
+
exports.new = (globalObject, newTarget) => {
|
| 70 |
+
const wrapper = makeWrapper(globalObject, newTarget);
|
| 71 |
+
|
| 72 |
+
exports._internalSetup(wrapper, globalObject);
|
| 73 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 74 |
+
value: Object.create(Impl.implementation.prototype),
|
| 75 |
+
configurable: true
|
| 76 |
+
});
|
| 77 |
+
|
| 78 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 79 |
+
if (Impl.init) {
|
| 80 |
+
Impl.init(wrapper[implSymbol]);
|
| 81 |
+
}
|
| 82 |
+
return wrapper[implSymbol];
|
| 83 |
+
};
|
| 84 |
+
|
| 85 |
+
const exposed = new Set(["Window"]);
|
| 86 |
+
|
| 87 |
+
exports.install = (globalObject, globalNames) => {
|
| 88 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 89 |
+
return;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 93 |
+
class StaticRange extends globalObject.AbstractRange {
|
| 94 |
+
constructor(init) {
|
| 95 |
+
if (arguments.length < 1) {
|
| 96 |
+
throw new globalObject.TypeError(
|
| 97 |
+
`Failed to construct 'StaticRange': 1 argument required, but only ${arguments.length} present.`
|
| 98 |
+
);
|
| 99 |
+
}
|
| 100 |
+
const args = [];
|
| 101 |
+
{
|
| 102 |
+
let curArg = arguments[0];
|
| 103 |
+
curArg = StaticRangeInit.convert(globalObject, curArg, {
|
| 104 |
+
context: "Failed to construct 'StaticRange': parameter 1"
|
| 105 |
+
});
|
| 106 |
+
args.push(curArg);
|
| 107 |
+
}
|
| 108 |
+
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
Object.defineProperties(StaticRange.prototype, {
|
| 112 |
+
[Symbol.toStringTag]: { value: "StaticRange", configurable: true }
|
| 113 |
+
});
|
| 114 |
+
ctorRegistry[interfaceName] = StaticRange;
|
| 115 |
+
|
| 116 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 117 |
+
configurable: true,
|
| 118 |
+
writable: true,
|
| 119 |
+
value: StaticRange
|
| 120 |
+
});
|
| 121 |
+
};
|
| 122 |
+
|
| 123 |
+
const Impl = require("../range/StaticRange-impl.js");
|
node_modules/jsdom/lib/jsdom/living/generated/StaticRangeInit.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const Node = require("./Node.js");
|
| 7 |
+
|
| 8 |
+
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
|
| 9 |
+
{
|
| 10 |
+
const key = "endContainer";
|
| 11 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 12 |
+
if (value !== undefined) {
|
| 13 |
+
value = Node.convert(globalObject, value, { context: context + " has member 'endContainer' that" });
|
| 14 |
+
|
| 15 |
+
ret[key] = value;
|
| 16 |
+
} else {
|
| 17 |
+
throw new globalObject.TypeError("endContainer is required in 'StaticRangeInit'");
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
{
|
| 22 |
+
const key = "endOffset";
|
| 23 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 24 |
+
if (value !== undefined) {
|
| 25 |
+
value = conversions["unsigned long"](value, {
|
| 26 |
+
context: context + " has member 'endOffset' that",
|
| 27 |
+
globals: globalObject
|
| 28 |
+
});
|
| 29 |
+
|
| 30 |
+
ret[key] = value;
|
| 31 |
+
} else {
|
| 32 |
+
throw new globalObject.TypeError("endOffset is required in 'StaticRangeInit'");
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
{
|
| 37 |
+
const key = "startContainer";
|
| 38 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 39 |
+
if (value !== undefined) {
|
| 40 |
+
value = Node.convert(globalObject, value, { context: context + " has member 'startContainer' that" });
|
| 41 |
+
|
| 42 |
+
ret[key] = value;
|
| 43 |
+
} else {
|
| 44 |
+
throw new globalObject.TypeError("startContainer is required in 'StaticRangeInit'");
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
{
|
| 49 |
+
const key = "startOffset";
|
| 50 |
+
let value = obj === undefined || obj === null ? undefined : obj[key];
|
| 51 |
+
if (value !== undefined) {
|
| 52 |
+
value = conversions["unsigned long"](value, {
|
| 53 |
+
context: context + " has member 'startOffset' that",
|
| 54 |
+
globals: globalObject
|
| 55 |
+
});
|
| 56 |
+
|
| 57 |
+
ret[key] = value;
|
| 58 |
+
} else {
|
| 59 |
+
throw new globalObject.TypeError("startOffset is required in 'StaticRangeInit'");
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
};
|
| 63 |
+
|
| 64 |
+
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {
|
| 65 |
+
if (obj !== undefined && typeof obj !== "object" && typeof obj !== "function") {
|
| 66 |
+
throw new globalObject.TypeError(`${context} is not an object.`);
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
const ret = Object.create(null);
|
| 70 |
+
exports._convertInherit(globalObject, obj, ret, { context });
|
| 71 |
+
return ret;
|
| 72 |
+
};
|
node_modules/jsdom/lib/jsdom/living/generated/Storage.js
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
const conversions = require("webidl-conversions");
|
| 4 |
+
const utils = require("./utils.js");
|
| 5 |
+
|
| 6 |
+
const implSymbol = utils.implSymbol;
|
| 7 |
+
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
| 8 |
+
|
| 9 |
+
const interfaceName = "Storage";
|
| 10 |
+
|
| 11 |
+
exports.is = value => {
|
| 12 |
+
return utils.isObject(value) && Object.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
| 13 |
+
};
|
| 14 |
+
exports.isImpl = value => {
|
| 15 |
+
return utils.isObject(value) && value instanceof Impl.implementation;
|
| 16 |
+
};
|
| 17 |
+
exports.convert = (globalObject, value, { context = "The provided value" } = {}) => {
|
| 18 |
+
if (exports.is(value)) {
|
| 19 |
+
return utils.implForWrapper(value);
|
| 20 |
+
}
|
| 21 |
+
throw new globalObject.TypeError(`${context} is not of type 'Storage'.`);
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
function makeWrapper(globalObject, newTarget) {
|
| 25 |
+
let proto;
|
| 26 |
+
if (newTarget !== undefined) {
|
| 27 |
+
proto = newTarget.prototype;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
if (!utils.isObject(proto)) {
|
| 31 |
+
proto = globalObject[ctorRegistrySymbol]["Storage"].prototype;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
return Object.create(proto);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
function makeProxy(wrapper, globalObject) {
|
| 38 |
+
let proxyHandler = proxyHandlerCache.get(globalObject);
|
| 39 |
+
if (proxyHandler === undefined) {
|
| 40 |
+
proxyHandler = new ProxyHandler(globalObject);
|
| 41 |
+
proxyHandlerCache.set(globalObject, proxyHandler);
|
| 42 |
+
}
|
| 43 |
+
return new Proxy(wrapper, proxyHandler);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
| 47 |
+
const wrapper = makeWrapper(globalObject);
|
| 48 |
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
| 52 |
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
| 53 |
+
return utils.implForWrapper(wrapper);
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
exports._internalSetup = (wrapper, globalObject) => {};
|
| 57 |
+
|
| 58 |
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
| 59 |
+
privateData.wrapper = wrapper;
|
| 60 |
+
|
| 61 |
+
exports._internalSetup(wrapper, globalObject);
|
| 62 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 63 |
+
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
| 64 |
+
configurable: true
|
| 65 |
+
});
|
| 66 |
+
|
| 67 |
+
wrapper = makeProxy(wrapper, globalObject);
|
| 68 |
+
|
| 69 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 70 |
+
if (Impl.init) {
|
| 71 |
+
Impl.init(wrapper[implSymbol]);
|
| 72 |
+
}
|
| 73 |
+
return wrapper;
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
exports.new = (globalObject, newTarget) => {
|
| 77 |
+
let wrapper = makeWrapper(globalObject, newTarget);
|
| 78 |
+
|
| 79 |
+
exports._internalSetup(wrapper, globalObject);
|
| 80 |
+
Object.defineProperty(wrapper, implSymbol, {
|
| 81 |
+
value: Object.create(Impl.implementation.prototype),
|
| 82 |
+
configurable: true
|
| 83 |
+
});
|
| 84 |
+
|
| 85 |
+
wrapper = makeProxy(wrapper, globalObject);
|
| 86 |
+
|
| 87 |
+
wrapper[implSymbol][utils.wrapperSymbol] = wrapper;
|
| 88 |
+
if (Impl.init) {
|
| 89 |
+
Impl.init(wrapper[implSymbol]);
|
| 90 |
+
}
|
| 91 |
+
return wrapper[implSymbol];
|
| 92 |
+
};
|
| 93 |
+
|
| 94 |
+
const exposed = new Set(["Window"]);
|
| 95 |
+
|
| 96 |
+
exports.install = (globalObject, globalNames) => {
|
| 97 |
+
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
| 98 |
+
return;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
| 102 |
+
class Storage {
|
| 103 |
+
constructor() {
|
| 104 |
+
throw new globalObject.TypeError("Illegal constructor");
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
key(index) {
|
| 108 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 109 |
+
if (!exports.is(esValue)) {
|
| 110 |
+
throw new globalObject.TypeError("'key' called on an object that is not a valid instance of Storage.");
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
if (arguments.length < 1) {
|
| 114 |
+
throw new globalObject.TypeError(
|
| 115 |
+
`Failed to execute 'key' on 'Storage': 1 argument required, but only ${arguments.length} present.`
|
| 116 |
+
);
|
| 117 |
+
}
|
| 118 |
+
const args = [];
|
| 119 |
+
{
|
| 120 |
+
let curArg = arguments[0];
|
| 121 |
+
curArg = conversions["unsigned long"](curArg, {
|
| 122 |
+
context: "Failed to execute 'key' on 'Storage': parameter 1",
|
| 123 |
+
globals: globalObject
|
| 124 |
+
});
|
| 125 |
+
args.push(curArg);
|
| 126 |
+
}
|
| 127 |
+
return esValue[implSymbol].key(...args);
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
getItem(key) {
|
| 131 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 132 |
+
if (!exports.is(esValue)) {
|
| 133 |
+
throw new globalObject.TypeError("'getItem' called on an object that is not a valid instance of Storage.");
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
if (arguments.length < 1) {
|
| 137 |
+
throw new globalObject.TypeError(
|
| 138 |
+
`Failed to execute 'getItem' on 'Storage': 1 argument required, but only ${arguments.length} present.`
|
| 139 |
+
);
|
| 140 |
+
}
|
| 141 |
+
const args = [];
|
| 142 |
+
{
|
| 143 |
+
let curArg = arguments[0];
|
| 144 |
+
curArg = conversions["DOMString"](curArg, {
|
| 145 |
+
context: "Failed to execute 'getItem' on 'Storage': parameter 1",
|
| 146 |
+
globals: globalObject
|
| 147 |
+
});
|
| 148 |
+
args.push(curArg);
|
| 149 |
+
}
|
| 150 |
+
return esValue[implSymbol].getItem(...args);
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
setItem(key, value) {
|
| 154 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 155 |
+
if (!exports.is(esValue)) {
|
| 156 |
+
throw new globalObject.TypeError("'setItem' called on an object that is not a valid instance of Storage.");
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
if (arguments.length < 2) {
|
| 160 |
+
throw new globalObject.TypeError(
|
| 161 |
+
`Failed to execute 'setItem' on 'Storage': 2 arguments required, but only ${arguments.length} present.`
|
| 162 |
+
);
|
| 163 |
+
}
|
| 164 |
+
const args = [];
|
| 165 |
+
{
|
| 166 |
+
let curArg = arguments[0];
|
| 167 |
+
curArg = conversions["DOMString"](curArg, {
|
| 168 |
+
context: "Failed to execute 'setItem' on 'Storage': parameter 1",
|
| 169 |
+
globals: globalObject
|
| 170 |
+
});
|
| 171 |
+
args.push(curArg);
|
| 172 |
+
}
|
| 173 |
+
{
|
| 174 |
+
let curArg = arguments[1];
|
| 175 |
+
curArg = conversions["DOMString"](curArg, {
|
| 176 |
+
context: "Failed to execute 'setItem' on 'Storage': parameter 2",
|
| 177 |
+
globals: globalObject
|
| 178 |
+
});
|
| 179 |
+
args.push(curArg);
|
| 180 |
+
}
|
| 181 |
+
return esValue[implSymbol].setItem(...args);
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
removeItem(key) {
|
| 185 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 186 |
+
if (!exports.is(esValue)) {
|
| 187 |
+
throw new globalObject.TypeError("'removeItem' called on an object that is not a valid instance of Storage.");
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
if (arguments.length < 1) {
|
| 191 |
+
throw new globalObject.TypeError(
|
| 192 |
+
`Failed to execute 'removeItem' on 'Storage': 1 argument required, but only ${arguments.length} present.`
|
| 193 |
+
);
|
| 194 |
+
}
|
| 195 |
+
const args = [];
|
| 196 |
+
{
|
| 197 |
+
let curArg = arguments[0];
|
| 198 |
+
curArg = conversions["DOMString"](curArg, {
|
| 199 |
+
context: "Failed to execute 'removeItem' on 'Storage': parameter 1",
|
| 200 |
+
globals: globalObject
|
| 201 |
+
});
|
| 202 |
+
args.push(curArg);
|
| 203 |
+
}
|
| 204 |
+
return esValue[implSymbol].removeItem(...args);
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
clear() {
|
| 208 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 209 |
+
if (!exports.is(esValue)) {
|
| 210 |
+
throw new globalObject.TypeError("'clear' called on an object that is not a valid instance of Storage.");
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
return esValue[implSymbol].clear();
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
get length() {
|
| 217 |
+
const esValue = this !== null && this !== undefined ? this : globalObject;
|
| 218 |
+
|
| 219 |
+
if (!exports.is(esValue)) {
|
| 220 |
+
throw new globalObject.TypeError("'get length' called on an object that is not a valid instance of Storage.");
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
return esValue[implSymbol]["length"];
|
| 224 |
+
}
|
| 225 |
+
}
|
| 226 |
+
Object.defineProperties(Storage.prototype, {
|
| 227 |
+
key: { enumerable: true },
|
| 228 |
+
getItem: { enumerable: true },
|
| 229 |
+
setItem: { enumerable: true },
|
| 230 |
+
removeItem: { enumerable: true },
|
| 231 |
+
clear: { enumerable: true },
|
| 232 |
+
length: { enumerable: true },
|
| 233 |
+
[Symbol.toStringTag]: { value: "Storage", configurable: true }
|
| 234 |
+
});
|
| 235 |
+
ctorRegistry[interfaceName] = Storage;
|
| 236 |
+
|
| 237 |
+
Object.defineProperty(globalObject, interfaceName, {
|
| 238 |
+
configurable: true,
|
| 239 |
+
writable: true,
|
| 240 |
+
value: Storage
|
| 241 |
+
});
|
| 242 |
+
};
|
| 243 |
+
|
| 244 |
+
const proxyHandlerCache = new WeakMap();
|
| 245 |
+
class ProxyHandler {
|
| 246 |
+
constructor(globalObject) {
|
| 247 |
+
this._globalObject = globalObject;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
get(target, P, receiver) {
|
| 251 |
+
if (typeof P === "symbol") {
|
| 252 |
+
return Reflect.get(target, P, receiver);
|
| 253 |
+
}
|
| 254 |
+
const desc = this.getOwnPropertyDescriptor(target, P);
|
| 255 |
+
if (desc === undefined) {
|
| 256 |
+
const parent = Object.getPrototypeOf(target);
|
| 257 |
+
if (parent === null) {
|
| 258 |
+
return undefined;
|
| 259 |
+
}
|
| 260 |
+
return Reflect.get(target, P, receiver);
|
| 261 |
+
}
|
| 262 |
+
if (!desc.get && !desc.set) {
|
| 263 |
+
return desc.value;
|
| 264 |
+
}
|
| 265 |
+
const getter = desc.get;
|
| 266 |
+
if (getter === undefined) {
|
| 267 |
+
return undefined;
|
| 268 |
+
}
|
| 269 |
+
return Reflect.apply(getter, receiver, []);
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
has(target, P) {
|
| 273 |
+
if (typeof P === "symbol") {
|
| 274 |
+
return Reflect.has(target, P);
|
| 275 |
+
}
|
| 276 |
+
const desc = this.getOwnPropertyDescriptor(target, P);
|
| 277 |
+
if (desc !== undefined) {
|
| 278 |
+
return true;
|
| 279 |
+
}
|
| 280 |
+
const parent = Object.getPrototypeOf(target);
|
| 281 |
+
if (parent !== null) {
|
| 282 |
+
return Reflect.has(parent, P);
|
| 283 |
+
}
|
| 284 |
+
return false;
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
ownKeys(target) {
|
| 288 |
+
const keys = new Set();
|
| 289 |
+
|
| 290 |
+
for (const key of target[implSymbol][utils.supportedPropertyNames]) {
|
| 291 |
+
if (!(key in target)) {
|
| 292 |
+
keys.add(`${key}`);
|
| 293 |
+
}
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
for (const key of Reflect.ownKeys(target)) {
|
| 297 |
+
keys.add(key);
|
| 298 |
+
}
|
| 299 |
+
return [...keys];
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
getOwnPropertyDescriptor(target, P) {
|
| 303 |
+
if (typeof P === "symbol") {
|
| 304 |
+
return Reflect.getOwnPropertyDescriptor(target, P);
|
| 305 |
+
}
|
| 306 |
+
let ignoreNamedProps = false;
|
| 307 |
+
|
| 308 |
+
const namedValue = target[implSymbol].getItem(P);
|
| 309 |
+
|
| 310 |
+
if (namedValue !== null && !(P in target) && !ignoreNamedProps) {
|
| 311 |
+
return {
|
| 312 |
+
writable: true,
|
| 313 |
+
enumerable: true,
|
| 314 |
+
configurable: true,
|
| 315 |
+
value: utils.tryWrapperForImpl(namedValue)
|
| 316 |
+
};
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
return Reflect.getOwnPropertyDescriptor(target, P);
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
set(target, P, V, receiver) {
|
| 323 |
+
if (typeof P === "symbol") {
|
| 324 |
+
return Reflect.set(target, P, V, receiver);
|
| 325 |
+
}
|
| 326 |
+
// The `receiver` argument refers to the Proxy exotic object or an object
|
| 327 |
+
// that inherits from it, whereas `target` refers to the Proxy target:
|
| 328 |
+
if (target[implSymbol][utils.wrapperSymbol] === receiver) {
|
| 329 |
+
const globalObject = this._globalObject;
|
| 330 |
+
|
| 331 |
+
if (typeof P === "string") {
|
| 332 |
+
let namedValue = V;
|
| 333 |
+
|
| 334 |
+
namedValue = conversions["DOMString"](namedValue, {
|
| 335 |
+
context: "Failed to set the '" + P + "' property on 'Storage': The provided value",
|
| 336 |
+
globals: globalObject
|
| 337 |
+
});
|
| 338 |
+
|
| 339 |
+
target[implSymbol].setItem(P, namedValue);
|
| 340 |
+
|
| 341 |
+
return true;
|
| 342 |
+
}
|
| 343 |
+
}
|
| 344 |
+
let ownDesc;
|
| 345 |
+
|
| 346 |
+
if (ownDesc === undefined) {
|
| 347 |
+
ownDesc = Reflect.getOwnPropertyDescriptor(target, P);
|
| 348 |
+
}
|
| 349 |
+
return utils.ordinarySetWithOwnDescriptor(target, P, V, receiver, ownDesc);
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
defineProperty(target, P, desc) {
|
| 353 |
+
if (typeof P === "symbol") {
|
| 354 |
+
return Reflect.defineProperty(target, P, desc);
|
| 355 |
+
}
|
| 356 |
+
|
| 357 |
+
const globalObject = this._globalObject;
|
| 358 |
+
if (!Object.hasOwn(target, P)) {
|
| 359 |
+
if (desc.get || desc.set) {
|
| 360 |
+
return false;
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
let namedValue = desc.value;
|
| 364 |
+
|
| 365 |
+
namedValue = conversions["DOMString"](namedValue, {
|
| 366 |
+
context: "Failed to set the '" + P + "' property on 'Storage': The provided value",
|
| 367 |
+
globals: globalObject
|
| 368 |
+
});
|
| 369 |
+
|
| 370 |
+
target[implSymbol].setItem(P, namedValue);
|
| 371 |
+
|
| 372 |
+
return true;
|
| 373 |
+
}
|
| 374 |
+
return Reflect.defineProperty(target, P, desc);
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
deleteProperty(target, P) {
|
| 378 |
+
if (typeof P === "symbol") {
|
| 379 |
+
return Reflect.deleteProperty(target, P);
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
const globalObject = this._globalObject;
|
| 383 |
+
|
| 384 |
+
if (target[implSymbol].getItem(P) !== null && !(P in target)) {
|
| 385 |
+
target[implSymbol].removeItem(P);
|
| 386 |
+
return true;
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
return Reflect.deleteProperty(target, P);
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
preventExtensions() {
|
| 393 |
+
return false;
|
| 394 |
+
}
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
const Impl = require("../webstorage/Storage-impl.js");
|