@lvce-editor/preview-sandbox-worker 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/previewSandBoxWorkerMain.js +117 -102
- package/package.json +1 -1
|
@@ -1232,6 +1232,10 @@ const set$1 = (uid, instance) => {
|
|
|
1232
1232
|
states$1.set(uid, instance);
|
|
1233
1233
|
};
|
|
1234
1234
|
|
|
1235
|
+
const mergeClassNames = (...classNames) => {
|
|
1236
|
+
return classNames.filter(Boolean).join(' ');
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1235
1239
|
const text = data => {
|
|
1236
1240
|
return {
|
|
1237
1241
|
childCount: 0,
|
|
@@ -1240,6 +1244,8 @@ const text = data => {
|
|
|
1240
1244
|
};
|
|
1241
1245
|
};
|
|
1242
1246
|
|
|
1247
|
+
const Body = 'Body';
|
|
1248
|
+
|
|
1243
1249
|
const Div = 'div';
|
|
1244
1250
|
const H1 = 'h1';
|
|
1245
1251
|
const H2 = 'h2';
|
|
@@ -1552,6 +1558,15 @@ const serialize = (document, elementMap = Object.create(null)) => {
|
|
|
1552
1558
|
for (let i = 0; i < childNodes.length; i++) {
|
|
1553
1559
|
rootChildCount += serializeNode(childNodes[i], dom, css, context);
|
|
1554
1560
|
}
|
|
1561
|
+
const bodyNode = {
|
|
1562
|
+
childCount: rootChildCount,
|
|
1563
|
+
type: Div$1
|
|
1564
|
+
};
|
|
1565
|
+
if (document.body) {
|
|
1566
|
+
applyAllowedAttributes(bodyNode, document.body);
|
|
1567
|
+
}
|
|
1568
|
+
bodyNode.className = bodyNode.className ? mergeClassNames(Body, bodyNode.className) : Body;
|
|
1569
|
+
dom.unshift(bodyNode);
|
|
1555
1570
|
return {
|
|
1556
1571
|
css,
|
|
1557
1572
|
dom
|
|
@@ -2232,7 +2247,7 @@ var hasRequiredLib;
|
|
|
2232
2247
|
function requireLib () {
|
|
2233
2248
|
if (hasRequiredLib) return lib;
|
|
2234
2249
|
hasRequiredLib = 1;
|
|
2235
|
-
(function (exports
|
|
2250
|
+
(function (exports) {
|
|
2236
2251
|
|
|
2237
2252
|
function makeException(ErrorType, message, options) {
|
|
2238
2253
|
if (options.globals) {
|
|
@@ -2367,51 +2382,51 @@ function requireLib () {
|
|
|
2367
2382
|
return Number(xBigInt);
|
|
2368
2383
|
};
|
|
2369
2384
|
}
|
|
2370
|
-
exports
|
|
2385
|
+
exports.any = value => {
|
|
2371
2386
|
return value;
|
|
2372
2387
|
};
|
|
2373
|
-
exports
|
|
2388
|
+
exports.undefined = () => {
|
|
2374
2389
|
return undefined;
|
|
2375
2390
|
};
|
|
2376
|
-
exports
|
|
2391
|
+
exports.boolean = value => {
|
|
2377
2392
|
return Boolean(value);
|
|
2378
2393
|
};
|
|
2379
|
-
exports
|
|
2394
|
+
exports.byte = createIntegerConversion(8, {
|
|
2380
2395
|
unsigned: false
|
|
2381
2396
|
});
|
|
2382
|
-
exports
|
|
2397
|
+
exports.octet = createIntegerConversion(8, {
|
|
2383
2398
|
unsigned: true
|
|
2384
2399
|
});
|
|
2385
|
-
exports
|
|
2400
|
+
exports.short = createIntegerConversion(16, {
|
|
2386
2401
|
unsigned: false
|
|
2387
2402
|
});
|
|
2388
|
-
exports
|
|
2403
|
+
exports["unsigned short"] = createIntegerConversion(16, {
|
|
2389
2404
|
unsigned: true
|
|
2390
2405
|
});
|
|
2391
|
-
exports
|
|
2406
|
+
exports.long = createIntegerConversion(32, {
|
|
2392
2407
|
unsigned: false
|
|
2393
2408
|
});
|
|
2394
|
-
exports
|
|
2409
|
+
exports["unsigned long"] = createIntegerConversion(32, {
|
|
2395
2410
|
unsigned: true
|
|
2396
2411
|
});
|
|
2397
|
-
exports
|
|
2412
|
+
exports["long long"] = createLongLongConversion(64, {
|
|
2398
2413
|
unsigned: false
|
|
2399
2414
|
});
|
|
2400
|
-
exports
|
|
2415
|
+
exports["unsigned long long"] = createLongLongConversion(64, {
|
|
2401
2416
|
unsigned: true
|
|
2402
2417
|
});
|
|
2403
|
-
exports
|
|
2418
|
+
exports.double = (value, options = {}) => {
|
|
2404
2419
|
const x = toNumber(value, options);
|
|
2405
2420
|
if (!Number.isFinite(x)) {
|
|
2406
2421
|
throw makeException(TypeError, "is not a finite floating-point value", options);
|
|
2407
2422
|
}
|
|
2408
2423
|
return x;
|
|
2409
2424
|
};
|
|
2410
|
-
exports
|
|
2425
|
+
exports["unrestricted double"] = (value, options = {}) => {
|
|
2411
2426
|
const x = toNumber(value, options);
|
|
2412
2427
|
return x;
|
|
2413
2428
|
};
|
|
2414
|
-
exports
|
|
2429
|
+
exports.float = (value, options = {}) => {
|
|
2415
2430
|
const x = toNumber(value, options);
|
|
2416
2431
|
if (!Number.isFinite(x)) {
|
|
2417
2432
|
throw makeException(TypeError, "is not a finite floating-point value", options);
|
|
@@ -2425,7 +2440,7 @@ function requireLib () {
|
|
|
2425
2440
|
}
|
|
2426
2441
|
return y;
|
|
2427
2442
|
};
|
|
2428
|
-
exports
|
|
2443
|
+
exports["unrestricted float"] = (value, options = {}) => {
|
|
2429
2444
|
const x = toNumber(value, options);
|
|
2430
2445
|
if (isNaN(x)) {
|
|
2431
2446
|
return x;
|
|
@@ -2435,7 +2450,7 @@ function requireLib () {
|
|
|
2435
2450
|
}
|
|
2436
2451
|
return Math.fround(x);
|
|
2437
2452
|
};
|
|
2438
|
-
exports
|
|
2453
|
+
exports.DOMString = (value, options = {}) => {
|
|
2439
2454
|
if (options.treatNullAsEmptyString && value === null) {
|
|
2440
2455
|
return "";
|
|
2441
2456
|
}
|
|
@@ -2445,8 +2460,8 @@ function requireLib () {
|
|
|
2445
2460
|
const StringCtor = options.globals ? options.globals.String : String;
|
|
2446
2461
|
return StringCtor(value);
|
|
2447
2462
|
};
|
|
2448
|
-
exports
|
|
2449
|
-
const x = exports
|
|
2463
|
+
exports.ByteString = (value, options = {}) => {
|
|
2464
|
+
const x = exports.DOMString(value, options);
|
|
2450
2465
|
let c;
|
|
2451
2466
|
for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {
|
|
2452
2467
|
if (c > 255) {
|
|
@@ -2455,8 +2470,8 @@ function requireLib () {
|
|
|
2455
2470
|
}
|
|
2456
2471
|
return x;
|
|
2457
2472
|
};
|
|
2458
|
-
exports
|
|
2459
|
-
const S = exports
|
|
2473
|
+
exports.USVString = (value, options = {}) => {
|
|
2474
|
+
const S = exports.DOMString(value, options);
|
|
2460
2475
|
const n = S.length;
|
|
2461
2476
|
const U = [];
|
|
2462
2477
|
for (let i = 0; i < n; ++i) {
|
|
@@ -2481,7 +2496,7 @@ function requireLib () {
|
|
|
2481
2496
|
}
|
|
2482
2497
|
return U.join("");
|
|
2483
2498
|
};
|
|
2484
|
-
exports
|
|
2499
|
+
exports.object = (value, options = {}) => {
|
|
2485
2500
|
if (value === null || typeof value !== "object" && typeof value !== "function") {
|
|
2486
2501
|
throw makeException(TypeError, "is not an object", options);
|
|
2487
2502
|
}
|
|
@@ -2516,7 +2531,7 @@ function requireLib () {
|
|
|
2516
2531
|
return true;
|
|
2517
2532
|
}
|
|
2518
2533
|
}
|
|
2519
|
-
exports
|
|
2534
|
+
exports.ArrayBuffer = (value, options = {}) => {
|
|
2520
2535
|
if (!isNonSharedArrayBuffer(value)) {
|
|
2521
2536
|
if (options.allowShared && !isSharedArrayBuffer(value)) {
|
|
2522
2537
|
throw makeException(TypeError, "is not an ArrayBuffer or SharedArrayBuffer", options);
|
|
@@ -2529,7 +2544,7 @@ function requireLib () {
|
|
|
2529
2544
|
return value;
|
|
2530
2545
|
};
|
|
2531
2546
|
const dvByteLengthGetter = Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get;
|
|
2532
|
-
exports
|
|
2547
|
+
exports.DataView = (value, options = {}) => {
|
|
2533
2548
|
try {
|
|
2534
2549
|
dvByteLengthGetter.call(value);
|
|
2535
2550
|
} catch (e) {
|
|
@@ -2554,7 +2569,7 @@ function requireLib () {
|
|
|
2554
2569
|
name
|
|
2555
2570
|
} = func;
|
|
2556
2571
|
const article = /^[AEIOU]/u.test(name) ? "an" : "a";
|
|
2557
|
-
exports
|
|
2572
|
+
exports[name] = (value, options = {}) => {
|
|
2558
2573
|
if (!ArrayBuffer.isView(value) || typedArrayNameGetter.call(value) !== name) {
|
|
2559
2574
|
throw makeException(TypeError, `is not ${article} ${name} object`, options);
|
|
2560
2575
|
}
|
|
@@ -2570,7 +2585,7 @@ function requireLib () {
|
|
|
2570
2585
|
|
|
2571
2586
|
// Common definitions
|
|
2572
2587
|
|
|
2573
|
-
exports
|
|
2588
|
+
exports.ArrayBufferView = (value, options = {}) => {
|
|
2574
2589
|
if (!ArrayBuffer.isView(value)) {
|
|
2575
2590
|
throw makeException(TypeError, "is not a view on an ArrayBuffer or SharedArrayBuffer", options);
|
|
2576
2591
|
}
|
|
@@ -2582,7 +2597,7 @@ function requireLib () {
|
|
|
2582
2597
|
}
|
|
2583
2598
|
return value;
|
|
2584
2599
|
};
|
|
2585
|
-
exports
|
|
2600
|
+
exports.BufferSource = (value, options = {}) => {
|
|
2586
2601
|
if (ArrayBuffer.isView(value)) {
|
|
2587
2602
|
if (!options.allowShared && isSharedArrayBuffer(value.buffer)) {
|
|
2588
2603
|
throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options);
|
|
@@ -2603,7 +2618,7 @@ function requireLib () {
|
|
|
2603
2618
|
}
|
|
2604
2619
|
return value;
|
|
2605
2620
|
};
|
|
2606
|
-
exports
|
|
2621
|
+
exports.DOMTimeStamp = exports["unsigned long long"];
|
|
2607
2622
|
} (lib));
|
|
2608
2623
|
return lib;
|
|
2609
2624
|
}
|
|
@@ -2615,7 +2630,7 @@ var hasRequiredUtils$1;
|
|
|
2615
2630
|
function requireUtils$1 () {
|
|
2616
2631
|
if (hasRequiredUtils$1) return utils$1.exports;
|
|
2617
2632
|
hasRequiredUtils$1 = 1;
|
|
2618
|
-
(function (module, exports
|
|
2633
|
+
(function (module, exports) {
|
|
2619
2634
|
|
|
2620
2635
|
// Returns "Type(value) is Object" in ES terminology.
|
|
2621
2636
|
function isObject(value) {
|
|
@@ -53754,7 +53769,7 @@ var hasRequiredURLSearchParams;
|
|
|
53754
53769
|
function requireURLSearchParams () {
|
|
53755
53770
|
if (hasRequiredURLSearchParams) return URLSearchParams;
|
|
53756
53771
|
hasRequiredURLSearchParams = 1;
|
|
53757
|
-
(function (exports
|
|
53772
|
+
(function (exports) {
|
|
53758
53773
|
|
|
53759
53774
|
const conversions = requireLib();
|
|
53760
53775
|
const utils = requireUtils$1();
|
|
@@ -53763,21 +53778,21 @@ function requireURLSearchParams () {
|
|
|
53763
53778
|
const implSymbol = utils.implSymbol;
|
|
53764
53779
|
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
|
53765
53780
|
const interfaceName = "URLSearchParams";
|
|
53766
|
-
exports
|
|
53781
|
+
exports.is = value => {
|
|
53767
53782
|
return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
|
53768
53783
|
};
|
|
53769
|
-
exports
|
|
53784
|
+
exports.isImpl = value => {
|
|
53770
53785
|
return utils.isObject(value) && value instanceof Impl.implementation;
|
|
53771
53786
|
};
|
|
53772
|
-
exports
|
|
53787
|
+
exports.convert = (globalObject, value, {
|
|
53773
53788
|
context = "The provided value"
|
|
53774
53789
|
} = {}) => {
|
|
53775
|
-
if (exports
|
|
53790
|
+
if (exports.is(value)) {
|
|
53776
53791
|
return utils.implForWrapper(value);
|
|
53777
53792
|
}
|
|
53778
53793
|
throw new globalObject.TypeError(`${context} is not of type 'URLSearchParams'.`);
|
|
53779
53794
|
};
|
|
53780
|
-
exports
|
|
53795
|
+
exports.createDefaultIterator = (globalObject, target, kind) => {
|
|
53781
53796
|
const ctorRegistry = globalObject[ctorRegistrySymbol];
|
|
53782
53797
|
const iteratorPrototype = ctorRegistry["URLSearchParams Iterator"];
|
|
53783
53798
|
const iterator = Object.create(iteratorPrototype);
|
|
@@ -53801,18 +53816,18 @@ function requireURLSearchParams () {
|
|
|
53801
53816
|
}
|
|
53802
53817
|
return Object.create(proto);
|
|
53803
53818
|
}
|
|
53804
|
-
exports
|
|
53819
|
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
|
53805
53820
|
const wrapper = makeWrapper(globalObject);
|
|
53806
|
-
return exports
|
|
53821
|
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
|
53807
53822
|
};
|
|
53808
|
-
exports
|
|
53809
|
-
const wrapper = exports
|
|
53823
|
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
|
53824
|
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
|
53810
53825
|
return utils.implForWrapper(wrapper);
|
|
53811
53826
|
};
|
|
53812
|
-
exports
|
|
53813
|
-
exports
|
|
53827
|
+
exports._internalSetup = (wrapper, globalObject) => {};
|
|
53828
|
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
|
53814
53829
|
privateData.wrapper = wrapper;
|
|
53815
|
-
exports
|
|
53830
|
+
exports._internalSetup(wrapper, globalObject);
|
|
53816
53831
|
Object.defineProperty(wrapper, implSymbol, {
|
|
53817
53832
|
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
|
53818
53833
|
configurable: true
|
|
@@ -53823,9 +53838,9 @@ function requireURLSearchParams () {
|
|
|
53823
53838
|
}
|
|
53824
53839
|
return wrapper;
|
|
53825
53840
|
};
|
|
53826
|
-
exports
|
|
53841
|
+
exports.new = (globalObject, newTarget) => {
|
|
53827
53842
|
const wrapper = makeWrapper(globalObject, newTarget);
|
|
53828
|
-
exports
|
|
53843
|
+
exports._internalSetup(wrapper, globalObject);
|
|
53829
53844
|
Object.defineProperty(wrapper, implSymbol, {
|
|
53830
53845
|
value: Object.create(Impl.implementation.prototype),
|
|
53831
53846
|
configurable: true
|
|
@@ -53837,7 +53852,7 @@ function requireURLSearchParams () {
|
|
|
53837
53852
|
return wrapper[implSymbol];
|
|
53838
53853
|
};
|
|
53839
53854
|
const exposed = new Set(["Window", "Worker"]);
|
|
53840
|
-
exports
|
|
53855
|
+
exports.install = (globalObject, globalNames) => {
|
|
53841
53856
|
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
|
53842
53857
|
return;
|
|
53843
53858
|
}
|
|
@@ -53909,11 +53924,11 @@ function requireURLSearchParams () {
|
|
|
53909
53924
|
}
|
|
53910
53925
|
args.push(curArg);
|
|
53911
53926
|
}
|
|
53912
|
-
return exports
|
|
53927
|
+
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
|
53913
53928
|
}
|
|
53914
53929
|
append(name, value) {
|
|
53915
53930
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
53916
|
-
if (!exports
|
|
53931
|
+
if (!exports.is(esValue)) {
|
|
53917
53932
|
throw new globalObject.TypeError("'append' called on an object that is not a valid instance of URLSearchParams.");
|
|
53918
53933
|
}
|
|
53919
53934
|
if (arguments.length < 2) {
|
|
@@ -53940,7 +53955,7 @@ function requireURLSearchParams () {
|
|
|
53940
53955
|
}
|
|
53941
53956
|
delete(name) {
|
|
53942
53957
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
53943
|
-
if (!exports
|
|
53958
|
+
if (!exports.is(esValue)) {
|
|
53944
53959
|
throw new globalObject.TypeError("'delete' called on an object that is not a valid instance of URLSearchParams.");
|
|
53945
53960
|
}
|
|
53946
53961
|
if (arguments.length < 1) {
|
|
@@ -53969,7 +53984,7 @@ function requireURLSearchParams () {
|
|
|
53969
53984
|
}
|
|
53970
53985
|
get(name) {
|
|
53971
53986
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
53972
|
-
if (!exports
|
|
53987
|
+
if (!exports.is(esValue)) {
|
|
53973
53988
|
throw new globalObject.TypeError("'get' called on an object that is not a valid instance of URLSearchParams.");
|
|
53974
53989
|
}
|
|
53975
53990
|
if (arguments.length < 1) {
|
|
@@ -53988,7 +54003,7 @@ function requireURLSearchParams () {
|
|
|
53988
54003
|
}
|
|
53989
54004
|
getAll(name) {
|
|
53990
54005
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
53991
|
-
if (!exports
|
|
54006
|
+
if (!exports.is(esValue)) {
|
|
53992
54007
|
throw new globalObject.TypeError("'getAll' called on an object that is not a valid instance of URLSearchParams.");
|
|
53993
54008
|
}
|
|
53994
54009
|
if (arguments.length < 1) {
|
|
@@ -54007,7 +54022,7 @@ function requireURLSearchParams () {
|
|
|
54007
54022
|
}
|
|
54008
54023
|
has(name) {
|
|
54009
54024
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54010
|
-
if (!exports
|
|
54025
|
+
if (!exports.is(esValue)) {
|
|
54011
54026
|
throw new globalObject.TypeError("'has' called on an object that is not a valid instance of URLSearchParams.");
|
|
54012
54027
|
}
|
|
54013
54028
|
if (arguments.length < 1) {
|
|
@@ -54036,7 +54051,7 @@ function requireURLSearchParams () {
|
|
|
54036
54051
|
}
|
|
54037
54052
|
set(name, value) {
|
|
54038
54053
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54039
|
-
if (!exports
|
|
54054
|
+
if (!exports.is(esValue)) {
|
|
54040
54055
|
throw new globalObject.TypeError("'set' called on an object that is not a valid instance of URLSearchParams.");
|
|
54041
54056
|
}
|
|
54042
54057
|
if (arguments.length < 2) {
|
|
@@ -54063,38 +54078,38 @@ function requireURLSearchParams () {
|
|
|
54063
54078
|
}
|
|
54064
54079
|
sort() {
|
|
54065
54080
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54066
|
-
if (!exports
|
|
54081
|
+
if (!exports.is(esValue)) {
|
|
54067
54082
|
throw new globalObject.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams.");
|
|
54068
54083
|
}
|
|
54069
54084
|
return utils.tryWrapperForImpl(esValue[implSymbol].sort());
|
|
54070
54085
|
}
|
|
54071
54086
|
toString() {
|
|
54072
54087
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54073
|
-
if (!exports
|
|
54088
|
+
if (!exports.is(esValue)) {
|
|
54074
54089
|
throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of URLSearchParams.");
|
|
54075
54090
|
}
|
|
54076
54091
|
return esValue[implSymbol].toString();
|
|
54077
54092
|
}
|
|
54078
54093
|
keys() {
|
|
54079
|
-
if (!exports
|
|
54094
|
+
if (!exports.is(this)) {
|
|
54080
54095
|
throw new globalObject.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams.");
|
|
54081
54096
|
}
|
|
54082
|
-
return exports
|
|
54097
|
+
return exports.createDefaultIterator(globalObject, this, "key");
|
|
54083
54098
|
}
|
|
54084
54099
|
values() {
|
|
54085
|
-
if (!exports
|
|
54100
|
+
if (!exports.is(this)) {
|
|
54086
54101
|
throw new globalObject.TypeError("'values' called on an object that is not a valid instance of URLSearchParams.");
|
|
54087
54102
|
}
|
|
54088
|
-
return exports
|
|
54103
|
+
return exports.createDefaultIterator(globalObject, this, "value");
|
|
54089
54104
|
}
|
|
54090
54105
|
entries() {
|
|
54091
|
-
if (!exports
|
|
54106
|
+
if (!exports.is(this)) {
|
|
54092
54107
|
throw new globalObject.TypeError("'entries' called on an object that is not a valid instance of URLSearchParams.");
|
|
54093
54108
|
}
|
|
54094
|
-
return exports
|
|
54109
|
+
return exports.createDefaultIterator(globalObject, this, "key+value");
|
|
54095
54110
|
}
|
|
54096
54111
|
forEach(callback) {
|
|
54097
|
-
if (!exports
|
|
54112
|
+
if (!exports.is(this)) {
|
|
54098
54113
|
throw new globalObject.TypeError("'forEach' called on an object that is not a valid instance of URLSearchParams.");
|
|
54099
54114
|
}
|
|
54100
54115
|
if (arguments.length < 1) {
|
|
@@ -54115,7 +54130,7 @@ function requireURLSearchParams () {
|
|
|
54115
54130
|
}
|
|
54116
54131
|
get size() {
|
|
54117
54132
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54118
|
-
if (!exports
|
|
54133
|
+
if (!exports.is(esValue)) {
|
|
54119
54134
|
throw new globalObject.TypeError("'get size' called on an object that is not a valid instance of URLSearchParams.");
|
|
54120
54135
|
}
|
|
54121
54136
|
return esValue[implSymbol]["size"];
|
|
@@ -54439,23 +54454,23 @@ var hasRequiredURL;
|
|
|
54439
54454
|
function requireURL () {
|
|
54440
54455
|
if (hasRequiredURL) return URL$2;
|
|
54441
54456
|
hasRequiredURL = 1;
|
|
54442
|
-
(function (exports
|
|
54457
|
+
(function (exports) {
|
|
54443
54458
|
|
|
54444
54459
|
const conversions = requireLib();
|
|
54445
54460
|
const utils = requireUtils$1();
|
|
54446
54461
|
const implSymbol = utils.implSymbol;
|
|
54447
54462
|
const ctorRegistrySymbol = utils.ctorRegistrySymbol;
|
|
54448
54463
|
const interfaceName = "URL";
|
|
54449
|
-
exports
|
|
54464
|
+
exports.is = value => {
|
|
54450
54465
|
return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation;
|
|
54451
54466
|
};
|
|
54452
|
-
exports
|
|
54467
|
+
exports.isImpl = value => {
|
|
54453
54468
|
return utils.isObject(value) && value instanceof Impl.implementation;
|
|
54454
54469
|
};
|
|
54455
|
-
exports
|
|
54470
|
+
exports.convert = (globalObject, value, {
|
|
54456
54471
|
context = "The provided value"
|
|
54457
54472
|
} = {}) => {
|
|
54458
|
-
if (exports
|
|
54473
|
+
if (exports.is(value)) {
|
|
54459
54474
|
return utils.implForWrapper(value);
|
|
54460
54475
|
}
|
|
54461
54476
|
throw new globalObject.TypeError(`${context} is not of type 'URL'.`);
|
|
@@ -54470,18 +54485,18 @@ function requireURL () {
|
|
|
54470
54485
|
}
|
|
54471
54486
|
return Object.create(proto);
|
|
54472
54487
|
}
|
|
54473
|
-
exports
|
|
54488
|
+
exports.create = (globalObject, constructorArgs, privateData) => {
|
|
54474
54489
|
const wrapper = makeWrapper(globalObject);
|
|
54475
|
-
return exports
|
|
54490
|
+
return exports.setup(wrapper, globalObject, constructorArgs, privateData);
|
|
54476
54491
|
};
|
|
54477
|
-
exports
|
|
54478
|
-
const wrapper = exports
|
|
54492
|
+
exports.createImpl = (globalObject, constructorArgs, privateData) => {
|
|
54493
|
+
const wrapper = exports.create(globalObject, constructorArgs, privateData);
|
|
54479
54494
|
return utils.implForWrapper(wrapper);
|
|
54480
54495
|
};
|
|
54481
|
-
exports
|
|
54482
|
-
exports
|
|
54496
|
+
exports._internalSetup = (wrapper, globalObject) => {};
|
|
54497
|
+
exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => {
|
|
54483
54498
|
privateData.wrapper = wrapper;
|
|
54484
|
-
exports
|
|
54499
|
+
exports._internalSetup(wrapper, globalObject);
|
|
54485
54500
|
Object.defineProperty(wrapper, implSymbol, {
|
|
54486
54501
|
value: new Impl.implementation(globalObject, constructorArgs, privateData),
|
|
54487
54502
|
configurable: true
|
|
@@ -54492,9 +54507,9 @@ function requireURL () {
|
|
|
54492
54507
|
}
|
|
54493
54508
|
return wrapper;
|
|
54494
54509
|
};
|
|
54495
|
-
exports
|
|
54510
|
+
exports.new = (globalObject, newTarget) => {
|
|
54496
54511
|
const wrapper = makeWrapper(globalObject, newTarget);
|
|
54497
|
-
exports
|
|
54512
|
+
exports._internalSetup(wrapper, globalObject);
|
|
54498
54513
|
Object.defineProperty(wrapper, implSymbol, {
|
|
54499
54514
|
value: Object.create(Impl.implementation.prototype),
|
|
54500
54515
|
configurable: true
|
|
@@ -54506,7 +54521,7 @@ function requireURL () {
|
|
|
54506
54521
|
return wrapper[implSymbol];
|
|
54507
54522
|
};
|
|
54508
54523
|
const exposed = new Set(["Window", "Worker"]);
|
|
54509
|
-
exports
|
|
54524
|
+
exports.install = (globalObject, globalNames) => {
|
|
54510
54525
|
if (!globalNames.some(globalName => exposed.has(globalName))) {
|
|
54511
54526
|
return;
|
|
54512
54527
|
}
|
|
@@ -54535,25 +54550,25 @@ function requireURL () {
|
|
|
54535
54550
|
}
|
|
54536
54551
|
args.push(curArg);
|
|
54537
54552
|
}
|
|
54538
|
-
return exports
|
|
54553
|
+
return exports.setup(Object.create(new.target.prototype), globalObject, args);
|
|
54539
54554
|
}
|
|
54540
54555
|
toJSON() {
|
|
54541
54556
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54542
|
-
if (!exports
|
|
54557
|
+
if (!exports.is(esValue)) {
|
|
54543
54558
|
throw new globalObject.TypeError("'toJSON' called on an object that is not a valid instance of URL.");
|
|
54544
54559
|
}
|
|
54545
54560
|
return esValue[implSymbol].toJSON();
|
|
54546
54561
|
}
|
|
54547
54562
|
get href() {
|
|
54548
54563
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54549
|
-
if (!exports
|
|
54564
|
+
if (!exports.is(esValue)) {
|
|
54550
54565
|
throw new globalObject.TypeError("'get href' called on an object that is not a valid instance of URL.");
|
|
54551
54566
|
}
|
|
54552
54567
|
return esValue[implSymbol]["href"];
|
|
54553
54568
|
}
|
|
54554
54569
|
set href(V) {
|
|
54555
54570
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54556
|
-
if (!exports
|
|
54571
|
+
if (!exports.is(esValue)) {
|
|
54557
54572
|
throw new globalObject.TypeError("'set href' called on an object that is not a valid instance of URL.");
|
|
54558
54573
|
}
|
|
54559
54574
|
V = conversions["USVString"](V, {
|
|
@@ -54564,28 +54579,28 @@ function requireURL () {
|
|
|
54564
54579
|
}
|
|
54565
54580
|
toString() {
|
|
54566
54581
|
const esValue = this;
|
|
54567
|
-
if (!exports
|
|
54582
|
+
if (!exports.is(esValue)) {
|
|
54568
54583
|
throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of URL.");
|
|
54569
54584
|
}
|
|
54570
54585
|
return esValue[implSymbol]["href"];
|
|
54571
54586
|
}
|
|
54572
54587
|
get origin() {
|
|
54573
54588
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54574
|
-
if (!exports
|
|
54589
|
+
if (!exports.is(esValue)) {
|
|
54575
54590
|
throw new globalObject.TypeError("'get origin' called on an object that is not a valid instance of URL.");
|
|
54576
54591
|
}
|
|
54577
54592
|
return esValue[implSymbol]["origin"];
|
|
54578
54593
|
}
|
|
54579
54594
|
get protocol() {
|
|
54580
54595
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54581
|
-
if (!exports
|
|
54596
|
+
if (!exports.is(esValue)) {
|
|
54582
54597
|
throw new globalObject.TypeError("'get protocol' called on an object that is not a valid instance of URL.");
|
|
54583
54598
|
}
|
|
54584
54599
|
return esValue[implSymbol]["protocol"];
|
|
54585
54600
|
}
|
|
54586
54601
|
set protocol(V) {
|
|
54587
54602
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54588
|
-
if (!exports
|
|
54603
|
+
if (!exports.is(esValue)) {
|
|
54589
54604
|
throw new globalObject.TypeError("'set protocol' called on an object that is not a valid instance of URL.");
|
|
54590
54605
|
}
|
|
54591
54606
|
V = conversions["USVString"](V, {
|
|
@@ -54596,14 +54611,14 @@ function requireURL () {
|
|
|
54596
54611
|
}
|
|
54597
54612
|
get username() {
|
|
54598
54613
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54599
|
-
if (!exports
|
|
54614
|
+
if (!exports.is(esValue)) {
|
|
54600
54615
|
throw new globalObject.TypeError("'get username' called on an object that is not a valid instance of URL.");
|
|
54601
54616
|
}
|
|
54602
54617
|
return esValue[implSymbol]["username"];
|
|
54603
54618
|
}
|
|
54604
54619
|
set username(V) {
|
|
54605
54620
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54606
|
-
if (!exports
|
|
54621
|
+
if (!exports.is(esValue)) {
|
|
54607
54622
|
throw new globalObject.TypeError("'set username' called on an object that is not a valid instance of URL.");
|
|
54608
54623
|
}
|
|
54609
54624
|
V = conversions["USVString"](V, {
|
|
@@ -54614,14 +54629,14 @@ function requireURL () {
|
|
|
54614
54629
|
}
|
|
54615
54630
|
get password() {
|
|
54616
54631
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54617
|
-
if (!exports
|
|
54632
|
+
if (!exports.is(esValue)) {
|
|
54618
54633
|
throw new globalObject.TypeError("'get password' called on an object that is not a valid instance of URL.");
|
|
54619
54634
|
}
|
|
54620
54635
|
return esValue[implSymbol]["password"];
|
|
54621
54636
|
}
|
|
54622
54637
|
set password(V) {
|
|
54623
54638
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54624
|
-
if (!exports
|
|
54639
|
+
if (!exports.is(esValue)) {
|
|
54625
54640
|
throw new globalObject.TypeError("'set password' called on an object that is not a valid instance of URL.");
|
|
54626
54641
|
}
|
|
54627
54642
|
V = conversions["USVString"](V, {
|
|
@@ -54632,14 +54647,14 @@ function requireURL () {
|
|
|
54632
54647
|
}
|
|
54633
54648
|
get host() {
|
|
54634
54649
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54635
|
-
if (!exports
|
|
54650
|
+
if (!exports.is(esValue)) {
|
|
54636
54651
|
throw new globalObject.TypeError("'get host' called on an object that is not a valid instance of URL.");
|
|
54637
54652
|
}
|
|
54638
54653
|
return esValue[implSymbol]["host"];
|
|
54639
54654
|
}
|
|
54640
54655
|
set host(V) {
|
|
54641
54656
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54642
|
-
if (!exports
|
|
54657
|
+
if (!exports.is(esValue)) {
|
|
54643
54658
|
throw new globalObject.TypeError("'set host' called on an object that is not a valid instance of URL.");
|
|
54644
54659
|
}
|
|
54645
54660
|
V = conversions["USVString"](V, {
|
|
@@ -54650,14 +54665,14 @@ function requireURL () {
|
|
|
54650
54665
|
}
|
|
54651
54666
|
get hostname() {
|
|
54652
54667
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54653
|
-
if (!exports
|
|
54668
|
+
if (!exports.is(esValue)) {
|
|
54654
54669
|
throw new globalObject.TypeError("'get hostname' called on an object that is not a valid instance of URL.");
|
|
54655
54670
|
}
|
|
54656
54671
|
return esValue[implSymbol]["hostname"];
|
|
54657
54672
|
}
|
|
54658
54673
|
set hostname(V) {
|
|
54659
54674
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54660
|
-
if (!exports
|
|
54675
|
+
if (!exports.is(esValue)) {
|
|
54661
54676
|
throw new globalObject.TypeError("'set hostname' called on an object that is not a valid instance of URL.");
|
|
54662
54677
|
}
|
|
54663
54678
|
V = conversions["USVString"](V, {
|
|
@@ -54668,14 +54683,14 @@ function requireURL () {
|
|
|
54668
54683
|
}
|
|
54669
54684
|
get port() {
|
|
54670
54685
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54671
|
-
if (!exports
|
|
54686
|
+
if (!exports.is(esValue)) {
|
|
54672
54687
|
throw new globalObject.TypeError("'get port' called on an object that is not a valid instance of URL.");
|
|
54673
54688
|
}
|
|
54674
54689
|
return esValue[implSymbol]["port"];
|
|
54675
54690
|
}
|
|
54676
54691
|
set port(V) {
|
|
54677
54692
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54678
|
-
if (!exports
|
|
54693
|
+
if (!exports.is(esValue)) {
|
|
54679
54694
|
throw new globalObject.TypeError("'set port' called on an object that is not a valid instance of URL.");
|
|
54680
54695
|
}
|
|
54681
54696
|
V = conversions["USVString"](V, {
|
|
@@ -54686,14 +54701,14 @@ function requireURL () {
|
|
|
54686
54701
|
}
|
|
54687
54702
|
get pathname() {
|
|
54688
54703
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54689
|
-
if (!exports
|
|
54704
|
+
if (!exports.is(esValue)) {
|
|
54690
54705
|
throw new globalObject.TypeError("'get pathname' called on an object that is not a valid instance of URL.");
|
|
54691
54706
|
}
|
|
54692
54707
|
return esValue[implSymbol]["pathname"];
|
|
54693
54708
|
}
|
|
54694
54709
|
set pathname(V) {
|
|
54695
54710
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54696
|
-
if (!exports
|
|
54711
|
+
if (!exports.is(esValue)) {
|
|
54697
54712
|
throw new globalObject.TypeError("'set pathname' called on an object that is not a valid instance of URL.");
|
|
54698
54713
|
}
|
|
54699
54714
|
V = conversions["USVString"](V, {
|
|
@@ -54704,14 +54719,14 @@ function requireURL () {
|
|
|
54704
54719
|
}
|
|
54705
54720
|
get search() {
|
|
54706
54721
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54707
|
-
if (!exports
|
|
54722
|
+
if (!exports.is(esValue)) {
|
|
54708
54723
|
throw new globalObject.TypeError("'get search' called on an object that is not a valid instance of URL.");
|
|
54709
54724
|
}
|
|
54710
54725
|
return esValue[implSymbol]["search"];
|
|
54711
54726
|
}
|
|
54712
54727
|
set search(V) {
|
|
54713
54728
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54714
|
-
if (!exports
|
|
54729
|
+
if (!exports.is(esValue)) {
|
|
54715
54730
|
throw new globalObject.TypeError("'set search' called on an object that is not a valid instance of URL.");
|
|
54716
54731
|
}
|
|
54717
54732
|
V = conversions["USVString"](V, {
|
|
@@ -54722,7 +54737,7 @@ function requireURL () {
|
|
|
54722
54737
|
}
|
|
54723
54738
|
get searchParams() {
|
|
54724
54739
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54725
|
-
if (!exports
|
|
54740
|
+
if (!exports.is(esValue)) {
|
|
54726
54741
|
throw new globalObject.TypeError("'get searchParams' called on an object that is not a valid instance of URL.");
|
|
54727
54742
|
}
|
|
54728
54743
|
return utils.getSameObject(this, "searchParams", () => {
|
|
@@ -54731,14 +54746,14 @@ function requireURL () {
|
|
|
54731
54746
|
}
|
|
54732
54747
|
get hash() {
|
|
54733
54748
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54734
|
-
if (!exports
|
|
54749
|
+
if (!exports.is(esValue)) {
|
|
54735
54750
|
throw new globalObject.TypeError("'get hash' called on an object that is not a valid instance of URL.");
|
|
54736
54751
|
}
|
|
54737
54752
|
return esValue[implSymbol]["hash"];
|
|
54738
54753
|
}
|
|
54739
54754
|
set hash(V) {
|
|
54740
54755
|
const esValue = this !== null && this !== undefined ? this : globalObject;
|
|
54741
|
-
if (!exports
|
|
54756
|
+
if (!exports.is(esValue)) {
|
|
54742
54757
|
throw new globalObject.TypeError("'set hash' called on an object that is not a valid instance of URL.");
|
|
54743
54758
|
}
|
|
54744
54759
|
V = conversions["USVString"](V, {
|