seroval 0.6.0 → 0.7.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/README.md +15 -3
- package/dist/cjs/development/index.cjs +550 -180
- package/dist/cjs/development/index.cjs.map +4 -4
- package/dist/cjs/production/index.cjs +3 -3
- package/dist/esm/development/index.mjs +550 -180
- package/dist/esm/development/index.mjs.map +4 -4
- package/dist/esm/production/index.mjs +3 -3
- package/dist/types/compat.d.ts +1 -1
- package/dist/types/context.d.ts +11 -5
- package/dist/types/string.d.ts +3 -0
- package/dist/types/tree/primitives.d.ts +4 -1
- package/dist/types/tree/types.d.ts +52 -9
- package/dist/types/tree/web-api.d.ts +3 -1
- package/package.json +3 -2
- package/src/compat.ts +1 -1
- package/src/context.ts +14 -6
- package/src/{quote.ts → string.ts} +27 -30
- package/src/tree/async.ts +87 -8
- package/src/tree/deserialize.ts +176 -59
- package/src/tree/primitives.ts +84 -20
- package/src/tree/serialize.ts +211 -41
- package/src/tree/sync.ts +76 -7
- package/src/tree/types.ts +111 -10
- package/src/tree/web-api.ts +53 -3
- package/dist/types/quote.d.ts +0 -2
|
@@ -16,7 +16,7 @@ var Feature = /* @__PURE__ */ ((Feature2) => {
|
|
|
16
16
|
Feature2[Feature2["WebAPI"] = 8192] = "WebAPI";
|
|
17
17
|
return Feature2;
|
|
18
18
|
})(Feature || {});
|
|
19
|
-
var ALL_ENABLED =
|
|
19
|
+
var ALL_ENABLED = 16383;
|
|
20
20
|
|
|
21
21
|
// src/get-identifier.ts
|
|
22
22
|
var REF_START_CHARS = "hjkmoquxzABCDEFGHIJKLNPQRTUVWXYZ$_";
|
|
@@ -100,39 +100,43 @@ function assert(cond, error) {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
// src/
|
|
104
|
-
function
|
|
103
|
+
// src/string.ts
|
|
104
|
+
function serializeChar(str) {
|
|
105
|
+
switch (str) {
|
|
106
|
+
case '"':
|
|
107
|
+
return '\\"';
|
|
108
|
+
case "\\":
|
|
109
|
+
return "\\\\";
|
|
110
|
+
case "\n":
|
|
111
|
+
return "\\n";
|
|
112
|
+
case "\r":
|
|
113
|
+
return "\\r";
|
|
114
|
+
case "\b":
|
|
115
|
+
return "\\b";
|
|
116
|
+
case " ":
|
|
117
|
+
return "\\t";
|
|
118
|
+
case "\f":
|
|
119
|
+
return "\\f";
|
|
120
|
+
case "<":
|
|
121
|
+
return "\\x3C";
|
|
122
|
+
case "\u2028":
|
|
123
|
+
return "\\u2028";
|
|
124
|
+
case "\u2029":
|
|
125
|
+
return "\\u2029";
|
|
126
|
+
default:
|
|
127
|
+
return void 0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function serializeString(str) {
|
|
105
131
|
let result = "";
|
|
106
132
|
let lastPos = 0;
|
|
133
|
+
let replacement;
|
|
107
134
|
for (let i = 0, len = str.length; i < len; i++) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
break;
|
|
113
|
-
case "\\":
|
|
114
|
-
replacement = "\\\\";
|
|
115
|
-
break;
|
|
116
|
-
case "<":
|
|
117
|
-
replacement = "\\x3C";
|
|
118
|
-
break;
|
|
119
|
-
case "\n":
|
|
120
|
-
replacement = "\\n";
|
|
121
|
-
break;
|
|
122
|
-
case "\r":
|
|
123
|
-
replacement = "\\r";
|
|
124
|
-
break;
|
|
125
|
-
case "\u2028":
|
|
126
|
-
replacement = "\\u2028";
|
|
127
|
-
break;
|
|
128
|
-
case "\u2029":
|
|
129
|
-
replacement = "\\u2029";
|
|
130
|
-
break;
|
|
131
|
-
default:
|
|
132
|
-
continue;
|
|
135
|
+
replacement = serializeChar(str[i]);
|
|
136
|
+
if (replacement) {
|
|
137
|
+
result += str.slice(lastPos, i) + replacement;
|
|
138
|
+
lastPos = i + 1;
|
|
133
139
|
}
|
|
134
|
-
result += str.slice(lastPos, i) + replacement;
|
|
135
|
-
lastPos = i + 1;
|
|
136
140
|
}
|
|
137
141
|
if (lastPos === 0) {
|
|
138
142
|
result = str;
|
|
@@ -141,8 +145,8 @@ function quote(str) {
|
|
|
141
145
|
}
|
|
142
146
|
return result;
|
|
143
147
|
}
|
|
144
|
-
function
|
|
145
|
-
return str.replace(/\\"/g, '"').replace(/\\\\/g, "\\").replace(/\\
|
|
148
|
+
function deserializeString(str) {
|
|
149
|
+
return str.replace(/\\"/g, '"').replace(/\\\\/g, "\\").replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\b/g, "\b").replace(/\\t/g, " ").replace(/\\f/g, "\f").replace(/\\x3C/g, "<").replace(/\\u2028/g, "\u2028").replace(/\\u2029/g, "\u2029");
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
// src/tree/reference.ts
|
|
@@ -255,7 +259,8 @@ var TRUE_NODE = {
|
|
|
255
259
|
m: void 0,
|
|
256
260
|
d: void 0,
|
|
257
261
|
a: void 0,
|
|
258
|
-
f: void 0
|
|
262
|
+
f: void 0,
|
|
263
|
+
b: void 0
|
|
259
264
|
};
|
|
260
265
|
var FALSE_NODE = {
|
|
261
266
|
t: 2 /* Boolean */,
|
|
@@ -266,7 +271,8 @@ var FALSE_NODE = {
|
|
|
266
271
|
m: void 0,
|
|
267
272
|
d: void 0,
|
|
268
273
|
a: void 0,
|
|
269
|
-
f: void 0
|
|
274
|
+
f: void 0,
|
|
275
|
+
b: void 0
|
|
270
276
|
};
|
|
271
277
|
var UNDEFINED_NODE = {
|
|
272
278
|
t: 4 /* Undefined */,
|
|
@@ -277,7 +283,8 @@ var UNDEFINED_NODE = {
|
|
|
277
283
|
m: void 0,
|
|
278
284
|
d: void 0,
|
|
279
285
|
a: void 0,
|
|
280
|
-
f: void 0
|
|
286
|
+
f: void 0,
|
|
287
|
+
b: void 0
|
|
281
288
|
};
|
|
282
289
|
var NULL_NODE = {
|
|
283
290
|
t: 3 /* Null */,
|
|
@@ -288,7 +295,8 @@ var NULL_NODE = {
|
|
|
288
295
|
m: void 0,
|
|
289
296
|
d: void 0,
|
|
290
297
|
a: void 0,
|
|
291
|
-
f: void 0
|
|
298
|
+
f: void 0,
|
|
299
|
+
b: void 0
|
|
292
300
|
};
|
|
293
301
|
var NEG_ZERO_NODE = {
|
|
294
302
|
t: 5 /* NegativeZero */,
|
|
@@ -299,7 +307,8 @@ var NEG_ZERO_NODE = {
|
|
|
299
307
|
m: void 0,
|
|
300
308
|
d: void 0,
|
|
301
309
|
a: void 0,
|
|
302
|
-
f: void 0
|
|
310
|
+
f: void 0,
|
|
311
|
+
b: void 0
|
|
303
312
|
};
|
|
304
313
|
var INFINITY_NODE = {
|
|
305
314
|
t: 6 /* Infinity */,
|
|
@@ -310,7 +319,8 @@ var INFINITY_NODE = {
|
|
|
310
319
|
m: void 0,
|
|
311
320
|
d: void 0,
|
|
312
321
|
a: void 0,
|
|
313
|
-
f: void 0
|
|
322
|
+
f: void 0,
|
|
323
|
+
b: void 0
|
|
314
324
|
};
|
|
315
325
|
var NEG_INFINITY_NODE = {
|
|
316
326
|
t: 7 /* NegativeInfinity */,
|
|
@@ -321,7 +331,8 @@ var NEG_INFINITY_NODE = {
|
|
|
321
331
|
m: void 0,
|
|
322
332
|
d: void 0,
|
|
323
333
|
a: void 0,
|
|
324
|
-
f: void 0
|
|
334
|
+
f: void 0,
|
|
335
|
+
b: void 0
|
|
325
336
|
};
|
|
326
337
|
var NAN_NODE = {
|
|
327
338
|
t: 8 /* NaN */,
|
|
@@ -332,7 +343,8 @@ var NAN_NODE = {
|
|
|
332
343
|
m: void 0,
|
|
333
344
|
d: void 0,
|
|
334
345
|
a: void 0,
|
|
335
|
-
f: void 0
|
|
346
|
+
f: void 0,
|
|
347
|
+
b: void 0
|
|
336
348
|
};
|
|
337
349
|
function createNumberNode(value) {
|
|
338
350
|
return {
|
|
@@ -344,20 +356,22 @@ function createNumberNode(value) {
|
|
|
344
356
|
m: void 0,
|
|
345
357
|
d: void 0,
|
|
346
358
|
a: void 0,
|
|
347
|
-
f: void 0
|
|
359
|
+
f: void 0,
|
|
360
|
+
b: void 0
|
|
348
361
|
};
|
|
349
362
|
}
|
|
350
363
|
function createStringNode(value) {
|
|
351
364
|
return {
|
|
352
365
|
t: 1 /* String */,
|
|
353
366
|
i: void 0,
|
|
354
|
-
s:
|
|
367
|
+
s: serializeString(value),
|
|
355
368
|
l: void 0,
|
|
356
369
|
c: void 0,
|
|
357
370
|
m: void 0,
|
|
358
371
|
d: void 0,
|
|
359
372
|
a: void 0,
|
|
360
|
-
f: void 0
|
|
373
|
+
f: void 0,
|
|
374
|
+
b: void 0
|
|
361
375
|
};
|
|
362
376
|
}
|
|
363
377
|
function createBigIntNode(ctx, current) {
|
|
@@ -371,7 +385,8 @@ function createBigIntNode(ctx, current) {
|
|
|
371
385
|
m: void 0,
|
|
372
386
|
d: void 0,
|
|
373
387
|
a: void 0,
|
|
374
|
-
f: void 0
|
|
388
|
+
f: void 0,
|
|
389
|
+
b: void 0
|
|
375
390
|
};
|
|
376
391
|
}
|
|
377
392
|
function createIndexedValueNode(id) {
|
|
@@ -384,7 +399,8 @@ function createIndexedValueNode(id) {
|
|
|
384
399
|
m: void 0,
|
|
385
400
|
d: void 0,
|
|
386
401
|
a: void 0,
|
|
387
|
-
f: void 0
|
|
402
|
+
f: void 0,
|
|
403
|
+
b: void 0
|
|
388
404
|
};
|
|
389
405
|
}
|
|
390
406
|
function createDateNode(id, current) {
|
|
@@ -397,7 +413,8 @@ function createDateNode(id, current) {
|
|
|
397
413
|
m: void 0,
|
|
398
414
|
d: void 0,
|
|
399
415
|
f: void 0,
|
|
400
|
-
a: void 0
|
|
416
|
+
a: void 0,
|
|
417
|
+
b: void 0
|
|
401
418
|
};
|
|
402
419
|
}
|
|
403
420
|
function createRegExpNode(id, current) {
|
|
@@ -410,27 +427,51 @@ function createRegExpNode(id, current) {
|
|
|
410
427
|
m: current.flags,
|
|
411
428
|
d: void 0,
|
|
412
429
|
a: void 0,
|
|
413
|
-
f: void 0
|
|
430
|
+
f: void 0,
|
|
431
|
+
b: void 0
|
|
414
432
|
};
|
|
415
433
|
}
|
|
416
|
-
function
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
const len = current.length;
|
|
434
|
+
function createArrayBufferNode(id, current) {
|
|
435
|
+
const bytes = new Uint8Array(current);
|
|
436
|
+
const len = bytes.length;
|
|
420
437
|
const values = new Array(len);
|
|
421
438
|
for (let i = 0; i < len; i++) {
|
|
422
|
-
values[i] =
|
|
439
|
+
values[i] = bytes[i];
|
|
423
440
|
}
|
|
424
441
|
return {
|
|
425
|
-
t:
|
|
442
|
+
t: 28 /* ArrayBuffer */,
|
|
426
443
|
i: id,
|
|
427
444
|
s: values,
|
|
428
|
-
l:
|
|
445
|
+
l: void 0,
|
|
446
|
+
c: void 0,
|
|
447
|
+
m: void 0,
|
|
448
|
+
d: void 0,
|
|
449
|
+
a: void 0,
|
|
450
|
+
f: void 0,
|
|
451
|
+
b: void 0
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
function serializeArrayBuffer(ctx, current) {
|
|
455
|
+
const id = createIndexedValue(ctx, current);
|
|
456
|
+
if (ctx.markedRefs.has(id)) {
|
|
457
|
+
return createIndexedValueNode(id);
|
|
458
|
+
}
|
|
459
|
+
return createArrayBufferNode(id, current);
|
|
460
|
+
}
|
|
461
|
+
function createTypedArrayNode(ctx, id, current) {
|
|
462
|
+
const constructor = current.constructor.name;
|
|
463
|
+
assert(ctx.features & 2048 /* TypedArray */, `Unsupported value type "${constructor}"`);
|
|
464
|
+
return {
|
|
465
|
+
t: 22 /* TypedArray */,
|
|
466
|
+
i: id,
|
|
467
|
+
s: void 0,
|
|
468
|
+
l: current.length,
|
|
429
469
|
c: constructor,
|
|
430
470
|
m: void 0,
|
|
431
471
|
d: void 0,
|
|
432
472
|
a: void 0,
|
|
433
|
-
f:
|
|
473
|
+
f: serializeArrayBuffer(ctx, current.buffer),
|
|
474
|
+
b: current.byteOffset
|
|
434
475
|
};
|
|
435
476
|
}
|
|
436
477
|
var BIGINT_FLAG = 4096 /* BigIntTypedArray */ | 8 /* BigInt */;
|
|
@@ -440,21 +481,17 @@ function createBigIntTypedArrayNode(ctx, id, current) {
|
|
|
440
481
|
(ctx.features & BIGINT_FLAG) === BIGINT_FLAG,
|
|
441
482
|
`Unsupported value type "${constructor}"`
|
|
442
483
|
);
|
|
443
|
-
const len = current.length;
|
|
444
|
-
const values = new Array(len);
|
|
445
|
-
for (let i = 0; i < len; i++) {
|
|
446
|
-
values[i] = "" + current[i];
|
|
447
|
-
}
|
|
448
484
|
return {
|
|
449
485
|
t: 23 /* BigIntTypedArray */,
|
|
450
486
|
i: id,
|
|
451
|
-
s:
|
|
452
|
-
l: current.
|
|
487
|
+
s: void 0,
|
|
488
|
+
l: current.length,
|
|
453
489
|
c: constructor,
|
|
454
490
|
m: void 0,
|
|
455
491
|
d: void 0,
|
|
456
492
|
a: void 0,
|
|
457
|
-
f:
|
|
493
|
+
f: serializeArrayBuffer(ctx, current.buffer),
|
|
494
|
+
b: current.byteOffset
|
|
458
495
|
};
|
|
459
496
|
}
|
|
460
497
|
function createWKSymbolNode(ctx, current) {
|
|
@@ -469,20 +506,36 @@ function createWKSymbolNode(ctx, current) {
|
|
|
469
506
|
m: void 0,
|
|
470
507
|
d: void 0,
|
|
471
508
|
a: void 0,
|
|
472
|
-
f: void 0
|
|
509
|
+
f: void 0,
|
|
510
|
+
b: void 0
|
|
473
511
|
};
|
|
474
512
|
}
|
|
475
513
|
function createReferenceNode(id, ref) {
|
|
476
514
|
return {
|
|
477
515
|
t: 27 /* Reference */,
|
|
478
516
|
i: id,
|
|
479
|
-
s:
|
|
517
|
+
s: serializeString(getReferenceID(ref)),
|
|
480
518
|
l: void 0,
|
|
481
519
|
c: void 0,
|
|
482
520
|
m: void 0,
|
|
483
521
|
d: void 0,
|
|
484
522
|
a: void 0,
|
|
485
|
-
f: void 0
|
|
523
|
+
f: void 0,
|
|
524
|
+
b: void 0
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
function createDataViewNode(ctx, id, current) {
|
|
528
|
+
return {
|
|
529
|
+
t: 29 /* DataView */,
|
|
530
|
+
i: id,
|
|
531
|
+
s: void 0,
|
|
532
|
+
l: current.byteLength,
|
|
533
|
+
c: void 0,
|
|
534
|
+
m: void 0,
|
|
535
|
+
d: void 0,
|
|
536
|
+
a: void 0,
|
|
537
|
+
f: serializeArrayBuffer(ctx, current.buffer),
|
|
538
|
+
b: current.byteOffset
|
|
486
539
|
};
|
|
487
540
|
}
|
|
488
541
|
|
|
@@ -630,13 +683,14 @@ function createURLNode(ctx, id, current) {
|
|
|
630
683
|
return {
|
|
631
684
|
t: 25 /* URL */,
|
|
632
685
|
i: id,
|
|
633
|
-
s: current.href,
|
|
686
|
+
s: serializeString(current.href),
|
|
634
687
|
l: void 0,
|
|
635
688
|
c: void 0,
|
|
636
689
|
m: void 0,
|
|
637
690
|
d: void 0,
|
|
638
691
|
f: void 0,
|
|
639
|
-
a: void 0
|
|
692
|
+
a: void 0,
|
|
693
|
+
b: void 0
|
|
640
694
|
};
|
|
641
695
|
}
|
|
642
696
|
function createURLSearchParamsNode(ctx, id, current) {
|
|
@@ -644,13 +698,44 @@ function createURLSearchParamsNode(ctx, id, current) {
|
|
|
644
698
|
return {
|
|
645
699
|
t: 26 /* URLSearchParams */,
|
|
646
700
|
i: id,
|
|
647
|
-
s: current.toString(),
|
|
701
|
+
s: serializeString(current.toString()),
|
|
648
702
|
l: void 0,
|
|
649
703
|
c: void 0,
|
|
650
704
|
m: void 0,
|
|
651
705
|
d: void 0,
|
|
652
706
|
f: void 0,
|
|
653
|
-
a: void 0
|
|
707
|
+
a: void 0,
|
|
708
|
+
b: void 0
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
async function createBlobNode(ctx, id, current) {
|
|
712
|
+
assert(ctx.features & 8192 /* WebAPI */, 'Unsupported type "Blob"');
|
|
713
|
+
return {
|
|
714
|
+
t: 30 /* Blob */,
|
|
715
|
+
i: id,
|
|
716
|
+
s: void 0,
|
|
717
|
+
l: void 0,
|
|
718
|
+
c: serializeString(current.type),
|
|
719
|
+
m: void 0,
|
|
720
|
+
d: void 0,
|
|
721
|
+
f: serializeArrayBuffer(ctx, await current.arrayBuffer()),
|
|
722
|
+
a: void 0,
|
|
723
|
+
b: void 0
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
async function createFileNode(ctx, id, current) {
|
|
727
|
+
assert(ctx.features & 8192 /* WebAPI */, 'Unsupported type "File"');
|
|
728
|
+
return {
|
|
729
|
+
t: 31 /* File */,
|
|
730
|
+
i: id,
|
|
731
|
+
s: void 0,
|
|
732
|
+
l: void 0,
|
|
733
|
+
c: serializeString(current.type),
|
|
734
|
+
m: serializeString(current.name),
|
|
735
|
+
d: void 0,
|
|
736
|
+
f: serializeArrayBuffer(ctx, await current.arrayBuffer()),
|
|
737
|
+
a: void 0,
|
|
738
|
+
b: current.lastModified
|
|
654
739
|
};
|
|
655
740
|
}
|
|
656
741
|
|
|
@@ -687,7 +772,8 @@ async function generateArrayNode(ctx, id, current) {
|
|
|
687
772
|
m: void 0,
|
|
688
773
|
d: void 0,
|
|
689
774
|
a: await generateNodeList(ctx, current),
|
|
690
|
-
f: void 0
|
|
775
|
+
f: void 0,
|
|
776
|
+
b: void 0
|
|
691
777
|
};
|
|
692
778
|
}
|
|
693
779
|
async function generateMapNode(ctx, id, current) {
|
|
@@ -723,7 +809,8 @@ async function generateMapNode(ctx, id, current) {
|
|
|
723
809
|
m: void 0,
|
|
724
810
|
d: { k: keyNodes, v: valueNodes, s: len },
|
|
725
811
|
a: void 0,
|
|
726
|
-
f: void 0
|
|
812
|
+
f: void 0,
|
|
813
|
+
b: void 0
|
|
727
814
|
};
|
|
728
815
|
}
|
|
729
816
|
async function generateSetNode(ctx, id, current) {
|
|
@@ -752,7 +839,8 @@ async function generateSetNode(ctx, id, current) {
|
|
|
752
839
|
m: void 0,
|
|
753
840
|
d: void 0,
|
|
754
841
|
a: nodes,
|
|
755
|
-
f: void 0
|
|
842
|
+
f: void 0,
|
|
843
|
+
b: void 0
|
|
756
844
|
};
|
|
757
845
|
}
|
|
758
846
|
async function generateProperties(ctx, properties) {
|
|
@@ -765,14 +853,16 @@ async function generateProperties(ctx, properties) {
|
|
|
765
853
|
let deferredSize = 0;
|
|
766
854
|
let nodesSize = 0;
|
|
767
855
|
let item;
|
|
856
|
+
let escaped;
|
|
768
857
|
for (const key of keys) {
|
|
769
858
|
item = properties[key];
|
|
859
|
+
escaped = serializeString(key);
|
|
770
860
|
if (isIterable(item)) {
|
|
771
|
-
deferredKeys[deferredSize] =
|
|
861
|
+
deferredKeys[deferredSize] = escaped;
|
|
772
862
|
deferredValues[deferredSize] = item;
|
|
773
863
|
deferredSize++;
|
|
774
864
|
} else {
|
|
775
|
-
keyNodes[nodesSize] =
|
|
865
|
+
keyNodes[nodesSize] = escaped;
|
|
776
866
|
valueNodes[nodesSize] = await parse(ctx, item);
|
|
777
867
|
nodesSize++;
|
|
778
868
|
}
|
|
@@ -801,7 +891,8 @@ async function generateIterableNode(ctx, id, current) {
|
|
|
801
891
|
// Parse options first before the items
|
|
802
892
|
d: options ? await generateProperties(ctx, options) : void 0,
|
|
803
893
|
a: await generateNodeList(ctx, array),
|
|
804
|
-
f: void 0
|
|
894
|
+
f: void 0,
|
|
895
|
+
b: void 0
|
|
805
896
|
};
|
|
806
897
|
}
|
|
807
898
|
async function generatePromiseNode(ctx, id, current) {
|
|
@@ -816,7 +907,8 @@ async function generatePromiseNode(ctx, id, current) {
|
|
|
816
907
|
// Parse options first before the items
|
|
817
908
|
d: void 0,
|
|
818
909
|
a: void 0,
|
|
819
|
-
f: await parse(ctx, value)
|
|
910
|
+
f: await parse(ctx, value),
|
|
911
|
+
b: void 0
|
|
820
912
|
}));
|
|
821
913
|
}
|
|
822
914
|
async function generateObjectNode(ctx, id, current, empty) {
|
|
@@ -835,7 +927,8 @@ async function generateObjectNode(ctx, id, current, empty) {
|
|
|
835
927
|
m: void 0,
|
|
836
928
|
d: await generateProperties(ctx, current),
|
|
837
929
|
a: void 0,
|
|
838
|
-
f: void 0
|
|
930
|
+
f: void 0,
|
|
931
|
+
b: void 0
|
|
839
932
|
};
|
|
840
933
|
}
|
|
841
934
|
async function generateAggregateErrorNode(ctx, id, current) {
|
|
@@ -845,12 +938,13 @@ async function generateAggregateErrorNode(ctx, id, current) {
|
|
|
845
938
|
t: 20 /* AggregateError */,
|
|
846
939
|
i: id,
|
|
847
940
|
s: void 0,
|
|
848
|
-
l:
|
|
941
|
+
l: void 0,
|
|
849
942
|
c: void 0,
|
|
850
|
-
m:
|
|
943
|
+
m: serializeString(current.message),
|
|
851
944
|
d: optionsNode,
|
|
852
|
-
a:
|
|
853
|
-
f: void 0
|
|
945
|
+
a: void 0,
|
|
946
|
+
f: void 0,
|
|
947
|
+
b: void 0
|
|
854
948
|
};
|
|
855
949
|
}
|
|
856
950
|
async function generateErrorNode(ctx, id, current) {
|
|
@@ -862,10 +956,49 @@ async function generateErrorNode(ctx, id, current) {
|
|
|
862
956
|
s: void 0,
|
|
863
957
|
l: void 0,
|
|
864
958
|
c: getErrorConstructorName(current),
|
|
865
|
-
m:
|
|
959
|
+
m: serializeString(current.message),
|
|
866
960
|
d: optionsNode,
|
|
867
961
|
a: void 0,
|
|
868
|
-
f: void 0
|
|
962
|
+
f: void 0,
|
|
963
|
+
b: void 0
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
async function generateHeadersNode(ctx, id, current) {
|
|
967
|
+
assert(ctx.features & 8192 /* WebAPI */, 'Unsupported type "Headers"');
|
|
968
|
+
const items = {};
|
|
969
|
+
current.forEach((value, key) => {
|
|
970
|
+
items[key] = value;
|
|
971
|
+
});
|
|
972
|
+
return {
|
|
973
|
+
t: 32 /* Headers */,
|
|
974
|
+
i: id,
|
|
975
|
+
s: void 0,
|
|
976
|
+
l: void 0,
|
|
977
|
+
c: void 0,
|
|
978
|
+
m: void 0,
|
|
979
|
+
d: await generateProperties(ctx, items),
|
|
980
|
+
a: void 0,
|
|
981
|
+
f: void 0,
|
|
982
|
+
b: void 0
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
async function generateFormDataNode(ctx, id, current) {
|
|
986
|
+
assert(ctx.features & 8192 /* WebAPI */, 'Unsupported type "FormData"');
|
|
987
|
+
const items = {};
|
|
988
|
+
current.forEach((value, key) => {
|
|
989
|
+
items[key] = value;
|
|
990
|
+
});
|
|
991
|
+
return {
|
|
992
|
+
t: 33 /* FormData */,
|
|
993
|
+
i: id,
|
|
994
|
+
s: void 0,
|
|
995
|
+
l: void 0,
|
|
996
|
+
c: void 0,
|
|
997
|
+
m: void 0,
|
|
998
|
+
d: await generateProperties(ctx, items),
|
|
999
|
+
a: void 0,
|
|
1000
|
+
f: void 0,
|
|
1001
|
+
b: void 0
|
|
869
1002
|
};
|
|
870
1003
|
}
|
|
871
1004
|
async function parse(ctx, current) {
|
|
@@ -914,6 +1047,8 @@ async function parse(ctx, current) {
|
|
|
914
1047
|
return createRegExpNode(id, current);
|
|
915
1048
|
case Promise:
|
|
916
1049
|
return generatePromiseNode(ctx, id, current);
|
|
1050
|
+
case ArrayBuffer:
|
|
1051
|
+
return createArrayBufferNode(id, current);
|
|
917
1052
|
case Int8Array:
|
|
918
1053
|
case Int16Array:
|
|
919
1054
|
case Int32Array:
|
|
@@ -927,6 +1062,8 @@ async function parse(ctx, current) {
|
|
|
927
1062
|
case BigInt64Array:
|
|
928
1063
|
case BigUint64Array:
|
|
929
1064
|
return createBigIntTypedArrayNode(ctx, id, current);
|
|
1065
|
+
case DataView:
|
|
1066
|
+
return createDataViewNode(ctx, id, current);
|
|
930
1067
|
case Map:
|
|
931
1068
|
return generateMapNode(
|
|
932
1069
|
ctx,
|
|
@@ -970,6 +1107,14 @@ async function parse(ctx, current) {
|
|
|
970
1107
|
return createURLNode(ctx, id, current);
|
|
971
1108
|
case URLSearchParams:
|
|
972
1109
|
return createURLSearchParamsNode(ctx, id, current);
|
|
1110
|
+
case Blob:
|
|
1111
|
+
return createBlobNode(ctx, id, current);
|
|
1112
|
+
case File:
|
|
1113
|
+
return createFileNode(ctx, id, current);
|
|
1114
|
+
case Headers:
|
|
1115
|
+
return generateHeadersNode(ctx, id, current);
|
|
1116
|
+
case FormData:
|
|
1117
|
+
return generateFormDataNode(ctx, id, current);
|
|
973
1118
|
default:
|
|
974
1119
|
break;
|
|
975
1120
|
}
|
|
@@ -1022,18 +1167,10 @@ async function parseAsync(ctx, current) {
|
|
|
1022
1167
|
|
|
1023
1168
|
// src/tree/deserialize.ts
|
|
1024
1169
|
function assignIndexedValue(ctx, index, value) {
|
|
1025
|
-
ctx.
|
|
1026
|
-
|
|
1027
|
-
}
|
|
1028
|
-
function deserializeNodeList(ctx, node, result) {
|
|
1029
|
-
let item;
|
|
1030
|
-
for (let i = 0, len = node.a.length; i < len; i++) {
|
|
1031
|
-
item = node.a[i];
|
|
1032
|
-
if (item) {
|
|
1033
|
-
result[i] = deserializeTree(ctx, item);
|
|
1034
|
-
}
|
|
1170
|
+
if (ctx.markedRefs.has(index)) {
|
|
1171
|
+
ctx.valueMap.set(index, value);
|
|
1035
1172
|
}
|
|
1036
|
-
return
|
|
1173
|
+
return value;
|
|
1037
1174
|
}
|
|
1038
1175
|
function deserializeArray(ctx, node) {
|
|
1039
1176
|
const result = assignIndexedValue(
|
|
@@ -1041,9 +1178,13 @@ function deserializeArray(ctx, node) {
|
|
|
1041
1178
|
node.i,
|
|
1042
1179
|
new Array(node.l)
|
|
1043
1180
|
);
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1181
|
+
let item;
|
|
1182
|
+
for (let i = 0, len = node.l; i < len; i++) {
|
|
1183
|
+
item = node.a[i];
|
|
1184
|
+
if (item) {
|
|
1185
|
+
result[i] = deserializeTree(ctx, item);
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1047
1188
|
return result;
|
|
1048
1189
|
}
|
|
1049
1190
|
function deserializeProperties(ctx, node, result) {
|
|
@@ -1051,7 +1192,7 @@ function deserializeProperties(ctx, node, result) {
|
|
|
1051
1192
|
return {};
|
|
1052
1193
|
}
|
|
1053
1194
|
for (let i = 0; i < node.s; i++) {
|
|
1054
|
-
result[node.k[i]] = deserializeTree(ctx, node.v[i]);
|
|
1195
|
+
result[deserializeString(node.k[i])] = deserializeTree(ctx, node.v[i]);
|
|
1055
1196
|
}
|
|
1056
1197
|
return result;
|
|
1057
1198
|
}
|
|
@@ -1061,25 +1202,19 @@ function deserializeNullConstructor(ctx, node) {
|
|
|
1061
1202
|
node.i,
|
|
1062
1203
|
/* @__PURE__ */ Object.create(null)
|
|
1063
1204
|
);
|
|
1064
|
-
ctx.stack.push(node.i);
|
|
1065
1205
|
deserializeProperties(ctx, node.d, result);
|
|
1066
|
-
ctx.stack.pop();
|
|
1067
1206
|
return result;
|
|
1068
1207
|
}
|
|
1069
1208
|
function deserializeObject(ctx, node) {
|
|
1070
1209
|
const result = assignIndexedValue(ctx, node.i, {});
|
|
1071
|
-
ctx.stack.push(node.i);
|
|
1072
1210
|
deserializeProperties(ctx, node.d, result);
|
|
1073
|
-
ctx.stack.pop();
|
|
1074
1211
|
return result;
|
|
1075
1212
|
}
|
|
1076
1213
|
function deserializeSet(ctx, node) {
|
|
1077
1214
|
const result = assignIndexedValue(ctx, node.i, /* @__PURE__ */ new Set());
|
|
1078
|
-
|
|
1079
|
-
for (let i = 0, len = node.a.length; i < len; i++) {
|
|
1215
|
+
for (let i = 0, len = node.l; i < len; i++) {
|
|
1080
1216
|
result.add(deserializeTree(ctx, node.a[i]));
|
|
1081
1217
|
}
|
|
1082
|
-
ctx.stack.pop();
|
|
1083
1218
|
return result;
|
|
1084
1219
|
}
|
|
1085
1220
|
function deserializeMap(ctx, node) {
|
|
@@ -1088,35 +1223,32 @@ function deserializeMap(ctx, node) {
|
|
|
1088
1223
|
node.i,
|
|
1089
1224
|
/* @__PURE__ */ new Map()
|
|
1090
1225
|
);
|
|
1091
|
-
|
|
1092
|
-
for (let i = 0; i < node.d.s; i++) {
|
|
1226
|
+
for (let i = 0, len = node.d.s; i < len; i++) {
|
|
1093
1227
|
result.set(
|
|
1094
1228
|
deserializeTree(ctx, node.d.k[i]),
|
|
1095
1229
|
deserializeTree(ctx, node.d.v[i])
|
|
1096
1230
|
);
|
|
1097
1231
|
}
|
|
1098
|
-
ctx.stack.pop();
|
|
1099
1232
|
return result;
|
|
1100
1233
|
}
|
|
1101
1234
|
function deserializeDictionary(ctx, node, result) {
|
|
1102
1235
|
if (node.d) {
|
|
1103
|
-
ctx.stack.push(node.i);
|
|
1104
1236
|
const fields = deserializeProperties(ctx, node.d, {});
|
|
1105
|
-
ctx.stack.pop();
|
|
1106
1237
|
Object.assign(result, fields);
|
|
1107
1238
|
}
|
|
1108
1239
|
return result;
|
|
1109
1240
|
}
|
|
1110
1241
|
function deserializeAggregateError(ctx, node) {
|
|
1111
|
-
const result = assignIndexedValue(
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1242
|
+
const result = assignIndexedValue(
|
|
1243
|
+
ctx,
|
|
1244
|
+
node.i,
|
|
1245
|
+
new AggregateError([], deserializeString(node.m))
|
|
1246
|
+
);
|
|
1115
1247
|
return deserializeDictionary(ctx, node, result);
|
|
1116
1248
|
}
|
|
1117
1249
|
function deserializeError(ctx, node) {
|
|
1118
1250
|
const ErrorConstructor = getErrorConstructor(node.c);
|
|
1119
|
-
const result = assignIndexedValue(ctx, node.i, new ErrorConstructor(
|
|
1251
|
+
const result = assignIndexedValue(ctx, node.i, new ErrorConstructor(deserializeString(node.m)));
|
|
1120
1252
|
return deserializeDictionary(ctx, node, result);
|
|
1121
1253
|
}
|
|
1122
1254
|
function createDeferred() {
|
|
@@ -1136,33 +1268,103 @@ function deserializePromise(ctx, node) {
|
|
|
1136
1268
|
deferred.resolve(deserializeTree(ctx, node.f));
|
|
1137
1269
|
return result;
|
|
1138
1270
|
}
|
|
1271
|
+
function deserializeArrayBuffer(ctx, node) {
|
|
1272
|
+
const bytes = new Uint8Array(node.s);
|
|
1273
|
+
const result = assignIndexedValue(ctx, node.i, bytes.buffer);
|
|
1274
|
+
return result;
|
|
1275
|
+
}
|
|
1139
1276
|
function deserializeTypedArray(ctx, node) {
|
|
1140
1277
|
const TypedArray = getTypedArrayConstructor(node.c);
|
|
1141
|
-
const
|
|
1278
|
+
const source = deserializeTree(ctx, node.f);
|
|
1142
1279
|
const result = assignIndexedValue(ctx, node.i, new TypedArray(
|
|
1143
|
-
|
|
1280
|
+
source,
|
|
1281
|
+
node.b,
|
|
1144
1282
|
node.l
|
|
1145
1283
|
));
|
|
1146
|
-
for (let i = 0, len = node.s.length; i < len; i++) {
|
|
1147
|
-
result[i] = node.t === 23 /* BigIntTypedArray */ ? BigInt(node.s[i]) : Number(node.s[i]);
|
|
1148
|
-
}
|
|
1149
1284
|
return result;
|
|
1150
1285
|
}
|
|
1151
1286
|
function deserializeIterable(ctx, node) {
|
|
1152
1287
|
const values = [];
|
|
1153
|
-
|
|
1288
|
+
let item;
|
|
1289
|
+
for (let i = 0, len = node.l; i < len; i++) {
|
|
1290
|
+
item = node.a[i];
|
|
1291
|
+
if (item) {
|
|
1292
|
+
values[i] = deserializeTree(ctx, item);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1154
1295
|
const result = assignIndexedValue(ctx, node.i, {
|
|
1155
1296
|
[Symbol.iterator]: () => values.values()
|
|
1156
1297
|
});
|
|
1157
1298
|
return deserializeDictionary(ctx, node, result);
|
|
1158
1299
|
}
|
|
1300
|
+
function deserializeDate(ctx, node) {
|
|
1301
|
+
return assignIndexedValue(ctx, node.i, new Date(node.s));
|
|
1302
|
+
}
|
|
1303
|
+
function deserializeRegExp(ctx, node) {
|
|
1304
|
+
return assignIndexedValue(ctx, node.i, new RegExp(node.c, node.m));
|
|
1305
|
+
}
|
|
1306
|
+
function deserializeURL(ctx, node) {
|
|
1307
|
+
return assignIndexedValue(ctx, node.i, new URL(deserializeString(node.s)));
|
|
1308
|
+
}
|
|
1309
|
+
function deserializeURLSearchParams(ctx, node) {
|
|
1310
|
+
return assignIndexedValue(ctx, node.i, new URLSearchParams(deserializeString(node.s)));
|
|
1311
|
+
}
|
|
1312
|
+
function deserializeReference(ctx, node) {
|
|
1313
|
+
return assignIndexedValue(ctx, node.i, getReference(deserializeString(node.s)));
|
|
1314
|
+
}
|
|
1315
|
+
function deserializeDataView(ctx, node) {
|
|
1316
|
+
const source = deserializeTree(ctx, node.f);
|
|
1317
|
+
const result = assignIndexedValue(ctx, node.i, new DataView(
|
|
1318
|
+
source,
|
|
1319
|
+
node.b,
|
|
1320
|
+
node.l
|
|
1321
|
+
));
|
|
1322
|
+
return result;
|
|
1323
|
+
}
|
|
1324
|
+
function deserializeBlob(ctx, node) {
|
|
1325
|
+
const source = deserializeTree(ctx, node.f);
|
|
1326
|
+
const result = assignIndexedValue(ctx, node.i, new Blob(
|
|
1327
|
+
[source],
|
|
1328
|
+
{ type: deserializeString(node.c) }
|
|
1329
|
+
));
|
|
1330
|
+
return result;
|
|
1331
|
+
}
|
|
1332
|
+
function deserializeFile(ctx, node) {
|
|
1333
|
+
const source = deserializeTree(ctx, node.f);
|
|
1334
|
+
const result = assignIndexedValue(ctx, node.i, new File(
|
|
1335
|
+
[source],
|
|
1336
|
+
deserializeString(node.m),
|
|
1337
|
+
{ type: deserializeString(node.c), lastModified: node.b }
|
|
1338
|
+
));
|
|
1339
|
+
return result;
|
|
1340
|
+
}
|
|
1341
|
+
function deserializeHeaders(ctx, node) {
|
|
1342
|
+
const result = assignIndexedValue(ctx, node.i, new Headers());
|
|
1343
|
+
for (let i = 0, len = node.d.s; i < len; i++) {
|
|
1344
|
+
result.set(
|
|
1345
|
+
deserializeString(node.d.k[i]),
|
|
1346
|
+
deserializeTree(ctx, node.d.v[i])
|
|
1347
|
+
);
|
|
1348
|
+
}
|
|
1349
|
+
return result;
|
|
1350
|
+
}
|
|
1351
|
+
function deserializeFormData(ctx, node) {
|
|
1352
|
+
const result = assignIndexedValue(ctx, node.i, new FormData());
|
|
1353
|
+
for (let i = 0, len = node.d.s; i < len; i++) {
|
|
1354
|
+
result.set(
|
|
1355
|
+
deserializeString(node.d.k[i]),
|
|
1356
|
+
deserializeTree(ctx, node.d.v[i])
|
|
1357
|
+
);
|
|
1358
|
+
}
|
|
1359
|
+
return result;
|
|
1360
|
+
}
|
|
1159
1361
|
function deserializeTree(ctx, node) {
|
|
1160
1362
|
switch (node.t) {
|
|
1161
1363
|
case 0 /* Number */:
|
|
1162
1364
|
case 2 /* Boolean */:
|
|
1163
1365
|
return node.s;
|
|
1164
1366
|
case 1 /* String */:
|
|
1165
|
-
return
|
|
1367
|
+
return deserializeString(node.s);
|
|
1166
1368
|
case 4 /* Undefined */:
|
|
1167
1369
|
return void 0;
|
|
1168
1370
|
case 3 /* Null */:
|
|
@@ -1186,16 +1388,20 @@ function deserializeTree(ctx, node) {
|
|
|
1186
1388
|
case 17 /* NullConstructor */:
|
|
1187
1389
|
return deserializeNullConstructor(ctx, node);
|
|
1188
1390
|
case 11 /* Date */:
|
|
1189
|
-
return
|
|
1391
|
+
return deserializeDate(ctx, node);
|
|
1190
1392
|
case 12 /* RegExp */:
|
|
1191
|
-
return
|
|
1393
|
+
return deserializeRegExp(ctx, node);
|
|
1192
1394
|
case 13 /* Set */:
|
|
1193
1395
|
return deserializeSet(ctx, node);
|
|
1194
1396
|
case 14 /* Map */:
|
|
1195
1397
|
return deserializeMap(ctx, node);
|
|
1398
|
+
case 28 /* ArrayBuffer */:
|
|
1399
|
+
return deserializeArrayBuffer(ctx, node);
|
|
1196
1400
|
case 23 /* BigIntTypedArray */:
|
|
1197
1401
|
case 22 /* TypedArray */:
|
|
1198
1402
|
return deserializeTypedArray(ctx, node);
|
|
1403
|
+
case 29 /* DataView */:
|
|
1404
|
+
return deserializeDataView(ctx, node);
|
|
1199
1405
|
case 20 /* AggregateError */:
|
|
1200
1406
|
return deserializeAggregateError(ctx, node);
|
|
1201
1407
|
case 19 /* Error */:
|
|
@@ -1207,11 +1413,19 @@ function deserializeTree(ctx, node) {
|
|
|
1207
1413
|
case 24 /* WKSymbol */:
|
|
1208
1414
|
return SYMBOL_REF[node.s];
|
|
1209
1415
|
case 25 /* URL */:
|
|
1210
|
-
return
|
|
1416
|
+
return deserializeURL(ctx, node);
|
|
1211
1417
|
case 26 /* URLSearchParams */:
|
|
1212
|
-
return
|
|
1418
|
+
return deserializeURLSearchParams(ctx, node);
|
|
1213
1419
|
case 27 /* Reference */:
|
|
1214
|
-
return
|
|
1420
|
+
return deserializeReference(ctx, node);
|
|
1421
|
+
case 30 /* Blob */:
|
|
1422
|
+
return deserializeBlob(ctx, node);
|
|
1423
|
+
case 31 /* File */:
|
|
1424
|
+
return deserializeFile(ctx, node);
|
|
1425
|
+
case 32 /* Headers */:
|
|
1426
|
+
return deserializeHeaders(ctx, node);
|
|
1427
|
+
case 33 /* FormData */:
|
|
1428
|
+
return deserializeFormData(ctx, node);
|
|
1215
1429
|
default:
|
|
1216
1430
|
throw new Error("Unsupported type");
|
|
1217
1431
|
}
|
|
@@ -1222,10 +1436,12 @@ function getAssignmentExpression(assignment) {
|
|
|
1222
1436
|
switch (assignment.t) {
|
|
1223
1437
|
case "index":
|
|
1224
1438
|
return assignment.s + "=" + assignment.v;
|
|
1225
|
-
case "map":
|
|
1226
|
-
return assignment.s + ".set(" + assignment.k + "," + assignment.v + ")";
|
|
1227
1439
|
case "set":
|
|
1440
|
+
return assignment.s + ".set(" + assignment.k + "," + assignment.v + ")";
|
|
1441
|
+
case "add":
|
|
1228
1442
|
return assignment.s + ".add(" + assignment.v + ")";
|
|
1443
|
+
case "append":
|
|
1444
|
+
return assignment.s + ".append(" + assignment.k + "," + assignment.v + ")";
|
|
1229
1445
|
default:
|
|
1230
1446
|
return "";
|
|
1231
1447
|
}
|
|
@@ -1252,10 +1468,10 @@ function mergeAssignments(assignments) {
|
|
|
1252
1468
|
current = item;
|
|
1253
1469
|
}
|
|
1254
1470
|
break;
|
|
1255
|
-
case "
|
|
1471
|
+
case "set":
|
|
1256
1472
|
if (item.s === prev.s) {
|
|
1257
1473
|
current = {
|
|
1258
|
-
t: "
|
|
1474
|
+
t: "set",
|
|
1259
1475
|
s: getAssignmentExpression(current),
|
|
1260
1476
|
k: item.k,
|
|
1261
1477
|
v: item.v
|
|
@@ -1265,10 +1481,10 @@ function mergeAssignments(assignments) {
|
|
|
1265
1481
|
current = item;
|
|
1266
1482
|
}
|
|
1267
1483
|
break;
|
|
1268
|
-
case "
|
|
1484
|
+
case "add":
|
|
1269
1485
|
if (item.s === prev.s) {
|
|
1270
1486
|
current = {
|
|
1271
|
-
t: "
|
|
1487
|
+
t: "add",
|
|
1272
1488
|
s: getAssignmentExpression(current),
|
|
1273
1489
|
k: void 0,
|
|
1274
1490
|
v: item.v
|
|
@@ -1278,6 +1494,10 @@ function mergeAssignments(assignments) {
|
|
|
1278
1494
|
current = item;
|
|
1279
1495
|
}
|
|
1280
1496
|
break;
|
|
1497
|
+
case "append":
|
|
1498
|
+
newAssignments.push(current);
|
|
1499
|
+
current = item;
|
|
1500
|
+
break;
|
|
1281
1501
|
default:
|
|
1282
1502
|
break;
|
|
1283
1503
|
}
|
|
@@ -1312,26 +1532,31 @@ function createAssignment(ctx, source, value) {
|
|
|
1312
1532
|
v: value
|
|
1313
1533
|
});
|
|
1314
1534
|
}
|
|
1315
|
-
function
|
|
1316
|
-
markRef(ctx, ref);
|
|
1535
|
+
function createAddAssignment(ctx, ref, value) {
|
|
1317
1536
|
ctx.assignments.push({
|
|
1318
|
-
t: "
|
|
1537
|
+
t: "add",
|
|
1319
1538
|
s: getRefParam(ctx, ref),
|
|
1320
1539
|
k: void 0,
|
|
1321
1540
|
v: value
|
|
1322
1541
|
});
|
|
1323
1542
|
}
|
|
1324
|
-
function
|
|
1325
|
-
|
|
1543
|
+
function createSetAssignment(ctx, ref, key, value) {
|
|
1544
|
+
ctx.assignments.push({
|
|
1545
|
+
t: "set",
|
|
1546
|
+
s: getRefParam(ctx, ref),
|
|
1547
|
+
k: key,
|
|
1548
|
+
v: value
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1551
|
+
function createAppendAssignment(ctx, ref, key, value) {
|
|
1326
1552
|
ctx.assignments.push({
|
|
1327
|
-
t: "
|
|
1553
|
+
t: "append",
|
|
1328
1554
|
s: getRefParam(ctx, ref),
|
|
1329
1555
|
k: key,
|
|
1330
1556
|
v: value
|
|
1331
1557
|
});
|
|
1332
1558
|
}
|
|
1333
1559
|
function createArrayAssign(ctx, ref, index, value) {
|
|
1334
|
-
markRef(ctx, ref);
|
|
1335
1560
|
createAssignment(ctx, getRefParam(ctx, ref) + "[" + index + "]", value);
|
|
1336
1561
|
}
|
|
1337
1562
|
function createObjectAssign(ctx, ref, key, value) {
|
|
@@ -1359,6 +1584,7 @@ function serializeNodeList(ctx, node) {
|
|
|
1359
1584
|
item = node.a[i];
|
|
1360
1585
|
if (item) {
|
|
1361
1586
|
if (isIndexedValueInStack(ctx, item)) {
|
|
1587
|
+
markRef(ctx, node.i);
|
|
1362
1588
|
createArrayAssign(ctx, node.i, i, getRefParam(ctx, item.i));
|
|
1363
1589
|
isHoley = true;
|
|
1364
1590
|
} else {
|
|
@@ -1389,20 +1615,24 @@ function serializeProperties(ctx, sourceID, node) {
|
|
|
1389
1615
|
let isIdentifier;
|
|
1390
1616
|
let refParam;
|
|
1391
1617
|
let hasPrev = false;
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1618
|
+
const keys = node.k;
|
|
1619
|
+
const values = node.v;
|
|
1620
|
+
for (let i = 0, len = node.s; i < len; i++) {
|
|
1621
|
+
key = keys[i];
|
|
1622
|
+
val = values[i];
|
|
1395
1623
|
check = Number(key);
|
|
1396
1624
|
isIdentifier = check >= 0 || isValidIdentifier(key);
|
|
1397
1625
|
if (isIndexedValueInStack(ctx, val)) {
|
|
1398
1626
|
refParam = getRefParam(ctx, val.i);
|
|
1399
1627
|
if (isIdentifier && Number.isNaN(check)) {
|
|
1628
|
+
markRef(ctx, sourceID);
|
|
1400
1629
|
createObjectAssign(ctx, sourceID, key, refParam);
|
|
1401
1630
|
} else {
|
|
1402
|
-
|
|
1631
|
+
markRef(ctx, sourceID);
|
|
1632
|
+
createArrayAssign(ctx, sourceID, isIdentifier ? key : '"' + key + '"', refParam);
|
|
1403
1633
|
}
|
|
1404
1634
|
} else {
|
|
1405
|
-
result += (hasPrev ? "," : "") + (isIdentifier ? key : '"' +
|
|
1635
|
+
result += (hasPrev ? "," : "") + (isIdentifier ? key : '"' + key + '"') + ":" + serializeTree(ctx, val);
|
|
1406
1636
|
hasPrev = true;
|
|
1407
1637
|
}
|
|
1408
1638
|
}
|
|
@@ -1425,12 +1655,14 @@ function serializeAssignments(ctx, sourceID, node) {
|
|
|
1425
1655
|
let check;
|
|
1426
1656
|
let parentAssignment;
|
|
1427
1657
|
let isIdentifier;
|
|
1428
|
-
|
|
1658
|
+
const keys = node.k;
|
|
1659
|
+
const values = node.v;
|
|
1660
|
+
for (let i = 0, len = node.s; i < len; i++) {
|
|
1429
1661
|
parentStack = ctx.stack;
|
|
1430
1662
|
ctx.stack = [];
|
|
1431
|
-
refParam = serializeTree(ctx,
|
|
1663
|
+
refParam = serializeTree(ctx, values[i]);
|
|
1432
1664
|
ctx.stack = parentStack;
|
|
1433
|
-
key =
|
|
1665
|
+
key = keys[i];
|
|
1434
1666
|
check = Number(key);
|
|
1435
1667
|
parentAssignment = ctx.assignments;
|
|
1436
1668
|
ctx.assignments = mainAssignments;
|
|
@@ -1438,7 +1670,7 @@ function serializeAssignments(ctx, sourceID, node) {
|
|
|
1438
1670
|
if (isIdentifier && Number.isNaN(check)) {
|
|
1439
1671
|
createObjectAssign(ctx, sourceID, key, refParam);
|
|
1440
1672
|
} else {
|
|
1441
|
-
createArrayAssign(ctx, sourceID, isIdentifier ? key : '"' +
|
|
1673
|
+
createArrayAssign(ctx, sourceID, isIdentifier ? key : '"' + key + '"', refParam);
|
|
1442
1674
|
}
|
|
1443
1675
|
ctx.assignments = parentAssignment;
|
|
1444
1676
|
}
|
|
@@ -1476,7 +1708,8 @@ function serializeSet(ctx, node) {
|
|
|
1476
1708
|
for (let i = 0; i < size; i++) {
|
|
1477
1709
|
item = node.a[i];
|
|
1478
1710
|
if (isIndexedValueInStack(ctx, item)) {
|
|
1479
|
-
|
|
1711
|
+
markRef(ctx, node.i);
|
|
1712
|
+
createAddAssignment(ctx, node.i, getRefParam(ctx, item.i));
|
|
1480
1713
|
} else {
|
|
1481
1714
|
result += (hasPrev ? "," : "") + serializeTree(ctx, item);
|
|
1482
1715
|
hasPrev = true;
|
|
@@ -1505,20 +1738,22 @@ function serializeMap(ctx, node) {
|
|
|
1505
1738
|
val = node.d.v[i];
|
|
1506
1739
|
if (isIndexedValueInStack(ctx, key)) {
|
|
1507
1740
|
keyRef = getRefParam(ctx, key.i);
|
|
1741
|
+
markRef(ctx, node.i);
|
|
1508
1742
|
if (isIndexedValueInStack(ctx, val)) {
|
|
1509
1743
|
valueRef = getRefParam(ctx, val.i);
|
|
1510
|
-
|
|
1744
|
+
createSetAssignment(ctx, node.i, keyRef, valueRef);
|
|
1511
1745
|
} else {
|
|
1512
1746
|
parent = ctx.stack;
|
|
1513
1747
|
ctx.stack = [];
|
|
1514
|
-
|
|
1748
|
+
createSetAssignment(ctx, node.i, keyRef, serializeTree(ctx, val));
|
|
1515
1749
|
ctx.stack = parent;
|
|
1516
1750
|
}
|
|
1517
1751
|
} else if (isIndexedValueInStack(ctx, val)) {
|
|
1518
1752
|
valueRef = getRefParam(ctx, val.i);
|
|
1753
|
+
markRef(ctx, node.i);
|
|
1519
1754
|
parent = ctx.stack;
|
|
1520
1755
|
ctx.stack = [];
|
|
1521
|
-
|
|
1756
|
+
createSetAssignment(ctx, node.i, serializeTree(ctx, key), valueRef);
|
|
1522
1757
|
ctx.stack = parent;
|
|
1523
1758
|
} else {
|
|
1524
1759
|
result += (hasPrev ? ",[" : "[") + serializeTree(ctx, key) + "," + serializeTree(ctx, val) + "]";
|
|
@@ -1534,12 +1769,12 @@ function serializeMap(ctx, node) {
|
|
|
1534
1769
|
}
|
|
1535
1770
|
function serializeAggregateError(ctx, node) {
|
|
1536
1771
|
ctx.stack.push(node.i);
|
|
1537
|
-
const serialized =
|
|
1772
|
+
const serialized = 'new AggregateError([],"' + node.m + '")';
|
|
1538
1773
|
ctx.stack.pop();
|
|
1539
1774
|
return serializeDictionary(ctx, node.i, node.d, serialized);
|
|
1540
1775
|
}
|
|
1541
1776
|
function serializeError(ctx, node) {
|
|
1542
|
-
const serialized = "new " + node.c + '("' +
|
|
1777
|
+
const serialized = "new " + node.c + '("' + node.m + '")';
|
|
1543
1778
|
return serializeDictionary(ctx, node.i, node.d, serialized);
|
|
1544
1779
|
}
|
|
1545
1780
|
function serializePromise(ctx, node) {
|
|
@@ -1559,13 +1794,19 @@ function serializePromise(ctx, node) {
|
|
|
1559
1794
|
}
|
|
1560
1795
|
return assignIndexedValue2(ctx, node.i, serialized);
|
|
1561
1796
|
}
|
|
1562
|
-
function
|
|
1563
|
-
let result = "";
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1797
|
+
function serializeArrayBuffer2(ctx, node) {
|
|
1798
|
+
let result = "new Uint8Array(";
|
|
1799
|
+
if (node.s.length) {
|
|
1800
|
+
result += "[";
|
|
1801
|
+
for (let i = 0, len = node.s.length; i < len; i++) {
|
|
1802
|
+
result += (i > 0 ? "," : "") + node.s[i];
|
|
1803
|
+
}
|
|
1804
|
+
result += "]";
|
|
1567
1805
|
}
|
|
1568
|
-
|
|
1806
|
+
return assignIndexedValue2(ctx, node.i, result + ").buffer");
|
|
1807
|
+
}
|
|
1808
|
+
function serializeTypedArray(ctx, node) {
|
|
1809
|
+
const args = serializeTree(ctx, node.f) + "," + node.b + "," + node.l;
|
|
1569
1810
|
return assignIndexedValue2(ctx, node.i, "new " + node.c + "(" + args + ")");
|
|
1570
1811
|
}
|
|
1571
1812
|
function serializeIterable(ctx, node) {
|
|
@@ -1588,6 +1829,68 @@ function serializeIterable(ctx, node) {
|
|
|
1588
1829
|
}
|
|
1589
1830
|
return serializeDictionary(ctx, node.i, node.d, serialized);
|
|
1590
1831
|
}
|
|
1832
|
+
function serializeDate(ctx, node) {
|
|
1833
|
+
return assignIndexedValue2(ctx, node.i, 'new Date("' + node.s + '")');
|
|
1834
|
+
}
|
|
1835
|
+
function serializeRegExp(ctx, node) {
|
|
1836
|
+
return assignIndexedValue2(ctx, node.i, "/" + node.c + "/" + node.m);
|
|
1837
|
+
}
|
|
1838
|
+
function serializeURL(ctx, node) {
|
|
1839
|
+
return assignIndexedValue2(ctx, node.i, 'new URL("' + node.s + '")');
|
|
1840
|
+
}
|
|
1841
|
+
function serializeURLSearchParams(ctx, node) {
|
|
1842
|
+
return assignIndexedValue2(ctx, node.i, node.s ? 'new URLSearchParams("' + node.s + '")' : "new URLSearchParams");
|
|
1843
|
+
}
|
|
1844
|
+
function serializeReference(ctx, node) {
|
|
1845
|
+
return assignIndexedValue2(ctx, node.i, GLOBAL_KEY + '.get("' + node.s + '")');
|
|
1846
|
+
}
|
|
1847
|
+
function serializeDataView(ctx, node) {
|
|
1848
|
+
const args = serializeTree(ctx, node.f) + "," + node.b + "," + node.l;
|
|
1849
|
+
return assignIndexedValue2(ctx, node.i, "new DataView(" + args + ")");
|
|
1850
|
+
}
|
|
1851
|
+
function serializeBlob(ctx, node) {
|
|
1852
|
+
const args = "[" + serializeTree(ctx, node.f) + '],{type:"' + node.c + '"}';
|
|
1853
|
+
return assignIndexedValue2(ctx, node.i, "new Blob(" + args + ")");
|
|
1854
|
+
}
|
|
1855
|
+
function serializeFile(ctx, node) {
|
|
1856
|
+
const options = '{type:"' + node.c + '",lastModified:' + node.b + "}";
|
|
1857
|
+
const args = "[" + serializeTree(ctx, node.f) + '],"' + node.m + '",' + options;
|
|
1858
|
+
return assignIndexedValue2(ctx, node.i, "new File(" + args + ")");
|
|
1859
|
+
}
|
|
1860
|
+
function serializeHeaders(ctx, node) {
|
|
1861
|
+
return assignIndexedValue2(ctx, node.i, "new Headers(" + serializeProperties(ctx, node.i, node.d) + ")");
|
|
1862
|
+
}
|
|
1863
|
+
function serializeFormDataEntries(ctx, node) {
|
|
1864
|
+
ctx.stack.push(node.i);
|
|
1865
|
+
const mainAssignments = [];
|
|
1866
|
+
let parentStack;
|
|
1867
|
+
let value;
|
|
1868
|
+
let key;
|
|
1869
|
+
let parentAssignment;
|
|
1870
|
+
for (let i = 0; i < node.d.s; i++) {
|
|
1871
|
+
parentStack = ctx.stack;
|
|
1872
|
+
ctx.stack = [];
|
|
1873
|
+
value = serializeTree(ctx, node.d.v[i]);
|
|
1874
|
+
key = node.d.k[i];
|
|
1875
|
+
ctx.stack = parentStack;
|
|
1876
|
+
parentAssignment = ctx.assignments;
|
|
1877
|
+
ctx.assignments = mainAssignments;
|
|
1878
|
+
createAppendAssignment(ctx, node.i, '"' + key + '"', value);
|
|
1879
|
+
ctx.assignments = parentAssignment;
|
|
1880
|
+
}
|
|
1881
|
+
ctx.stack.pop();
|
|
1882
|
+
return resolveAssignments(mainAssignments);
|
|
1883
|
+
}
|
|
1884
|
+
function serializeFormData(ctx, node) {
|
|
1885
|
+
if (node.d.s) {
|
|
1886
|
+
markRef(ctx, node.i);
|
|
1887
|
+
}
|
|
1888
|
+
const result = assignIndexedValue2(ctx, node.i, "new FormData()");
|
|
1889
|
+
if (node.d.s) {
|
|
1890
|
+
return "(" + result + "," + serializeFormDataEntries(ctx, node) + getRefParam(ctx, node.i) + ")";
|
|
1891
|
+
}
|
|
1892
|
+
return result;
|
|
1893
|
+
}
|
|
1591
1894
|
function serializeTree(ctx, node) {
|
|
1592
1895
|
switch (node.t) {
|
|
1593
1896
|
case 0 /* Number */:
|
|
@@ -1619,16 +1922,20 @@ function serializeTree(ctx, node) {
|
|
|
1619
1922
|
case 17 /* NullConstructor */:
|
|
1620
1923
|
return serializeNullConstructor(ctx, node);
|
|
1621
1924
|
case 11 /* Date */:
|
|
1622
|
-
return
|
|
1925
|
+
return serializeDate(ctx, node);
|
|
1623
1926
|
case 12 /* RegExp */:
|
|
1624
|
-
return
|
|
1927
|
+
return serializeRegExp(ctx, node);
|
|
1625
1928
|
case 13 /* Set */:
|
|
1626
1929
|
return serializeSet(ctx, node);
|
|
1627
1930
|
case 14 /* Map */:
|
|
1628
1931
|
return serializeMap(ctx, node);
|
|
1932
|
+
case 28 /* ArrayBuffer */:
|
|
1933
|
+
return serializeArrayBuffer2(ctx, node);
|
|
1629
1934
|
case 23 /* BigIntTypedArray */:
|
|
1630
1935
|
case 22 /* TypedArray */:
|
|
1631
1936
|
return serializeTypedArray(ctx, node);
|
|
1937
|
+
case 29 /* DataView */:
|
|
1938
|
+
return serializeDataView(ctx, node);
|
|
1632
1939
|
case 20 /* AggregateError */:
|
|
1633
1940
|
return serializeAggregateError(ctx, node);
|
|
1634
1941
|
case 19 /* Error */:
|
|
@@ -1640,11 +1947,19 @@ function serializeTree(ctx, node) {
|
|
|
1640
1947
|
case 24 /* WKSymbol */:
|
|
1641
1948
|
return SYMBOL_STRING[node.s];
|
|
1642
1949
|
case 25 /* URL */:
|
|
1643
|
-
return
|
|
1950
|
+
return serializeURL(ctx, node);
|
|
1644
1951
|
case 26 /* URLSearchParams */:
|
|
1645
|
-
return
|
|
1952
|
+
return serializeURLSearchParams(ctx, node);
|
|
1646
1953
|
case 27 /* Reference */:
|
|
1647
|
-
return
|
|
1954
|
+
return serializeReference(ctx, node);
|
|
1955
|
+
case 30 /* Blob */:
|
|
1956
|
+
return serializeBlob(ctx, node);
|
|
1957
|
+
case 31 /* File */:
|
|
1958
|
+
return serializeFile(ctx, node);
|
|
1959
|
+
case 32 /* Headers */:
|
|
1960
|
+
return serializeHeaders(ctx, node);
|
|
1961
|
+
case 33 /* FormData */:
|
|
1962
|
+
return serializeFormData(ctx, node);
|
|
1648
1963
|
default:
|
|
1649
1964
|
throw new Error("Unsupported type");
|
|
1650
1965
|
}
|
|
@@ -1683,7 +1998,8 @@ function generateArrayNode2(ctx, id, current) {
|
|
|
1683
1998
|
m: void 0,
|
|
1684
1999
|
d: void 0,
|
|
1685
2000
|
a: generateNodeList2(ctx, current),
|
|
1686
|
-
f: void 0
|
|
2001
|
+
f: void 0,
|
|
2002
|
+
b: void 0
|
|
1687
2003
|
};
|
|
1688
2004
|
}
|
|
1689
2005
|
function generateMapNode2(ctx, id, current) {
|
|
@@ -1719,7 +2035,8 @@ function generateMapNode2(ctx, id, current) {
|
|
|
1719
2035
|
m: void 0,
|
|
1720
2036
|
d: { k: keyNodes, v: valueNodes, s: len },
|
|
1721
2037
|
a: void 0,
|
|
1722
|
-
f: void 0
|
|
2038
|
+
f: void 0,
|
|
2039
|
+
b: void 0
|
|
1723
2040
|
};
|
|
1724
2041
|
}
|
|
1725
2042
|
function generateSetNode2(ctx, id, current) {
|
|
@@ -1748,7 +2065,8 @@ function generateSetNode2(ctx, id, current) {
|
|
|
1748
2065
|
m: void 0,
|
|
1749
2066
|
d: void 0,
|
|
1750
2067
|
a: nodes,
|
|
1751
|
-
f: void 0
|
|
2068
|
+
f: void 0,
|
|
2069
|
+
b: void 0
|
|
1752
2070
|
};
|
|
1753
2071
|
}
|
|
1754
2072
|
function generateProperties2(ctx, properties) {
|
|
@@ -1761,14 +2079,16 @@ function generateProperties2(ctx, properties) {
|
|
|
1761
2079
|
let deferredSize = 0;
|
|
1762
2080
|
let nodesSize = 0;
|
|
1763
2081
|
let item;
|
|
2082
|
+
let escaped;
|
|
1764
2083
|
for (const key of keys) {
|
|
1765
2084
|
item = properties[key];
|
|
2085
|
+
escaped = serializeString(key);
|
|
1766
2086
|
if (isIterable(item)) {
|
|
1767
|
-
deferredKeys[deferredSize] =
|
|
2087
|
+
deferredKeys[deferredSize] = escaped;
|
|
1768
2088
|
deferredValues[deferredSize] = item;
|
|
1769
2089
|
deferredSize++;
|
|
1770
2090
|
} else {
|
|
1771
|
-
keyNodes[nodesSize] =
|
|
2091
|
+
keyNodes[nodesSize] = escaped;
|
|
1772
2092
|
valueNodes[nodesSize] = parse2(ctx, item);
|
|
1773
2093
|
nodesSize++;
|
|
1774
2094
|
}
|
|
@@ -1797,7 +2117,8 @@ function generateIterableNode2(ctx, id, current) {
|
|
|
1797
2117
|
// Parse options first before the items
|
|
1798
2118
|
d: options ? generateProperties2(ctx, options) : void 0,
|
|
1799
2119
|
a: generateNodeList2(ctx, array),
|
|
1800
|
-
f: void 0
|
|
2120
|
+
f: void 0,
|
|
2121
|
+
b: void 0
|
|
1801
2122
|
};
|
|
1802
2123
|
}
|
|
1803
2124
|
function generateObjectNode2(ctx, id, current, empty) {
|
|
@@ -1813,7 +2134,8 @@ function generateObjectNode2(ctx, id, current, empty) {
|
|
|
1813
2134
|
m: void 0,
|
|
1814
2135
|
d: generateProperties2(ctx, current),
|
|
1815
2136
|
a: void 0,
|
|
1816
|
-
f: void 0
|
|
2137
|
+
f: void 0,
|
|
2138
|
+
b: void 0
|
|
1817
2139
|
};
|
|
1818
2140
|
}
|
|
1819
2141
|
function generateAggregateErrorNode2(ctx, id, current) {
|
|
@@ -1823,12 +2145,13 @@ function generateAggregateErrorNode2(ctx, id, current) {
|
|
|
1823
2145
|
t: 20 /* AggregateError */,
|
|
1824
2146
|
i: id,
|
|
1825
2147
|
s: void 0,
|
|
1826
|
-
l:
|
|
2148
|
+
l: void 0,
|
|
1827
2149
|
c: void 0,
|
|
1828
|
-
m:
|
|
2150
|
+
m: serializeString(current.message),
|
|
1829
2151
|
d: optionsNode,
|
|
1830
|
-
a:
|
|
1831
|
-
f: void 0
|
|
2152
|
+
a: void 0,
|
|
2153
|
+
f: void 0,
|
|
2154
|
+
b: void 0
|
|
1832
2155
|
};
|
|
1833
2156
|
}
|
|
1834
2157
|
function generateErrorNode2(ctx, id, current) {
|
|
@@ -1840,10 +2163,49 @@ function generateErrorNode2(ctx, id, current) {
|
|
|
1840
2163
|
s: void 0,
|
|
1841
2164
|
l: void 0,
|
|
1842
2165
|
c: getErrorConstructorName(current),
|
|
1843
|
-
m:
|
|
2166
|
+
m: serializeString(current.message),
|
|
1844
2167
|
d: optionsNode,
|
|
1845
2168
|
a: void 0,
|
|
1846
|
-
f: void 0
|
|
2169
|
+
f: void 0,
|
|
2170
|
+
b: void 0
|
|
2171
|
+
};
|
|
2172
|
+
}
|
|
2173
|
+
function generateHeadersNode2(ctx, id, current) {
|
|
2174
|
+
assert(ctx.features & 8192 /* WebAPI */, 'Unsupported type "Headers"');
|
|
2175
|
+
const items = {};
|
|
2176
|
+
current.forEach((value, key) => {
|
|
2177
|
+
items[key] = value;
|
|
2178
|
+
});
|
|
2179
|
+
return {
|
|
2180
|
+
t: 32 /* Headers */,
|
|
2181
|
+
i: id,
|
|
2182
|
+
s: void 0,
|
|
2183
|
+
l: void 0,
|
|
2184
|
+
c: void 0,
|
|
2185
|
+
m: void 0,
|
|
2186
|
+
d: generateProperties2(ctx, items),
|
|
2187
|
+
a: void 0,
|
|
2188
|
+
f: void 0,
|
|
2189
|
+
b: void 0
|
|
2190
|
+
};
|
|
2191
|
+
}
|
|
2192
|
+
function generateFormDataNode2(ctx, id, current) {
|
|
2193
|
+
assert(ctx.features & 8192 /* WebAPI */, 'Unsupported type "FormData"');
|
|
2194
|
+
const items = {};
|
|
2195
|
+
current.forEach((value, key) => {
|
|
2196
|
+
items[key] = value;
|
|
2197
|
+
});
|
|
2198
|
+
return {
|
|
2199
|
+
t: 33 /* FormData */,
|
|
2200
|
+
i: id,
|
|
2201
|
+
s: void 0,
|
|
2202
|
+
l: void 0,
|
|
2203
|
+
c: void 0,
|
|
2204
|
+
m: void 0,
|
|
2205
|
+
d: generateProperties2(ctx, items),
|
|
2206
|
+
a: void 0,
|
|
2207
|
+
f: void 0,
|
|
2208
|
+
b: void 0
|
|
1847
2209
|
};
|
|
1848
2210
|
}
|
|
1849
2211
|
function parse2(ctx, current) {
|
|
@@ -1890,6 +2252,8 @@ function parse2(ctx, current) {
|
|
|
1890
2252
|
return createDateNode(id, current);
|
|
1891
2253
|
case RegExp:
|
|
1892
2254
|
return createRegExpNode(id, current);
|
|
2255
|
+
case ArrayBuffer:
|
|
2256
|
+
return createArrayBufferNode(id, current);
|
|
1893
2257
|
case Int8Array:
|
|
1894
2258
|
case Int16Array:
|
|
1895
2259
|
case Int32Array:
|
|
@@ -1903,6 +2267,8 @@ function parse2(ctx, current) {
|
|
|
1903
2267
|
case BigInt64Array:
|
|
1904
2268
|
case BigUint64Array:
|
|
1905
2269
|
return createBigIntTypedArrayNode(ctx, id, current);
|
|
2270
|
+
case DataView:
|
|
2271
|
+
return createDataViewNode(ctx, id, current);
|
|
1906
2272
|
case Map:
|
|
1907
2273
|
return generateMapNode2(ctx, id, current);
|
|
1908
2274
|
case Set:
|
|
@@ -1938,6 +2304,10 @@ function parse2(ctx, current) {
|
|
|
1938
2304
|
return createURLNode(ctx, id, current);
|
|
1939
2305
|
case URLSearchParams:
|
|
1940
2306
|
return createURLSearchParamsNode(ctx, id, current);
|
|
2307
|
+
case Headers:
|
|
2308
|
+
return generateHeadersNode2(ctx, id, current);
|
|
2309
|
+
case FormData:
|
|
2310
|
+
return generateFormDataNode2(ctx, id, current);
|
|
1941
2311
|
default:
|
|
1942
2312
|
break;
|
|
1943
2313
|
}
|