oxc-parser 0.99.0 → 0.102.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/generated/deserialize/js.js +331 -329
- package/generated/deserialize/js_range.js +331 -329
- package/generated/deserialize/ts.js +347 -341
- package/generated/deserialize/ts_range.js +347 -341
- package/generated/lazy/constructors.js +549 -496
- package/generated/lazy/type_ids.js +180 -180
- package/generated/lazy/walk.js +11 -7
- package/generated/visit/keys.js +214 -166
- package/generated/visit/type_ids.js +165 -165
- package/generated/visit/visitor.d.ts +171 -167
- package/generated/visit/walk.js +165 -165
- package/package.json +26 -26
- package/src-js/bindings.js +52 -52
- package/src-js/index.d.ts +19 -19
- package/src-js/index.js +9 -9
- package/src-js/raw-transfer/common.js +12 -8
- package/src-js/raw-transfer/eager.js +18 -16
- package/src-js/raw-transfer/lazy-common.js +1 -1
- package/src-js/raw-transfer/lazy.js +10 -12
- package/src-js/raw-transfer/node-array.js +16 -10
- package/src-js/raw-transfer/supported.js +2 -2
- package/src-js/raw-transfer/visitor.js +9 -5
- package/src-js/visit/index.js +7 -3
- package/src-js/visit/visitor.js +11 -6
- package/src-js/wasm.js +3 -3
- package/src-js/webcontainer-fallback.cjs +7 -7
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
let uint8, uint32, float64, sourceText, sourceIsAscii, sourceByteLen;
|
|
5
5
|
|
|
6
|
-
const textDecoder = new TextDecoder(
|
|
6
|
+
const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true }),
|
|
7
7
|
decodeStr = textDecoder.decode.bind(textDecoder),
|
|
8
8
|
{ fromCodePoint } = String;
|
|
9
9
|
|
|
@@ -31,7 +31,7 @@ export function resetBuffer() {
|
|
|
31
31
|
function deserializeProgram(pos) {
|
|
32
32
|
let end = deserializeU32(pos + 4),
|
|
33
33
|
program = {
|
|
34
|
-
type:
|
|
34
|
+
type: "Program",
|
|
35
35
|
body: null,
|
|
36
36
|
sourceType: deserializeModuleKind(pos + 125),
|
|
37
37
|
hashbang: null,
|
|
@@ -46,9 +46,13 @@ function deserializeProgram(pos) {
|
|
|
46
46
|
if (body.length > 0) {
|
|
47
47
|
let first = body[0];
|
|
48
48
|
start = first.start;
|
|
49
|
-
if (first.type ===
|
|
49
|
+
if (first.type === "ExportNamedDeclaration" || first.type === "ExportDefaultDeclaration") {
|
|
50
50
|
let { declaration } = first;
|
|
51
|
-
if (
|
|
51
|
+
if (
|
|
52
|
+
declaration !== null &&
|
|
53
|
+
declaration.type === "ClassDeclaration" &&
|
|
54
|
+
declaration.decorators.length > 0
|
|
55
|
+
) {
|
|
52
56
|
let decoratorStart = declaration.decorators[0].start;
|
|
53
57
|
decoratorStart < start && (start = decoratorStart);
|
|
54
58
|
}
|
|
@@ -156,7 +160,7 @@ function deserializeIdentifierName(pos) {
|
|
|
156
160
|
let start = deserializeU32(pos),
|
|
157
161
|
end = deserializeU32(pos + 4),
|
|
158
162
|
node = {
|
|
159
|
-
type:
|
|
163
|
+
type: "Identifier",
|
|
160
164
|
decorators: null,
|
|
161
165
|
name: deserializeStr(pos + 8),
|
|
162
166
|
optional: null,
|
|
@@ -173,7 +177,7 @@ function deserializeIdentifierReference(pos) {
|
|
|
173
177
|
let start = deserializeU32(pos),
|
|
174
178
|
end = deserializeU32(pos + 4),
|
|
175
179
|
node = {
|
|
176
|
-
type:
|
|
180
|
+
type: "Identifier",
|
|
177
181
|
decorators: null,
|
|
178
182
|
name: deserializeStr(pos + 8),
|
|
179
183
|
optional: null,
|
|
@@ -190,7 +194,7 @@ function deserializeBindingIdentifier(pos) {
|
|
|
190
194
|
let start = deserializeU32(pos),
|
|
191
195
|
end = deserializeU32(pos + 4),
|
|
192
196
|
node = {
|
|
193
|
-
type:
|
|
197
|
+
type: "Identifier",
|
|
194
198
|
decorators: null,
|
|
195
199
|
name: deserializeStr(pos + 8),
|
|
196
200
|
optional: null,
|
|
@@ -207,7 +211,7 @@ function deserializeLabelIdentifier(pos) {
|
|
|
207
211
|
let start = deserializeU32(pos),
|
|
208
212
|
end = deserializeU32(pos + 4),
|
|
209
213
|
node = {
|
|
210
|
-
type:
|
|
214
|
+
type: "Identifier",
|
|
211
215
|
decorators: null,
|
|
212
216
|
name: deserializeStr(pos + 8),
|
|
213
217
|
optional: null,
|
|
@@ -222,7 +226,7 @@ function deserializeLabelIdentifier(pos) {
|
|
|
222
226
|
|
|
223
227
|
function deserializeThisExpression(pos) {
|
|
224
228
|
return {
|
|
225
|
-
type:
|
|
229
|
+
type: "ThisExpression",
|
|
226
230
|
start: deserializeU32(pos),
|
|
227
231
|
end: deserializeU32(pos + 4),
|
|
228
232
|
};
|
|
@@ -230,7 +234,7 @@ function deserializeThisExpression(pos) {
|
|
|
230
234
|
|
|
231
235
|
function deserializeArrayExpression(pos) {
|
|
232
236
|
let node = {
|
|
233
|
-
type:
|
|
237
|
+
type: "ArrayExpression",
|
|
234
238
|
elements: null,
|
|
235
239
|
start: deserializeU32(pos),
|
|
236
240
|
end: deserializeU32(pos + 4),
|
|
@@ -342,7 +346,7 @@ function deserializeElision(pos) {
|
|
|
342
346
|
|
|
343
347
|
function deserializeObjectExpression(pos) {
|
|
344
348
|
let node = {
|
|
345
|
-
type:
|
|
349
|
+
type: "ObjectExpression",
|
|
346
350
|
properties: null,
|
|
347
351
|
start: deserializeU32(pos),
|
|
348
352
|
end: deserializeU32(pos + 4),
|
|
@@ -366,7 +370,7 @@ function deserializeObjectProperty(pos) {
|
|
|
366
370
|
let start = deserializeU32(pos),
|
|
367
371
|
end = deserializeU32(pos + 4),
|
|
368
372
|
node = {
|
|
369
|
-
type:
|
|
373
|
+
type: "Property",
|
|
370
374
|
kind: deserializePropertyKind(pos + 40),
|
|
371
375
|
key: null,
|
|
372
376
|
value: null,
|
|
@@ -483,11 +487,11 @@ function deserializePropertyKey(pos) {
|
|
|
483
487
|
function deserializePropertyKind(pos) {
|
|
484
488
|
switch (uint8[pos]) {
|
|
485
489
|
case 0:
|
|
486
|
-
return
|
|
490
|
+
return "init";
|
|
487
491
|
case 1:
|
|
488
|
-
return
|
|
492
|
+
return "get";
|
|
489
493
|
case 2:
|
|
490
|
-
return
|
|
494
|
+
return "set";
|
|
491
495
|
default:
|
|
492
496
|
throw Error(`Unexpected discriminant ${uint8[pos]} for PropertyKind`);
|
|
493
497
|
}
|
|
@@ -495,7 +499,7 @@ function deserializePropertyKind(pos) {
|
|
|
495
499
|
|
|
496
500
|
function deserializeTemplateLiteral(pos) {
|
|
497
501
|
let node = {
|
|
498
|
-
type:
|
|
502
|
+
type: "TemplateLiteral",
|
|
499
503
|
quasis: null,
|
|
500
504
|
expressions: null,
|
|
501
505
|
start: deserializeU32(pos),
|
|
@@ -508,7 +512,7 @@ function deserializeTemplateLiteral(pos) {
|
|
|
508
512
|
|
|
509
513
|
function deserializeTaggedTemplateExpression(pos) {
|
|
510
514
|
let node = {
|
|
511
|
-
type:
|
|
515
|
+
type: "TaggedTemplateExpression",
|
|
512
516
|
tag: null,
|
|
513
517
|
typeArguments: null,
|
|
514
518
|
quasi: null,
|
|
@@ -528,9 +532,11 @@ function deserializeTemplateElement(pos) {
|
|
|
528
532
|
value = deserializeTemplateElementValue(pos + 8);
|
|
529
533
|
value.cooked !== null &&
|
|
530
534
|
deserializeBool(pos + 41) &&
|
|
531
|
-
(value.cooked = value.cooked.replace(/\uFFFD(.{4})/g, (_, hex) =>
|
|
535
|
+
(value.cooked = value.cooked.replace(/\uFFFD(.{4})/g, (_, hex) =>
|
|
536
|
+
String.fromCodePoint(parseInt(hex, 16)),
|
|
537
|
+
));
|
|
532
538
|
return {
|
|
533
|
-
type:
|
|
539
|
+
type: "TemplateElement",
|
|
534
540
|
value,
|
|
535
541
|
tail,
|
|
536
542
|
start,
|
|
@@ -549,7 +555,7 @@ function deserializeComputedMemberExpression(pos) {
|
|
|
549
555
|
let start = deserializeU32(pos),
|
|
550
556
|
end = deserializeU32(pos + 4),
|
|
551
557
|
node = {
|
|
552
|
-
type:
|
|
558
|
+
type: "MemberExpression",
|
|
553
559
|
object: null,
|
|
554
560
|
property: null,
|
|
555
561
|
optional: deserializeBool(pos + 40),
|
|
@@ -567,7 +573,7 @@ function deserializeStaticMemberExpression(pos) {
|
|
|
567
573
|
let start = deserializeU32(pos),
|
|
568
574
|
end = deserializeU32(pos + 4),
|
|
569
575
|
node = {
|
|
570
|
-
type:
|
|
576
|
+
type: "MemberExpression",
|
|
571
577
|
object: null,
|
|
572
578
|
property: null,
|
|
573
579
|
optional: deserializeBool(pos + 48),
|
|
@@ -585,7 +591,7 @@ function deserializePrivateFieldExpression(pos) {
|
|
|
585
591
|
let start = deserializeU32(pos),
|
|
586
592
|
end = deserializeU32(pos + 4),
|
|
587
593
|
node = {
|
|
588
|
-
type:
|
|
594
|
+
type: "MemberExpression",
|
|
589
595
|
object: null,
|
|
590
596
|
property: null,
|
|
591
597
|
optional: deserializeBool(pos + 48),
|
|
@@ -603,7 +609,7 @@ function deserializeCallExpression(pos) {
|
|
|
603
609
|
let start = deserializeU32(pos),
|
|
604
610
|
end = deserializeU32(pos + 4),
|
|
605
611
|
node = {
|
|
606
|
-
type:
|
|
612
|
+
type: "CallExpression",
|
|
607
613
|
callee: null,
|
|
608
614
|
typeArguments: null,
|
|
609
615
|
arguments: null,
|
|
@@ -619,7 +625,7 @@ function deserializeCallExpression(pos) {
|
|
|
619
625
|
|
|
620
626
|
function deserializeNewExpression(pos) {
|
|
621
627
|
let node = {
|
|
622
|
-
type:
|
|
628
|
+
type: "NewExpression",
|
|
623
629
|
callee: null,
|
|
624
630
|
typeArguments: null,
|
|
625
631
|
arguments: null,
|
|
@@ -634,7 +640,7 @@ function deserializeNewExpression(pos) {
|
|
|
634
640
|
|
|
635
641
|
function deserializeMetaProperty(pos) {
|
|
636
642
|
let node = {
|
|
637
|
-
type:
|
|
643
|
+
type: "MetaProperty",
|
|
638
644
|
meta: null,
|
|
639
645
|
property: null,
|
|
640
646
|
start: deserializeU32(pos),
|
|
@@ -647,7 +653,7 @@ function deserializeMetaProperty(pos) {
|
|
|
647
653
|
|
|
648
654
|
function deserializeSpreadElement(pos) {
|
|
649
655
|
let node = {
|
|
650
|
-
type:
|
|
656
|
+
type: "SpreadElement",
|
|
651
657
|
argument: null,
|
|
652
658
|
start: deserializeU32(pos),
|
|
653
659
|
end: deserializeU32(pos + 4),
|
|
@@ -755,7 +761,7 @@ function deserializeUpdateExpression(pos) {
|
|
|
755
761
|
let start = deserializeU32(pos),
|
|
756
762
|
end = deserializeU32(pos + 4),
|
|
757
763
|
node = {
|
|
758
|
-
type:
|
|
764
|
+
type: "UpdateExpression",
|
|
759
765
|
operator: deserializeUpdateOperator(pos + 24),
|
|
760
766
|
prefix: deserializeBool(pos + 25),
|
|
761
767
|
argument: null,
|
|
@@ -770,7 +776,7 @@ function deserializeUnaryExpression(pos) {
|
|
|
770
776
|
let start = deserializeU32(pos),
|
|
771
777
|
end = deserializeU32(pos + 4),
|
|
772
778
|
node = {
|
|
773
|
-
type:
|
|
779
|
+
type: "UnaryExpression",
|
|
774
780
|
operator: deserializeUnaryOperator(pos + 24),
|
|
775
781
|
argument: null,
|
|
776
782
|
prefix: null,
|
|
@@ -786,7 +792,7 @@ function deserializeBinaryExpression(pos) {
|
|
|
786
792
|
let start = deserializeU32(pos),
|
|
787
793
|
end = deserializeU32(pos + 4),
|
|
788
794
|
node = {
|
|
789
|
-
type:
|
|
795
|
+
type: "BinaryExpression",
|
|
790
796
|
left: null,
|
|
791
797
|
operator: deserializeBinaryOperator(pos + 40),
|
|
792
798
|
right: null,
|
|
@@ -800,7 +806,7 @@ function deserializeBinaryExpression(pos) {
|
|
|
800
806
|
|
|
801
807
|
function deserializePrivateInExpression(pos) {
|
|
802
808
|
let node = {
|
|
803
|
-
type:
|
|
809
|
+
type: "BinaryExpression",
|
|
804
810
|
left: null,
|
|
805
811
|
operator: null,
|
|
806
812
|
right: null,
|
|
@@ -808,7 +814,7 @@ function deserializePrivateInExpression(pos) {
|
|
|
808
814
|
end: deserializeU32(pos + 4),
|
|
809
815
|
};
|
|
810
816
|
node.left = deserializePrivateIdentifier(pos + 8);
|
|
811
|
-
node.operator =
|
|
817
|
+
node.operator = "in";
|
|
812
818
|
node.right = deserializeExpression(pos + 32);
|
|
813
819
|
return node;
|
|
814
820
|
}
|
|
@@ -817,7 +823,7 @@ function deserializeLogicalExpression(pos) {
|
|
|
817
823
|
let start = deserializeU32(pos),
|
|
818
824
|
end = deserializeU32(pos + 4),
|
|
819
825
|
node = {
|
|
820
|
-
type:
|
|
826
|
+
type: "LogicalExpression",
|
|
821
827
|
left: null,
|
|
822
828
|
operator: deserializeLogicalOperator(pos + 40),
|
|
823
829
|
right: null,
|
|
@@ -831,7 +837,7 @@ function deserializeLogicalExpression(pos) {
|
|
|
831
837
|
|
|
832
838
|
function deserializeConditionalExpression(pos) {
|
|
833
839
|
let node = {
|
|
834
|
-
type:
|
|
840
|
+
type: "ConditionalExpression",
|
|
835
841
|
test: null,
|
|
836
842
|
consequent: null,
|
|
837
843
|
alternate: null,
|
|
@@ -848,7 +854,7 @@ function deserializeAssignmentExpression(pos) {
|
|
|
848
854
|
let start = deserializeU32(pos),
|
|
849
855
|
end = deserializeU32(pos + 4),
|
|
850
856
|
node = {
|
|
851
|
-
type:
|
|
857
|
+
type: "AssignmentExpression",
|
|
852
858
|
operator: deserializeAssignmentOperator(pos + 40),
|
|
853
859
|
left: null,
|
|
854
860
|
right: null,
|
|
@@ -912,7 +918,7 @@ function deserializeSimpleAssignmentTarget(pos) {
|
|
|
912
918
|
|
|
913
919
|
function deserializeArrayAssignmentTarget(pos) {
|
|
914
920
|
let node = {
|
|
915
|
-
type:
|
|
921
|
+
type: "ArrayPattern",
|
|
916
922
|
decorators: null,
|
|
917
923
|
elements: null,
|
|
918
924
|
optional: null,
|
|
@@ -931,7 +937,7 @@ function deserializeArrayAssignmentTarget(pos) {
|
|
|
931
937
|
|
|
932
938
|
function deserializeObjectAssignmentTarget(pos) {
|
|
933
939
|
let node = {
|
|
934
|
-
type:
|
|
940
|
+
type: "ObjectPattern",
|
|
935
941
|
decorators: null,
|
|
936
942
|
properties: null,
|
|
937
943
|
optional: null,
|
|
@@ -950,7 +956,7 @@ function deserializeObjectAssignmentTarget(pos) {
|
|
|
950
956
|
|
|
951
957
|
function deserializeAssignmentTargetRest(pos) {
|
|
952
958
|
let node = {
|
|
953
|
-
type:
|
|
959
|
+
type: "RestElement",
|
|
954
960
|
decorators: null,
|
|
955
961
|
argument: null,
|
|
956
962
|
optional: null,
|
|
@@ -996,7 +1002,7 @@ function deserializeAssignmentTargetMaybeDefault(pos) {
|
|
|
996
1002
|
|
|
997
1003
|
function deserializeAssignmentTargetWithDefault(pos) {
|
|
998
1004
|
let node = {
|
|
999
|
-
type:
|
|
1005
|
+
type: "AssignmentPattern",
|
|
1000
1006
|
decorators: null,
|
|
1001
1007
|
left: null,
|
|
1002
1008
|
right: null,
|
|
@@ -1027,7 +1033,7 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
1027
1033
|
let start = deserializeU32(pos),
|
|
1028
1034
|
end = deserializeU32(pos + 4),
|
|
1029
1035
|
node = {
|
|
1030
|
-
type:
|
|
1036
|
+
type: "Property",
|
|
1031
1037
|
kind: null,
|
|
1032
1038
|
key: null,
|
|
1033
1039
|
value: null,
|
|
@@ -1040,7 +1046,7 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
1040
1046
|
},
|
|
1041
1047
|
key = deserializeIdentifierReference(pos + 8),
|
|
1042
1048
|
value = {
|
|
1043
|
-
type:
|
|
1049
|
+
type: "Identifier",
|
|
1044
1050
|
decorators: [],
|
|
1045
1051
|
name: key.name,
|
|
1046
1052
|
optional: false,
|
|
@@ -1051,7 +1057,7 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
1051
1057
|
init = deserializeOptionExpression(pos + 40);
|
|
1052
1058
|
init !== null &&
|
|
1053
1059
|
(value = {
|
|
1054
|
-
type:
|
|
1060
|
+
type: "AssignmentPattern",
|
|
1055
1061
|
decorators: [],
|
|
1056
1062
|
left: value,
|
|
1057
1063
|
right: init,
|
|
@@ -1060,7 +1066,7 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
1060
1066
|
start,
|
|
1061
1067
|
end,
|
|
1062
1068
|
});
|
|
1063
|
-
node.kind =
|
|
1069
|
+
node.kind = "init";
|
|
1064
1070
|
node.key = key;
|
|
1065
1071
|
node.value = value;
|
|
1066
1072
|
node.method = false;
|
|
@@ -1074,7 +1080,7 @@ function deserializeAssignmentTargetPropertyProperty(pos) {
|
|
|
1074
1080
|
let start = deserializeU32(pos),
|
|
1075
1081
|
end = deserializeU32(pos + 4),
|
|
1076
1082
|
node = {
|
|
1077
|
-
type:
|
|
1083
|
+
type: "Property",
|
|
1078
1084
|
kind: null,
|
|
1079
1085
|
key: null,
|
|
1080
1086
|
value: null,
|
|
@@ -1085,7 +1091,7 @@ function deserializeAssignmentTargetPropertyProperty(pos) {
|
|
|
1085
1091
|
start,
|
|
1086
1092
|
end,
|
|
1087
1093
|
};
|
|
1088
|
-
node.kind =
|
|
1094
|
+
node.kind = "init";
|
|
1089
1095
|
node.key = deserializePropertyKey(pos + 8);
|
|
1090
1096
|
node.value = deserializeAssignmentTargetMaybeDefault(pos + 24);
|
|
1091
1097
|
node.method = false;
|
|
@@ -1096,7 +1102,7 @@ function deserializeAssignmentTargetPropertyProperty(pos) {
|
|
|
1096
1102
|
|
|
1097
1103
|
function deserializeSequenceExpression(pos) {
|
|
1098
1104
|
let node = {
|
|
1099
|
-
type:
|
|
1105
|
+
type: "SequenceExpression",
|
|
1100
1106
|
expressions: null,
|
|
1101
1107
|
start: deserializeU32(pos),
|
|
1102
1108
|
end: deserializeU32(pos + 4),
|
|
@@ -1107,7 +1113,7 @@ function deserializeSequenceExpression(pos) {
|
|
|
1107
1113
|
|
|
1108
1114
|
function deserializeSuper(pos) {
|
|
1109
1115
|
return {
|
|
1110
|
-
type:
|
|
1116
|
+
type: "Super",
|
|
1111
1117
|
start: deserializeU32(pos),
|
|
1112
1118
|
end: deserializeU32(pos + 4),
|
|
1113
1119
|
};
|
|
@@ -1115,7 +1121,7 @@ function deserializeSuper(pos) {
|
|
|
1115
1121
|
|
|
1116
1122
|
function deserializeAwaitExpression(pos) {
|
|
1117
1123
|
let node = {
|
|
1118
|
-
type:
|
|
1124
|
+
type: "AwaitExpression",
|
|
1119
1125
|
argument: null,
|
|
1120
1126
|
start: deserializeU32(pos),
|
|
1121
1127
|
end: deserializeU32(pos + 4),
|
|
@@ -1126,7 +1132,7 @@ function deserializeAwaitExpression(pos) {
|
|
|
1126
1132
|
|
|
1127
1133
|
function deserializeChainExpression(pos) {
|
|
1128
1134
|
let node = {
|
|
1129
|
-
type:
|
|
1135
|
+
type: "ChainExpression",
|
|
1130
1136
|
expression: null,
|
|
1131
1137
|
start: deserializeU32(pos),
|
|
1132
1138
|
end: deserializeU32(pos + 4),
|
|
@@ -1155,7 +1161,7 @@ function deserializeChainElement(pos) {
|
|
|
1155
1161
|
function deserializeParenthesizedExpression(pos) {
|
|
1156
1162
|
let node;
|
|
1157
1163
|
node = {
|
|
1158
|
-
type:
|
|
1164
|
+
type: "ParenthesizedExpression",
|
|
1159
1165
|
expression: null,
|
|
1160
1166
|
start: deserializeU32(pos),
|
|
1161
1167
|
end: deserializeU32(pos + 4),
|
|
@@ -1241,7 +1247,7 @@ function deserializeDirective(pos) {
|
|
|
1241
1247
|
let start = deserializeU32(pos),
|
|
1242
1248
|
end = deserializeU32(pos + 4),
|
|
1243
1249
|
node = {
|
|
1244
|
-
type:
|
|
1250
|
+
type: "ExpressionStatement",
|
|
1245
1251
|
expression: null,
|
|
1246
1252
|
directive: deserializeStr(pos + 56),
|
|
1247
1253
|
start,
|
|
@@ -1255,7 +1261,7 @@ function deserializeHashbang(pos) {
|
|
|
1255
1261
|
let start = deserializeU32(pos),
|
|
1256
1262
|
end = deserializeU32(pos + 4);
|
|
1257
1263
|
return {
|
|
1258
|
-
type:
|
|
1264
|
+
type: "Hashbang",
|
|
1259
1265
|
value: deserializeStr(pos + 8),
|
|
1260
1266
|
start,
|
|
1261
1267
|
end,
|
|
@@ -1264,7 +1270,7 @@ function deserializeHashbang(pos) {
|
|
|
1264
1270
|
|
|
1265
1271
|
function deserializeBlockStatement(pos) {
|
|
1266
1272
|
let node = {
|
|
1267
|
-
type:
|
|
1273
|
+
type: "BlockStatement",
|
|
1268
1274
|
body: null,
|
|
1269
1275
|
start: deserializeU32(pos),
|
|
1270
1276
|
end: deserializeU32(pos + 4),
|
|
@@ -1302,7 +1308,7 @@ function deserializeVariableDeclaration(pos) {
|
|
|
1302
1308
|
let start = deserializeU32(pos),
|
|
1303
1309
|
end = deserializeU32(pos + 4),
|
|
1304
1310
|
node = {
|
|
1305
|
-
type:
|
|
1311
|
+
type: "VariableDeclaration",
|
|
1306
1312
|
kind: deserializeVariableDeclarationKind(pos + 32),
|
|
1307
1313
|
declarations: null,
|
|
1308
1314
|
declare: deserializeBool(pos + 33),
|
|
@@ -1316,15 +1322,15 @@ function deserializeVariableDeclaration(pos) {
|
|
|
1316
1322
|
function deserializeVariableDeclarationKind(pos) {
|
|
1317
1323
|
switch (uint8[pos]) {
|
|
1318
1324
|
case 0:
|
|
1319
|
-
return
|
|
1325
|
+
return "var";
|
|
1320
1326
|
case 1:
|
|
1321
|
-
return
|
|
1327
|
+
return "let";
|
|
1322
1328
|
case 2:
|
|
1323
|
-
return
|
|
1329
|
+
return "const";
|
|
1324
1330
|
case 3:
|
|
1325
|
-
return
|
|
1331
|
+
return "using";
|
|
1326
1332
|
case 4:
|
|
1327
|
-
return
|
|
1333
|
+
return "await using";
|
|
1328
1334
|
default:
|
|
1329
1335
|
throw Error(`Unexpected discriminant ${uint8[pos]} for VariableDeclarationKind`);
|
|
1330
1336
|
}
|
|
@@ -1334,7 +1340,7 @@ function deserializeVariableDeclarator(pos) {
|
|
|
1334
1340
|
let start = deserializeU32(pos),
|
|
1335
1341
|
end = deserializeU32(pos + 4),
|
|
1336
1342
|
node = {
|
|
1337
|
-
type:
|
|
1343
|
+
type: "VariableDeclarator",
|
|
1338
1344
|
id: null,
|
|
1339
1345
|
init: null,
|
|
1340
1346
|
definite: deserializeBool(pos + 57),
|
|
@@ -1348,7 +1354,7 @@ function deserializeVariableDeclarator(pos) {
|
|
|
1348
1354
|
|
|
1349
1355
|
function deserializeEmptyStatement(pos) {
|
|
1350
1356
|
return {
|
|
1351
|
-
type:
|
|
1357
|
+
type: "EmptyStatement",
|
|
1352
1358
|
start: deserializeU32(pos),
|
|
1353
1359
|
end: deserializeU32(pos + 4),
|
|
1354
1360
|
};
|
|
@@ -1356,7 +1362,7 @@ function deserializeEmptyStatement(pos) {
|
|
|
1356
1362
|
|
|
1357
1363
|
function deserializeExpressionStatement(pos) {
|
|
1358
1364
|
let node = {
|
|
1359
|
-
type:
|
|
1365
|
+
type: "ExpressionStatement",
|
|
1360
1366
|
expression: null,
|
|
1361
1367
|
directive: null,
|
|
1362
1368
|
start: deserializeU32(pos),
|
|
@@ -1368,7 +1374,7 @@ function deserializeExpressionStatement(pos) {
|
|
|
1368
1374
|
|
|
1369
1375
|
function deserializeIfStatement(pos) {
|
|
1370
1376
|
let node = {
|
|
1371
|
-
type:
|
|
1377
|
+
type: "IfStatement",
|
|
1372
1378
|
test: null,
|
|
1373
1379
|
consequent: null,
|
|
1374
1380
|
alternate: null,
|
|
@@ -1383,7 +1389,7 @@ function deserializeIfStatement(pos) {
|
|
|
1383
1389
|
|
|
1384
1390
|
function deserializeDoWhileStatement(pos) {
|
|
1385
1391
|
let node = {
|
|
1386
|
-
type:
|
|
1392
|
+
type: "DoWhileStatement",
|
|
1387
1393
|
body: null,
|
|
1388
1394
|
test: null,
|
|
1389
1395
|
start: deserializeU32(pos),
|
|
@@ -1396,7 +1402,7 @@ function deserializeDoWhileStatement(pos) {
|
|
|
1396
1402
|
|
|
1397
1403
|
function deserializeWhileStatement(pos) {
|
|
1398
1404
|
let node = {
|
|
1399
|
-
type:
|
|
1405
|
+
type: "WhileStatement",
|
|
1400
1406
|
test: null,
|
|
1401
1407
|
body: null,
|
|
1402
1408
|
start: deserializeU32(pos),
|
|
@@ -1409,7 +1415,7 @@ function deserializeWhileStatement(pos) {
|
|
|
1409
1415
|
|
|
1410
1416
|
function deserializeForStatement(pos) {
|
|
1411
1417
|
let node = {
|
|
1412
|
-
type:
|
|
1418
|
+
type: "ForStatement",
|
|
1413
1419
|
init: null,
|
|
1414
1420
|
test: null,
|
|
1415
1421
|
update: null,
|
|
@@ -1521,7 +1527,7 @@ function deserializeForStatementInit(pos) {
|
|
|
1521
1527
|
|
|
1522
1528
|
function deserializeForInStatement(pos) {
|
|
1523
1529
|
let node = {
|
|
1524
|
-
type:
|
|
1530
|
+
type: "ForInStatement",
|
|
1525
1531
|
left: null,
|
|
1526
1532
|
right: null,
|
|
1527
1533
|
body: null,
|
|
@@ -1567,7 +1573,7 @@ function deserializeForOfStatement(pos) {
|
|
|
1567
1573
|
let start = deserializeU32(pos),
|
|
1568
1574
|
end = deserializeU32(pos + 4),
|
|
1569
1575
|
node = {
|
|
1570
|
-
type:
|
|
1576
|
+
type: "ForOfStatement",
|
|
1571
1577
|
await: deserializeBool(pos + 60),
|
|
1572
1578
|
left: null,
|
|
1573
1579
|
right: null,
|
|
@@ -1583,7 +1589,7 @@ function deserializeForOfStatement(pos) {
|
|
|
1583
1589
|
|
|
1584
1590
|
function deserializeContinueStatement(pos) {
|
|
1585
1591
|
let node = {
|
|
1586
|
-
type:
|
|
1592
|
+
type: "ContinueStatement",
|
|
1587
1593
|
label: null,
|
|
1588
1594
|
start: deserializeU32(pos),
|
|
1589
1595
|
end: deserializeU32(pos + 4),
|
|
@@ -1594,7 +1600,7 @@ function deserializeContinueStatement(pos) {
|
|
|
1594
1600
|
|
|
1595
1601
|
function deserializeBreakStatement(pos) {
|
|
1596
1602
|
let node = {
|
|
1597
|
-
type:
|
|
1603
|
+
type: "BreakStatement",
|
|
1598
1604
|
label: null,
|
|
1599
1605
|
start: deserializeU32(pos),
|
|
1600
1606
|
end: deserializeU32(pos + 4),
|
|
@@ -1605,7 +1611,7 @@ function deserializeBreakStatement(pos) {
|
|
|
1605
1611
|
|
|
1606
1612
|
function deserializeReturnStatement(pos) {
|
|
1607
1613
|
let node = {
|
|
1608
|
-
type:
|
|
1614
|
+
type: "ReturnStatement",
|
|
1609
1615
|
argument: null,
|
|
1610
1616
|
start: deserializeU32(pos),
|
|
1611
1617
|
end: deserializeU32(pos + 4),
|
|
@@ -1616,7 +1622,7 @@ function deserializeReturnStatement(pos) {
|
|
|
1616
1622
|
|
|
1617
1623
|
function deserializeWithStatement(pos) {
|
|
1618
1624
|
let node = {
|
|
1619
|
-
type:
|
|
1625
|
+
type: "WithStatement",
|
|
1620
1626
|
object: null,
|
|
1621
1627
|
body: null,
|
|
1622
1628
|
start: deserializeU32(pos),
|
|
@@ -1629,7 +1635,7 @@ function deserializeWithStatement(pos) {
|
|
|
1629
1635
|
|
|
1630
1636
|
function deserializeSwitchStatement(pos) {
|
|
1631
1637
|
let node = {
|
|
1632
|
-
type:
|
|
1638
|
+
type: "SwitchStatement",
|
|
1633
1639
|
discriminant: null,
|
|
1634
1640
|
cases: null,
|
|
1635
1641
|
start: deserializeU32(pos),
|
|
@@ -1642,7 +1648,7 @@ function deserializeSwitchStatement(pos) {
|
|
|
1642
1648
|
|
|
1643
1649
|
function deserializeSwitchCase(pos) {
|
|
1644
1650
|
let node = {
|
|
1645
|
-
type:
|
|
1651
|
+
type: "SwitchCase",
|
|
1646
1652
|
test: null,
|
|
1647
1653
|
consequent: null,
|
|
1648
1654
|
start: deserializeU32(pos),
|
|
@@ -1655,7 +1661,7 @@ function deserializeSwitchCase(pos) {
|
|
|
1655
1661
|
|
|
1656
1662
|
function deserializeLabeledStatement(pos) {
|
|
1657
1663
|
let node = {
|
|
1658
|
-
type:
|
|
1664
|
+
type: "LabeledStatement",
|
|
1659
1665
|
label: null,
|
|
1660
1666
|
body: null,
|
|
1661
1667
|
start: deserializeU32(pos),
|
|
@@ -1668,7 +1674,7 @@ function deserializeLabeledStatement(pos) {
|
|
|
1668
1674
|
|
|
1669
1675
|
function deserializeThrowStatement(pos) {
|
|
1670
1676
|
let node = {
|
|
1671
|
-
type:
|
|
1677
|
+
type: "ThrowStatement",
|
|
1672
1678
|
argument: null,
|
|
1673
1679
|
start: deserializeU32(pos),
|
|
1674
1680
|
end: deserializeU32(pos + 4),
|
|
@@ -1679,7 +1685,7 @@ function deserializeThrowStatement(pos) {
|
|
|
1679
1685
|
|
|
1680
1686
|
function deserializeTryStatement(pos) {
|
|
1681
1687
|
let node = {
|
|
1682
|
-
type:
|
|
1688
|
+
type: "TryStatement",
|
|
1683
1689
|
block: null,
|
|
1684
1690
|
handler: null,
|
|
1685
1691
|
finalizer: null,
|
|
@@ -1694,7 +1700,7 @@ function deserializeTryStatement(pos) {
|
|
|
1694
1700
|
|
|
1695
1701
|
function deserializeCatchClause(pos) {
|
|
1696
1702
|
let node = {
|
|
1697
|
-
type:
|
|
1703
|
+
type: "CatchClause",
|
|
1698
1704
|
param: null,
|
|
1699
1705
|
body: null,
|
|
1700
1706
|
start: deserializeU32(pos),
|
|
@@ -1711,7 +1717,7 @@ function deserializeCatchParameter(pos) {
|
|
|
1711
1717
|
|
|
1712
1718
|
function deserializeDebuggerStatement(pos) {
|
|
1713
1719
|
return {
|
|
1714
|
-
type:
|
|
1720
|
+
type: "DebuggerStatement",
|
|
1715
1721
|
start: deserializeU32(pos),
|
|
1716
1722
|
end: deserializeU32(pos + 4),
|
|
1717
1723
|
};
|
|
@@ -1741,7 +1747,7 @@ function deserializeBindingPatternKind(pos) {
|
|
|
1741
1747
|
|
|
1742
1748
|
function deserializeAssignmentPattern(pos) {
|
|
1743
1749
|
let node = {
|
|
1744
|
-
type:
|
|
1750
|
+
type: "AssignmentPattern",
|
|
1745
1751
|
decorators: null,
|
|
1746
1752
|
left: null,
|
|
1747
1753
|
right: null,
|
|
@@ -1759,7 +1765,7 @@ function deserializeAssignmentPattern(pos) {
|
|
|
1759
1765
|
|
|
1760
1766
|
function deserializeObjectPattern(pos) {
|
|
1761
1767
|
let node = {
|
|
1762
|
-
type:
|
|
1768
|
+
type: "ObjectPattern",
|
|
1763
1769
|
decorators: null,
|
|
1764
1770
|
properties: null,
|
|
1765
1771
|
optional: null,
|
|
@@ -1780,7 +1786,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1780
1786
|
let start = deserializeU32(pos),
|
|
1781
1787
|
end = deserializeU32(pos + 4),
|
|
1782
1788
|
node = {
|
|
1783
|
-
type:
|
|
1789
|
+
type: "Property",
|
|
1784
1790
|
kind: null,
|
|
1785
1791
|
key: null,
|
|
1786
1792
|
value: null,
|
|
@@ -1791,7 +1797,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1791
1797
|
start,
|
|
1792
1798
|
end,
|
|
1793
1799
|
};
|
|
1794
|
-
node.kind =
|
|
1800
|
+
node.kind = "init";
|
|
1795
1801
|
node.key = deserializePropertyKey(pos + 8);
|
|
1796
1802
|
node.value = deserializeBindingPattern(pos + 24);
|
|
1797
1803
|
node.method = false;
|
|
@@ -1801,7 +1807,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1801
1807
|
|
|
1802
1808
|
function deserializeArrayPattern(pos) {
|
|
1803
1809
|
let node = {
|
|
1804
|
-
type:
|
|
1810
|
+
type: "ArrayPattern",
|
|
1805
1811
|
decorators: null,
|
|
1806
1812
|
elements: null,
|
|
1807
1813
|
optional: null,
|
|
@@ -1820,7 +1826,7 @@ function deserializeArrayPattern(pos) {
|
|
|
1820
1826
|
|
|
1821
1827
|
function deserializeBindingRestElement(pos) {
|
|
1822
1828
|
let node = {
|
|
1823
|
-
type:
|
|
1829
|
+
type: "RestElement",
|
|
1824
1830
|
decorators: null,
|
|
1825
1831
|
argument: null,
|
|
1826
1832
|
optional: null,
|
|
@@ -1869,13 +1875,13 @@ function deserializeFunction(pos) {
|
|
|
1869
1875
|
function deserializeFunctionType(pos) {
|
|
1870
1876
|
switch (uint8[pos]) {
|
|
1871
1877
|
case 0:
|
|
1872
|
-
return
|
|
1878
|
+
return "FunctionDeclaration";
|
|
1873
1879
|
case 1:
|
|
1874
|
-
return
|
|
1880
|
+
return "FunctionExpression";
|
|
1875
1881
|
case 2:
|
|
1876
|
-
return
|
|
1882
|
+
return "TSDeclareFunction";
|
|
1877
1883
|
case 3:
|
|
1878
|
-
return
|
|
1884
|
+
return "TSEmptyBodyFunctionExpression";
|
|
1879
1885
|
default:
|
|
1880
1886
|
throw Error(`Unexpected discriminant ${uint8[pos]} for FunctionType`);
|
|
1881
1887
|
}
|
|
@@ -1886,7 +1892,7 @@ function deserializeFormalParameters(pos) {
|
|
|
1886
1892
|
if (uint32[(pos + 32) >> 2] !== 0 && uint32[(pos + 36) >> 2] !== 0) {
|
|
1887
1893
|
pos = uint32[(pos + 32) >> 2];
|
|
1888
1894
|
let rest = {
|
|
1889
|
-
type:
|
|
1895
|
+
type: "RestElement",
|
|
1890
1896
|
decorators: [],
|
|
1891
1897
|
argument: null,
|
|
1892
1898
|
optional: deserializeBool(pos + 32),
|
|
@@ -1915,7 +1921,7 @@ function deserializeFormalParameter(pos) {
|
|
|
1915
1921
|
param.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 48);
|
|
1916
1922
|
} else {
|
|
1917
1923
|
param = {
|
|
1918
|
-
type:
|
|
1924
|
+
type: "TSParameterProperty",
|
|
1919
1925
|
accessibility,
|
|
1920
1926
|
decorators: null,
|
|
1921
1927
|
override,
|
|
@@ -1934,7 +1940,7 @@ function deserializeFormalParameter(pos) {
|
|
|
1934
1940
|
|
|
1935
1941
|
function deserializeFunctionBody(pos) {
|
|
1936
1942
|
let node = {
|
|
1937
|
-
type:
|
|
1943
|
+
type: "BlockStatement",
|
|
1938
1944
|
body: null,
|
|
1939
1945
|
start: deserializeU32(pos),
|
|
1940
1946
|
end: deserializeU32(pos + 4),
|
|
@@ -1950,7 +1956,7 @@ function deserializeArrowFunctionExpression(pos) {
|
|
|
1950
1956
|
start = deserializeU32(pos),
|
|
1951
1957
|
end = deserializeU32(pos + 4),
|
|
1952
1958
|
node = {
|
|
1953
|
-
type:
|
|
1959
|
+
type: "ArrowFunctionExpression",
|
|
1954
1960
|
expression,
|
|
1955
1961
|
async: deserializeBool(pos + 45),
|
|
1956
1962
|
typeParameters: null,
|
|
@@ -1976,7 +1982,7 @@ function deserializeYieldExpression(pos) {
|
|
|
1976
1982
|
let start = deserializeU32(pos),
|
|
1977
1983
|
end = deserializeU32(pos + 4),
|
|
1978
1984
|
node = {
|
|
1979
|
-
type:
|
|
1985
|
+
type: "YieldExpression",
|
|
1980
1986
|
delegate: deserializeBool(pos + 24),
|
|
1981
1987
|
argument: null,
|
|
1982
1988
|
start,
|
|
@@ -2016,9 +2022,9 @@ function deserializeClass(pos) {
|
|
|
2016
2022
|
function deserializeClassType(pos) {
|
|
2017
2023
|
switch (uint8[pos]) {
|
|
2018
2024
|
case 0:
|
|
2019
|
-
return
|
|
2025
|
+
return "ClassDeclaration";
|
|
2020
2026
|
case 1:
|
|
2021
|
-
return
|
|
2027
|
+
return "ClassExpression";
|
|
2022
2028
|
default:
|
|
2023
2029
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ClassType`);
|
|
2024
2030
|
}
|
|
@@ -2026,7 +2032,7 @@ function deserializeClassType(pos) {
|
|
|
2026
2032
|
|
|
2027
2033
|
function deserializeClassBody(pos) {
|
|
2028
2034
|
let node = {
|
|
2029
|
-
type:
|
|
2035
|
+
type: "ClassBody",
|
|
2030
2036
|
body: null,
|
|
2031
2037
|
start: deserializeU32(pos),
|
|
2032
2038
|
end: deserializeU32(pos + 4),
|
|
@@ -2078,9 +2084,9 @@ function deserializeMethodDefinition(pos) {
|
|
|
2078
2084
|
function deserializeMethodDefinitionType(pos) {
|
|
2079
2085
|
switch (uint8[pos]) {
|
|
2080
2086
|
case 0:
|
|
2081
|
-
return
|
|
2087
|
+
return "MethodDefinition";
|
|
2082
2088
|
case 1:
|
|
2083
|
-
return
|
|
2089
|
+
return "TSAbstractMethodDefinition";
|
|
2084
2090
|
default:
|
|
2085
2091
|
throw Error(`Unexpected discriminant ${uint8[pos]} for MethodDefinitionType`);
|
|
2086
2092
|
}
|
|
@@ -2116,9 +2122,9 @@ function deserializePropertyDefinition(pos) {
|
|
|
2116
2122
|
function deserializePropertyDefinitionType(pos) {
|
|
2117
2123
|
switch (uint8[pos]) {
|
|
2118
2124
|
case 0:
|
|
2119
|
-
return
|
|
2125
|
+
return "PropertyDefinition";
|
|
2120
2126
|
case 1:
|
|
2121
|
-
return
|
|
2127
|
+
return "TSAbstractPropertyDefinition";
|
|
2122
2128
|
default:
|
|
2123
2129
|
throw Error(`Unexpected discriminant ${uint8[pos]} for PropertyDefinitionType`);
|
|
2124
2130
|
}
|
|
@@ -2127,13 +2133,13 @@ function deserializePropertyDefinitionType(pos) {
|
|
|
2127
2133
|
function deserializeMethodDefinitionKind(pos) {
|
|
2128
2134
|
switch (uint8[pos]) {
|
|
2129
2135
|
case 0:
|
|
2130
|
-
return
|
|
2136
|
+
return "constructor";
|
|
2131
2137
|
case 1:
|
|
2132
|
-
return
|
|
2138
|
+
return "method";
|
|
2133
2139
|
case 2:
|
|
2134
|
-
return
|
|
2140
|
+
return "get";
|
|
2135
2141
|
case 3:
|
|
2136
|
-
return
|
|
2142
|
+
return "set";
|
|
2137
2143
|
default:
|
|
2138
2144
|
throw Error(`Unexpected discriminant ${uint8[pos]} for MethodDefinitionKind`);
|
|
2139
2145
|
}
|
|
@@ -2143,7 +2149,7 @@ function deserializePrivateIdentifier(pos) {
|
|
|
2143
2149
|
let start = deserializeU32(pos),
|
|
2144
2150
|
end = deserializeU32(pos + 4);
|
|
2145
2151
|
return {
|
|
2146
|
-
type:
|
|
2152
|
+
type: "PrivateIdentifier",
|
|
2147
2153
|
name: deserializeStr(pos + 8),
|
|
2148
2154
|
start,
|
|
2149
2155
|
end,
|
|
@@ -2152,7 +2158,7 @@ function deserializePrivateIdentifier(pos) {
|
|
|
2152
2158
|
|
|
2153
2159
|
function deserializeStaticBlock(pos) {
|
|
2154
2160
|
let node = {
|
|
2155
|
-
type:
|
|
2161
|
+
type: "StaticBlock",
|
|
2156
2162
|
body: null,
|
|
2157
2163
|
start: deserializeU32(pos),
|
|
2158
2164
|
end: deserializeU32(pos + 4),
|
|
@@ -2164,9 +2170,9 @@ function deserializeStaticBlock(pos) {
|
|
|
2164
2170
|
function deserializeAccessorPropertyType(pos) {
|
|
2165
2171
|
switch (uint8[pos]) {
|
|
2166
2172
|
case 0:
|
|
2167
|
-
return
|
|
2173
|
+
return "AccessorProperty";
|
|
2168
2174
|
case 1:
|
|
2169
|
-
return
|
|
2175
|
+
return "TSAbstractAccessorProperty";
|
|
2170
2176
|
default:
|
|
2171
2177
|
throw Error(`Unexpected discriminant ${uint8[pos]} for AccessorPropertyType`);
|
|
2172
2178
|
}
|
|
@@ -2206,7 +2212,7 @@ function deserializeImportExpression(pos) {
|
|
|
2206
2212
|
let start = deserializeU32(pos),
|
|
2207
2213
|
end = deserializeU32(pos + 4),
|
|
2208
2214
|
node = {
|
|
2209
|
-
type:
|
|
2215
|
+
type: "ImportExpression",
|
|
2210
2216
|
source: null,
|
|
2211
2217
|
options: null,
|
|
2212
2218
|
phase: deserializeOptionImportPhase(pos + 40),
|
|
@@ -2222,7 +2228,7 @@ function deserializeImportDeclaration(pos) {
|
|
|
2222
2228
|
let start = deserializeU32(pos),
|
|
2223
2229
|
end = deserializeU32(pos + 4),
|
|
2224
2230
|
node = {
|
|
2225
|
-
type:
|
|
2231
|
+
type: "ImportDeclaration",
|
|
2226
2232
|
specifiers: null,
|
|
2227
2233
|
source: null,
|
|
2228
2234
|
phase: deserializeOptionImportPhase(pos + 88),
|
|
@@ -2243,9 +2249,9 @@ function deserializeImportDeclaration(pos) {
|
|
|
2243
2249
|
function deserializeImportPhase(pos) {
|
|
2244
2250
|
switch (uint8[pos]) {
|
|
2245
2251
|
case 0:
|
|
2246
|
-
return
|
|
2252
|
+
return "source";
|
|
2247
2253
|
case 1:
|
|
2248
|
-
return
|
|
2254
|
+
return "defer";
|
|
2249
2255
|
default:
|
|
2250
2256
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ImportPhase`);
|
|
2251
2257
|
}
|
|
@@ -2268,7 +2274,7 @@ function deserializeImportSpecifier(pos) {
|
|
|
2268
2274
|
let start = deserializeU32(pos),
|
|
2269
2275
|
end = deserializeU32(pos + 4),
|
|
2270
2276
|
node = {
|
|
2271
|
-
type:
|
|
2277
|
+
type: "ImportSpecifier",
|
|
2272
2278
|
imported: null,
|
|
2273
2279
|
local: null,
|
|
2274
2280
|
importKind: deserializeImportOrExportKind(pos + 96),
|
|
@@ -2282,7 +2288,7 @@ function deserializeImportSpecifier(pos) {
|
|
|
2282
2288
|
|
|
2283
2289
|
function deserializeImportDefaultSpecifier(pos) {
|
|
2284
2290
|
let node = {
|
|
2285
|
-
type:
|
|
2291
|
+
type: "ImportDefaultSpecifier",
|
|
2286
2292
|
local: null,
|
|
2287
2293
|
start: deserializeU32(pos),
|
|
2288
2294
|
end: deserializeU32(pos + 4),
|
|
@@ -2293,7 +2299,7 @@ function deserializeImportDefaultSpecifier(pos) {
|
|
|
2293
2299
|
|
|
2294
2300
|
function deserializeImportNamespaceSpecifier(pos) {
|
|
2295
2301
|
let node = {
|
|
2296
|
-
type:
|
|
2302
|
+
type: "ImportNamespaceSpecifier",
|
|
2297
2303
|
local: null,
|
|
2298
2304
|
start: deserializeU32(pos),
|
|
2299
2305
|
end: deserializeU32(pos + 4),
|
|
@@ -2308,7 +2314,7 @@ function deserializeWithClause(pos) {
|
|
|
2308
2314
|
|
|
2309
2315
|
function deserializeImportAttribute(pos) {
|
|
2310
2316
|
let node = {
|
|
2311
|
-
type:
|
|
2317
|
+
type: "ImportAttribute",
|
|
2312
2318
|
key: null,
|
|
2313
2319
|
value: null,
|
|
2314
2320
|
start: deserializeU32(pos),
|
|
@@ -2334,7 +2340,7 @@ function deserializeExportNamedDeclaration(pos) {
|
|
|
2334
2340
|
let start = deserializeU32(pos),
|
|
2335
2341
|
end = deserializeU32(pos + 4),
|
|
2336
2342
|
node = {
|
|
2337
|
-
type:
|
|
2343
|
+
type: "ExportNamedDeclaration",
|
|
2338
2344
|
declaration: null,
|
|
2339
2345
|
specifiers: null,
|
|
2340
2346
|
source: null,
|
|
@@ -2353,14 +2359,14 @@ function deserializeExportNamedDeclaration(pos) {
|
|
|
2353
2359
|
|
|
2354
2360
|
function deserializeExportDefaultDeclaration(pos) {
|
|
2355
2361
|
let node = {
|
|
2356
|
-
type:
|
|
2362
|
+
type: "ExportDefaultDeclaration",
|
|
2357
2363
|
declaration: null,
|
|
2358
2364
|
exportKind: null,
|
|
2359
2365
|
start: deserializeU32(pos),
|
|
2360
2366
|
end: deserializeU32(pos + 4),
|
|
2361
2367
|
};
|
|
2362
2368
|
node.declaration = deserializeExportDefaultDeclarationKind(pos + 8);
|
|
2363
|
-
node.exportKind =
|
|
2369
|
+
node.exportKind = "value";
|
|
2364
2370
|
return node;
|
|
2365
2371
|
}
|
|
2366
2372
|
|
|
@@ -2368,7 +2374,7 @@ function deserializeExportAllDeclaration(pos) {
|
|
|
2368
2374
|
let start = deserializeU32(pos),
|
|
2369
2375
|
end = deserializeU32(pos + 4),
|
|
2370
2376
|
node = {
|
|
2371
|
-
type:
|
|
2377
|
+
type: "ExportAllDeclaration",
|
|
2372
2378
|
exported: null,
|
|
2373
2379
|
source: null,
|
|
2374
2380
|
attributes: null,
|
|
@@ -2387,7 +2393,7 @@ function deserializeExportSpecifier(pos) {
|
|
|
2387
2393
|
let start = deserializeU32(pos),
|
|
2388
2394
|
end = deserializeU32(pos + 4),
|
|
2389
2395
|
node = {
|
|
2390
|
-
type:
|
|
2396
|
+
type: "ExportSpecifier",
|
|
2391
2397
|
local: null,
|
|
2392
2398
|
exported: null,
|
|
2393
2399
|
exportKind: deserializeImportOrExportKind(pos + 120),
|
|
@@ -2513,7 +2519,7 @@ function deserializeModuleExportName(pos) {
|
|
|
2513
2519
|
|
|
2514
2520
|
function deserializeV8IntrinsicExpression(pos) {
|
|
2515
2521
|
let node = {
|
|
2516
|
-
type:
|
|
2522
|
+
type: "V8IntrinsicExpression",
|
|
2517
2523
|
name: null,
|
|
2518
2524
|
arguments: null,
|
|
2519
2525
|
start: deserializeU32(pos),
|
|
@@ -2529,13 +2535,13 @@ function deserializeBooleanLiteral(pos) {
|
|
|
2529
2535
|
start = deserializeU32(pos),
|
|
2530
2536
|
end = deserializeU32(pos + 4),
|
|
2531
2537
|
node = {
|
|
2532
|
-
type:
|
|
2538
|
+
type: "Literal",
|
|
2533
2539
|
value,
|
|
2534
2540
|
raw: null,
|
|
2535
2541
|
start,
|
|
2536
2542
|
end,
|
|
2537
2543
|
};
|
|
2538
|
-
node.raw = start === 0 && end === 0 ? null : value +
|
|
2544
|
+
node.raw = start === 0 && end === 0 ? null : value + "";
|
|
2539
2545
|
return node;
|
|
2540
2546
|
}
|
|
2541
2547
|
|
|
@@ -2543,13 +2549,13 @@ function deserializeNullLiteral(pos) {
|
|
|
2543
2549
|
let start = deserializeU32(pos),
|
|
2544
2550
|
end = deserializeU32(pos + 4),
|
|
2545
2551
|
node = {
|
|
2546
|
-
type:
|
|
2552
|
+
type: "Literal",
|
|
2547
2553
|
value: null,
|
|
2548
2554
|
raw: null,
|
|
2549
2555
|
start,
|
|
2550
2556
|
end,
|
|
2551
2557
|
};
|
|
2552
|
-
node.raw = start === 0 && end === 0 ? null :
|
|
2558
|
+
node.raw = start === 0 && end === 0 ? null : "null";
|
|
2553
2559
|
return node;
|
|
2554
2560
|
}
|
|
2555
2561
|
|
|
@@ -2557,7 +2563,7 @@ function deserializeNumericLiteral(pos) {
|
|
|
2557
2563
|
let start = deserializeU32(pos),
|
|
2558
2564
|
end = deserializeU32(pos + 4);
|
|
2559
2565
|
return {
|
|
2560
|
-
type:
|
|
2566
|
+
type: "Literal",
|
|
2561
2567
|
value: deserializeF64(pos + 8),
|
|
2562
2568
|
raw: deserializeOptionStr(pos + 16),
|
|
2563
2569
|
start,
|
|
@@ -2569,7 +2575,7 @@ function deserializeStringLiteral(pos) {
|
|
|
2569
2575
|
let start = deserializeU32(pos),
|
|
2570
2576
|
end = deserializeU32(pos + 4),
|
|
2571
2577
|
node = {
|
|
2572
|
-
type:
|
|
2578
|
+
type: "Literal",
|
|
2573
2579
|
value: null,
|
|
2574
2580
|
raw: deserializeOptionStr(pos + 24),
|
|
2575
2581
|
start,
|
|
@@ -2586,7 +2592,7 @@ function deserializeBigIntLiteral(pos) {
|
|
|
2586
2592
|
let start = deserializeU32(pos),
|
|
2587
2593
|
end = deserializeU32(pos + 4),
|
|
2588
2594
|
node = {
|
|
2589
|
-
type:
|
|
2595
|
+
type: "Literal",
|
|
2590
2596
|
value: null,
|
|
2591
2597
|
raw: deserializeOptionStr(pos + 24),
|
|
2592
2598
|
bigint: null,
|
|
@@ -2603,7 +2609,7 @@ function deserializeRegExpLiteral(pos) {
|
|
|
2603
2609
|
let start = deserializeU32(pos),
|
|
2604
2610
|
end = deserializeU32(pos + 4),
|
|
2605
2611
|
node = {
|
|
2606
|
-
type:
|
|
2612
|
+
type: "Literal",
|
|
2607
2613
|
value: null,
|
|
2608
2614
|
raw: deserializeOptionStr(pos + 40),
|
|
2609
2615
|
regex: null,
|
|
@@ -2629,22 +2635,22 @@ function deserializeRegExp(pos) {
|
|
|
2629
2635
|
|
|
2630
2636
|
function deserializeRegExpFlags(pos) {
|
|
2631
2637
|
let flagBits = deserializeU8(pos),
|
|
2632
|
-
flags =
|
|
2638
|
+
flags = "";
|
|
2633
2639
|
// Alphabetical order
|
|
2634
|
-
flagBits & 64 && (flags +=
|
|
2635
|
-
flagBits & 1 && (flags +=
|
|
2636
|
-
flagBits & 2 && (flags +=
|
|
2637
|
-
flagBits & 4 && (flags +=
|
|
2638
|
-
flagBits & 8 && (flags +=
|
|
2639
|
-
flagBits & 16 && (flags +=
|
|
2640
|
-
flagBits & 128 && (flags +=
|
|
2641
|
-
flagBits & 32 && (flags +=
|
|
2640
|
+
flagBits & 64 && (flags += "d");
|
|
2641
|
+
flagBits & 1 && (flags += "g");
|
|
2642
|
+
flagBits & 2 && (flags += "i");
|
|
2643
|
+
flagBits & 4 && (flags += "m");
|
|
2644
|
+
flagBits & 8 && (flags += "s");
|
|
2645
|
+
flagBits & 16 && (flags += "u");
|
|
2646
|
+
flagBits & 128 && (flags += "v");
|
|
2647
|
+
flagBits & 32 && (flags += "y");
|
|
2642
2648
|
return flags;
|
|
2643
2649
|
}
|
|
2644
2650
|
|
|
2645
2651
|
function deserializeJSXElement(pos) {
|
|
2646
2652
|
let node = {
|
|
2647
|
-
type:
|
|
2653
|
+
type: "JSXElement",
|
|
2648
2654
|
openingElement: null,
|
|
2649
2655
|
children: null,
|
|
2650
2656
|
closingElement: null,
|
|
@@ -2662,7 +2668,7 @@ function deserializeJSXElement(pos) {
|
|
|
2662
2668
|
|
|
2663
2669
|
function deserializeJSXOpeningElement(pos) {
|
|
2664
2670
|
let node = {
|
|
2665
|
-
type:
|
|
2671
|
+
type: "JSXOpeningElement",
|
|
2666
2672
|
name: null,
|
|
2667
2673
|
typeArguments: null,
|
|
2668
2674
|
attributes: null,
|
|
@@ -2679,7 +2685,7 @@ function deserializeJSXOpeningElement(pos) {
|
|
|
2679
2685
|
|
|
2680
2686
|
function deserializeJSXClosingElement(pos) {
|
|
2681
2687
|
let node = {
|
|
2682
|
-
type:
|
|
2688
|
+
type: "JSXClosingElement",
|
|
2683
2689
|
name: null,
|
|
2684
2690
|
start: deserializeU32(pos),
|
|
2685
2691
|
end: deserializeU32(pos + 4),
|
|
@@ -2690,7 +2696,7 @@ function deserializeJSXClosingElement(pos) {
|
|
|
2690
2696
|
|
|
2691
2697
|
function deserializeJSXFragment(pos) {
|
|
2692
2698
|
let node = {
|
|
2693
|
-
type:
|
|
2699
|
+
type: "JSXFragment",
|
|
2694
2700
|
openingFragment: null,
|
|
2695
2701
|
children: null,
|
|
2696
2702
|
closingFragment: null,
|
|
@@ -2705,7 +2711,7 @@ function deserializeJSXFragment(pos) {
|
|
|
2705
2711
|
|
|
2706
2712
|
function deserializeJSXOpeningFragment(pos) {
|
|
2707
2713
|
return {
|
|
2708
|
-
type:
|
|
2714
|
+
type: "JSXOpeningFragment",
|
|
2709
2715
|
start: deserializeU32(pos),
|
|
2710
2716
|
end: deserializeU32(pos + 4),
|
|
2711
2717
|
};
|
|
@@ -2713,7 +2719,7 @@ function deserializeJSXOpeningFragment(pos) {
|
|
|
2713
2719
|
|
|
2714
2720
|
function deserializeJSXClosingFragment(pos) {
|
|
2715
2721
|
return {
|
|
2716
|
-
type:
|
|
2722
|
+
type: "JSXClosingFragment",
|
|
2717
2723
|
start: deserializeU32(pos),
|
|
2718
2724
|
end: deserializeU32(pos + 4),
|
|
2719
2725
|
};
|
|
@@ -2726,7 +2732,7 @@ function deserializeJSXElementName(pos) {
|
|
|
2726
2732
|
case 1:
|
|
2727
2733
|
let ident = deserializeBoxIdentifierReference(pos + 8);
|
|
2728
2734
|
return {
|
|
2729
|
-
type:
|
|
2735
|
+
type: "JSXIdentifier",
|
|
2730
2736
|
name: ident.name,
|
|
2731
2737
|
start: ident.start,
|
|
2732
2738
|
end: ident.end,
|
|
@@ -2738,8 +2744,8 @@ function deserializeJSXElementName(pos) {
|
|
|
2738
2744
|
case 4:
|
|
2739
2745
|
let thisExpr = deserializeBoxThisExpression(pos + 8);
|
|
2740
2746
|
return {
|
|
2741
|
-
type:
|
|
2742
|
-
name:
|
|
2747
|
+
type: "JSXIdentifier",
|
|
2748
|
+
name: "this",
|
|
2743
2749
|
start: thisExpr.start,
|
|
2744
2750
|
end: thisExpr.end,
|
|
2745
2751
|
};
|
|
@@ -2750,7 +2756,7 @@ function deserializeJSXElementName(pos) {
|
|
|
2750
2756
|
|
|
2751
2757
|
function deserializeJSXNamespacedName(pos) {
|
|
2752
2758
|
let node = {
|
|
2753
|
-
type:
|
|
2759
|
+
type: "JSXNamespacedName",
|
|
2754
2760
|
namespace: null,
|
|
2755
2761
|
name: null,
|
|
2756
2762
|
start: deserializeU32(pos),
|
|
@@ -2763,7 +2769,7 @@ function deserializeJSXNamespacedName(pos) {
|
|
|
2763
2769
|
|
|
2764
2770
|
function deserializeJSXMemberExpression(pos) {
|
|
2765
2771
|
let node = {
|
|
2766
|
-
type:
|
|
2772
|
+
type: "JSXMemberExpression",
|
|
2767
2773
|
object: null,
|
|
2768
2774
|
property: null,
|
|
2769
2775
|
start: deserializeU32(pos),
|
|
@@ -2779,7 +2785,7 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2779
2785
|
case 0:
|
|
2780
2786
|
let ident = deserializeBoxIdentifierReference(pos + 8);
|
|
2781
2787
|
return {
|
|
2782
|
-
type:
|
|
2788
|
+
type: "JSXIdentifier",
|
|
2783
2789
|
name: ident.name,
|
|
2784
2790
|
start: ident.start,
|
|
2785
2791
|
end: ident.end,
|
|
@@ -2789,8 +2795,8 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2789
2795
|
case 2:
|
|
2790
2796
|
let thisExpr = deserializeBoxThisExpression(pos + 8);
|
|
2791
2797
|
return {
|
|
2792
|
-
type:
|
|
2793
|
-
name:
|
|
2798
|
+
type: "JSXIdentifier",
|
|
2799
|
+
name: "this",
|
|
2794
2800
|
start: thisExpr.start,
|
|
2795
2801
|
end: thisExpr.end,
|
|
2796
2802
|
};
|
|
@@ -2801,7 +2807,7 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2801
2807
|
|
|
2802
2808
|
function deserializeJSXExpressionContainer(pos) {
|
|
2803
2809
|
let node = {
|
|
2804
|
-
type:
|
|
2810
|
+
type: "JSXExpressionContainer",
|
|
2805
2811
|
expression: null,
|
|
2806
2812
|
start: deserializeU32(pos),
|
|
2807
2813
|
end: deserializeU32(pos + 4),
|
|
@@ -2907,7 +2913,7 @@ function deserializeJSXExpression(pos) {
|
|
|
2907
2913
|
|
|
2908
2914
|
function deserializeJSXEmptyExpression(pos) {
|
|
2909
2915
|
return {
|
|
2910
|
-
type:
|
|
2916
|
+
type: "JSXEmptyExpression",
|
|
2911
2917
|
start: deserializeU32(pos),
|
|
2912
2918
|
end: deserializeU32(pos + 4),
|
|
2913
2919
|
};
|
|
@@ -2926,7 +2932,7 @@ function deserializeJSXAttributeItem(pos) {
|
|
|
2926
2932
|
|
|
2927
2933
|
function deserializeJSXAttribute(pos) {
|
|
2928
2934
|
let node = {
|
|
2929
|
-
type:
|
|
2935
|
+
type: "JSXAttribute",
|
|
2930
2936
|
name: null,
|
|
2931
2937
|
value: null,
|
|
2932
2938
|
start: deserializeU32(pos),
|
|
@@ -2939,7 +2945,7 @@ function deserializeJSXAttribute(pos) {
|
|
|
2939
2945
|
|
|
2940
2946
|
function deserializeJSXSpreadAttribute(pos) {
|
|
2941
2947
|
let node = {
|
|
2942
|
-
type:
|
|
2948
|
+
type: "JSXSpreadAttribute",
|
|
2943
2949
|
argument: null,
|
|
2944
2950
|
start: deserializeU32(pos),
|
|
2945
2951
|
end: deserializeU32(pos + 4),
|
|
@@ -2978,7 +2984,7 @@ function deserializeJSXIdentifier(pos) {
|
|
|
2978
2984
|
let start = deserializeU32(pos),
|
|
2979
2985
|
end = deserializeU32(pos + 4);
|
|
2980
2986
|
return {
|
|
2981
|
-
type:
|
|
2987
|
+
type: "JSXIdentifier",
|
|
2982
2988
|
name: deserializeStr(pos + 8),
|
|
2983
2989
|
start,
|
|
2984
2990
|
end,
|
|
@@ -3004,7 +3010,7 @@ function deserializeJSXChild(pos) {
|
|
|
3004
3010
|
|
|
3005
3011
|
function deserializeJSXSpreadChild(pos) {
|
|
3006
3012
|
let node = {
|
|
3007
|
-
type:
|
|
3013
|
+
type: "JSXSpreadChild",
|
|
3008
3014
|
expression: null,
|
|
3009
3015
|
start: deserializeU32(pos),
|
|
3010
3016
|
end: deserializeU32(pos + 4),
|
|
@@ -3017,7 +3023,7 @@ function deserializeJSXText(pos) {
|
|
|
3017
3023
|
let start = deserializeU32(pos),
|
|
3018
3024
|
end = deserializeU32(pos + 4);
|
|
3019
3025
|
return {
|
|
3020
|
-
type:
|
|
3026
|
+
type: "JSXText",
|
|
3021
3027
|
value: deserializeStr(pos + 8),
|
|
3022
3028
|
raw: deserializeOptionStr(pos + 24),
|
|
3023
3029
|
start,
|
|
@@ -3027,7 +3033,7 @@ function deserializeJSXText(pos) {
|
|
|
3027
3033
|
|
|
3028
3034
|
function deserializeTSThisParameter(pos) {
|
|
3029
3035
|
let node = {
|
|
3030
|
-
type:
|
|
3036
|
+
type: "Identifier",
|
|
3031
3037
|
decorators: null,
|
|
3032
3038
|
name: null,
|
|
3033
3039
|
optional: null,
|
|
@@ -3036,7 +3042,7 @@ function deserializeTSThisParameter(pos) {
|
|
|
3036
3042
|
end: deserializeU32(pos + 4),
|
|
3037
3043
|
};
|
|
3038
3044
|
node.decorators = [];
|
|
3039
|
-
node.name =
|
|
3045
|
+
node.name = "this";
|
|
3040
3046
|
node.optional = false;
|
|
3041
3047
|
node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 16);
|
|
3042
3048
|
return node;
|
|
@@ -3046,7 +3052,7 @@ function deserializeTSEnumDeclaration(pos) {
|
|
|
3046
3052
|
let start = deserializeU32(pos),
|
|
3047
3053
|
end = deserializeU32(pos + 4),
|
|
3048
3054
|
node = {
|
|
3049
|
-
type:
|
|
3055
|
+
type: "TSEnumDeclaration",
|
|
3050
3056
|
id: null,
|
|
3051
3057
|
body: null,
|
|
3052
3058
|
const: deserializeBool(pos + 76),
|
|
@@ -3061,7 +3067,7 @@ function deserializeTSEnumDeclaration(pos) {
|
|
|
3061
3067
|
|
|
3062
3068
|
function deserializeTSEnumBody(pos) {
|
|
3063
3069
|
let node = {
|
|
3064
|
-
type:
|
|
3070
|
+
type: "TSEnumBody",
|
|
3065
3071
|
members: null,
|
|
3066
3072
|
start: deserializeU32(pos),
|
|
3067
3073
|
end: deserializeU32(pos + 4),
|
|
@@ -3072,7 +3078,7 @@ function deserializeTSEnumBody(pos) {
|
|
|
3072
3078
|
|
|
3073
3079
|
function deserializeTSEnumMember(pos) {
|
|
3074
3080
|
let node = {
|
|
3075
|
-
type:
|
|
3081
|
+
type: "TSEnumMember",
|
|
3076
3082
|
id: null,
|
|
3077
3083
|
initializer: null,
|
|
3078
3084
|
computed: null,
|
|
@@ -3102,7 +3108,7 @@ function deserializeTSEnumMemberName(pos) {
|
|
|
3102
3108
|
|
|
3103
3109
|
function deserializeTSTypeAnnotation(pos) {
|
|
3104
3110
|
let node = {
|
|
3105
|
-
type:
|
|
3111
|
+
type: "TSTypeAnnotation",
|
|
3106
3112
|
typeAnnotation: null,
|
|
3107
3113
|
start: deserializeU32(pos),
|
|
3108
3114
|
end: deserializeU32(pos + 4),
|
|
@@ -3113,7 +3119,7 @@ function deserializeTSTypeAnnotation(pos) {
|
|
|
3113
3119
|
|
|
3114
3120
|
function deserializeTSLiteralType(pos) {
|
|
3115
3121
|
let node = {
|
|
3116
|
-
type:
|
|
3122
|
+
type: "TSLiteralType",
|
|
3117
3123
|
literal: null,
|
|
3118
3124
|
start: deserializeU32(pos),
|
|
3119
3125
|
end: deserializeU32(pos + 4),
|
|
@@ -3224,7 +3230,7 @@ function deserializeTSType(pos) {
|
|
|
3224
3230
|
|
|
3225
3231
|
function deserializeTSConditionalType(pos) {
|
|
3226
3232
|
let node = {
|
|
3227
|
-
type:
|
|
3233
|
+
type: "TSConditionalType",
|
|
3228
3234
|
checkType: null,
|
|
3229
3235
|
extendsType: null,
|
|
3230
3236
|
trueType: null,
|
|
@@ -3241,7 +3247,7 @@ function deserializeTSConditionalType(pos) {
|
|
|
3241
3247
|
|
|
3242
3248
|
function deserializeTSUnionType(pos) {
|
|
3243
3249
|
let node = {
|
|
3244
|
-
type:
|
|
3250
|
+
type: "TSUnionType",
|
|
3245
3251
|
types: null,
|
|
3246
3252
|
start: deserializeU32(pos),
|
|
3247
3253
|
end: deserializeU32(pos + 4),
|
|
@@ -3252,7 +3258,7 @@ function deserializeTSUnionType(pos) {
|
|
|
3252
3258
|
|
|
3253
3259
|
function deserializeTSIntersectionType(pos) {
|
|
3254
3260
|
let node = {
|
|
3255
|
-
type:
|
|
3261
|
+
type: "TSIntersectionType",
|
|
3256
3262
|
types: null,
|
|
3257
3263
|
start: deserializeU32(pos),
|
|
3258
3264
|
end: deserializeU32(pos + 4),
|
|
@@ -3264,7 +3270,7 @@ function deserializeTSIntersectionType(pos) {
|
|
|
3264
3270
|
function deserializeTSParenthesizedType(pos) {
|
|
3265
3271
|
let node;
|
|
3266
3272
|
node = {
|
|
3267
|
-
type:
|
|
3273
|
+
type: "TSParenthesizedType",
|
|
3268
3274
|
typeAnnotation: null,
|
|
3269
3275
|
start: deserializeU32(pos),
|
|
3270
3276
|
end: deserializeU32(pos + 4),
|
|
@@ -3277,7 +3283,7 @@ function deserializeTSTypeOperator(pos) {
|
|
|
3277
3283
|
let start = deserializeU32(pos),
|
|
3278
3284
|
end = deserializeU32(pos + 4),
|
|
3279
3285
|
node = {
|
|
3280
|
-
type:
|
|
3286
|
+
type: "TSTypeOperator",
|
|
3281
3287
|
operator: deserializeTSTypeOperatorOperator(pos + 24),
|
|
3282
3288
|
typeAnnotation: null,
|
|
3283
3289
|
start,
|
|
@@ -3290,11 +3296,11 @@ function deserializeTSTypeOperator(pos) {
|
|
|
3290
3296
|
function deserializeTSTypeOperatorOperator(pos) {
|
|
3291
3297
|
switch (uint8[pos]) {
|
|
3292
3298
|
case 0:
|
|
3293
|
-
return
|
|
3299
|
+
return "keyof";
|
|
3294
3300
|
case 1:
|
|
3295
|
-
return
|
|
3301
|
+
return "unique";
|
|
3296
3302
|
case 2:
|
|
3297
|
-
return
|
|
3303
|
+
return "readonly";
|
|
3298
3304
|
default:
|
|
3299
3305
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSTypeOperatorOperator`);
|
|
3300
3306
|
}
|
|
@@ -3302,7 +3308,7 @@ function deserializeTSTypeOperatorOperator(pos) {
|
|
|
3302
3308
|
|
|
3303
3309
|
function deserializeTSArrayType(pos) {
|
|
3304
3310
|
let node = {
|
|
3305
|
-
type:
|
|
3311
|
+
type: "TSArrayType",
|
|
3306
3312
|
elementType: null,
|
|
3307
3313
|
start: deserializeU32(pos),
|
|
3308
3314
|
end: deserializeU32(pos + 4),
|
|
@@ -3313,7 +3319,7 @@ function deserializeTSArrayType(pos) {
|
|
|
3313
3319
|
|
|
3314
3320
|
function deserializeTSIndexedAccessType(pos) {
|
|
3315
3321
|
let node = {
|
|
3316
|
-
type:
|
|
3322
|
+
type: "TSIndexedAccessType",
|
|
3317
3323
|
objectType: null,
|
|
3318
3324
|
indexType: null,
|
|
3319
3325
|
start: deserializeU32(pos),
|
|
@@ -3326,7 +3332,7 @@ function deserializeTSIndexedAccessType(pos) {
|
|
|
3326
3332
|
|
|
3327
3333
|
function deserializeTSTupleType(pos) {
|
|
3328
3334
|
let node = {
|
|
3329
|
-
type:
|
|
3335
|
+
type: "TSTupleType",
|
|
3330
3336
|
elementTypes: null,
|
|
3331
3337
|
start: deserializeU32(pos),
|
|
3332
3338
|
end: deserializeU32(pos + 4),
|
|
@@ -3339,7 +3345,7 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
3339
3345
|
let start = deserializeU32(pos),
|
|
3340
3346
|
end = deserializeU32(pos + 4),
|
|
3341
3347
|
node = {
|
|
3342
|
-
type:
|
|
3348
|
+
type: "TSNamedTupleMember",
|
|
3343
3349
|
label: null,
|
|
3344
3350
|
elementType: null,
|
|
3345
3351
|
optional: deserializeBool(pos + 48),
|
|
@@ -3353,7 +3359,7 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
3353
3359
|
|
|
3354
3360
|
function deserializeTSOptionalType(pos) {
|
|
3355
3361
|
let node = {
|
|
3356
|
-
type:
|
|
3362
|
+
type: "TSOptionalType",
|
|
3357
3363
|
typeAnnotation: null,
|
|
3358
3364
|
start: deserializeU32(pos),
|
|
3359
3365
|
end: deserializeU32(pos + 4),
|
|
@@ -3364,7 +3370,7 @@ function deserializeTSOptionalType(pos) {
|
|
|
3364
3370
|
|
|
3365
3371
|
function deserializeTSRestType(pos) {
|
|
3366
3372
|
let node = {
|
|
3367
|
-
type:
|
|
3373
|
+
type: "TSRestType",
|
|
3368
3374
|
typeAnnotation: null,
|
|
3369
3375
|
start: deserializeU32(pos),
|
|
3370
3376
|
end: deserializeU32(pos + 4),
|
|
@@ -3460,7 +3466,7 @@ function deserializeTSTupleElement(pos) {
|
|
|
3460
3466
|
|
|
3461
3467
|
function deserializeTSAnyKeyword(pos) {
|
|
3462
3468
|
return {
|
|
3463
|
-
type:
|
|
3469
|
+
type: "TSAnyKeyword",
|
|
3464
3470
|
start: deserializeU32(pos),
|
|
3465
3471
|
end: deserializeU32(pos + 4),
|
|
3466
3472
|
};
|
|
@@ -3468,7 +3474,7 @@ function deserializeTSAnyKeyword(pos) {
|
|
|
3468
3474
|
|
|
3469
3475
|
function deserializeTSStringKeyword(pos) {
|
|
3470
3476
|
return {
|
|
3471
|
-
type:
|
|
3477
|
+
type: "TSStringKeyword",
|
|
3472
3478
|
start: deserializeU32(pos),
|
|
3473
3479
|
end: deserializeU32(pos + 4),
|
|
3474
3480
|
};
|
|
@@ -3476,7 +3482,7 @@ function deserializeTSStringKeyword(pos) {
|
|
|
3476
3482
|
|
|
3477
3483
|
function deserializeTSBooleanKeyword(pos) {
|
|
3478
3484
|
return {
|
|
3479
|
-
type:
|
|
3485
|
+
type: "TSBooleanKeyword",
|
|
3480
3486
|
start: deserializeU32(pos),
|
|
3481
3487
|
end: deserializeU32(pos + 4),
|
|
3482
3488
|
};
|
|
@@ -3484,7 +3490,7 @@ function deserializeTSBooleanKeyword(pos) {
|
|
|
3484
3490
|
|
|
3485
3491
|
function deserializeTSNumberKeyword(pos) {
|
|
3486
3492
|
return {
|
|
3487
|
-
type:
|
|
3493
|
+
type: "TSNumberKeyword",
|
|
3488
3494
|
start: deserializeU32(pos),
|
|
3489
3495
|
end: deserializeU32(pos + 4),
|
|
3490
3496
|
};
|
|
@@ -3492,7 +3498,7 @@ function deserializeTSNumberKeyword(pos) {
|
|
|
3492
3498
|
|
|
3493
3499
|
function deserializeTSNeverKeyword(pos) {
|
|
3494
3500
|
return {
|
|
3495
|
-
type:
|
|
3501
|
+
type: "TSNeverKeyword",
|
|
3496
3502
|
start: deserializeU32(pos),
|
|
3497
3503
|
end: deserializeU32(pos + 4),
|
|
3498
3504
|
};
|
|
@@ -3500,7 +3506,7 @@ function deserializeTSNeverKeyword(pos) {
|
|
|
3500
3506
|
|
|
3501
3507
|
function deserializeTSIntrinsicKeyword(pos) {
|
|
3502
3508
|
return {
|
|
3503
|
-
type:
|
|
3509
|
+
type: "TSIntrinsicKeyword",
|
|
3504
3510
|
start: deserializeU32(pos),
|
|
3505
3511
|
end: deserializeU32(pos + 4),
|
|
3506
3512
|
};
|
|
@@ -3508,7 +3514,7 @@ function deserializeTSIntrinsicKeyword(pos) {
|
|
|
3508
3514
|
|
|
3509
3515
|
function deserializeTSUnknownKeyword(pos) {
|
|
3510
3516
|
return {
|
|
3511
|
-
type:
|
|
3517
|
+
type: "TSUnknownKeyword",
|
|
3512
3518
|
start: deserializeU32(pos),
|
|
3513
3519
|
end: deserializeU32(pos + 4),
|
|
3514
3520
|
};
|
|
@@ -3516,7 +3522,7 @@ function deserializeTSUnknownKeyword(pos) {
|
|
|
3516
3522
|
|
|
3517
3523
|
function deserializeTSNullKeyword(pos) {
|
|
3518
3524
|
return {
|
|
3519
|
-
type:
|
|
3525
|
+
type: "TSNullKeyword",
|
|
3520
3526
|
start: deserializeU32(pos),
|
|
3521
3527
|
end: deserializeU32(pos + 4),
|
|
3522
3528
|
};
|
|
@@ -3524,7 +3530,7 @@ function deserializeTSNullKeyword(pos) {
|
|
|
3524
3530
|
|
|
3525
3531
|
function deserializeTSUndefinedKeyword(pos) {
|
|
3526
3532
|
return {
|
|
3527
|
-
type:
|
|
3533
|
+
type: "TSUndefinedKeyword",
|
|
3528
3534
|
start: deserializeU32(pos),
|
|
3529
3535
|
end: deserializeU32(pos + 4),
|
|
3530
3536
|
};
|
|
@@ -3532,7 +3538,7 @@ function deserializeTSUndefinedKeyword(pos) {
|
|
|
3532
3538
|
|
|
3533
3539
|
function deserializeTSVoidKeyword(pos) {
|
|
3534
3540
|
return {
|
|
3535
|
-
type:
|
|
3541
|
+
type: "TSVoidKeyword",
|
|
3536
3542
|
start: deserializeU32(pos),
|
|
3537
3543
|
end: deserializeU32(pos + 4),
|
|
3538
3544
|
};
|
|
@@ -3540,7 +3546,7 @@ function deserializeTSVoidKeyword(pos) {
|
|
|
3540
3546
|
|
|
3541
3547
|
function deserializeTSSymbolKeyword(pos) {
|
|
3542
3548
|
return {
|
|
3543
|
-
type:
|
|
3549
|
+
type: "TSSymbolKeyword",
|
|
3544
3550
|
start: deserializeU32(pos),
|
|
3545
3551
|
end: deserializeU32(pos + 4),
|
|
3546
3552
|
};
|
|
@@ -3548,7 +3554,7 @@ function deserializeTSSymbolKeyword(pos) {
|
|
|
3548
3554
|
|
|
3549
3555
|
function deserializeTSThisType(pos) {
|
|
3550
3556
|
return {
|
|
3551
|
-
type:
|
|
3557
|
+
type: "TSThisType",
|
|
3552
3558
|
start: deserializeU32(pos),
|
|
3553
3559
|
end: deserializeU32(pos + 4),
|
|
3554
3560
|
};
|
|
@@ -3556,7 +3562,7 @@ function deserializeTSThisType(pos) {
|
|
|
3556
3562
|
|
|
3557
3563
|
function deserializeTSObjectKeyword(pos) {
|
|
3558
3564
|
return {
|
|
3559
|
-
type:
|
|
3565
|
+
type: "TSObjectKeyword",
|
|
3560
3566
|
start: deserializeU32(pos),
|
|
3561
3567
|
end: deserializeU32(pos + 4),
|
|
3562
3568
|
};
|
|
@@ -3564,7 +3570,7 @@ function deserializeTSObjectKeyword(pos) {
|
|
|
3564
3570
|
|
|
3565
3571
|
function deserializeTSBigIntKeyword(pos) {
|
|
3566
3572
|
return {
|
|
3567
|
-
type:
|
|
3573
|
+
type: "TSBigIntKeyword",
|
|
3568
3574
|
start: deserializeU32(pos),
|
|
3569
3575
|
end: deserializeU32(pos + 4),
|
|
3570
3576
|
};
|
|
@@ -3572,7 +3578,7 @@ function deserializeTSBigIntKeyword(pos) {
|
|
|
3572
3578
|
|
|
3573
3579
|
function deserializeTSTypeReference(pos) {
|
|
3574
3580
|
let node = {
|
|
3575
|
-
type:
|
|
3581
|
+
type: "TSTypeReference",
|
|
3576
3582
|
typeName: null,
|
|
3577
3583
|
typeArguments: null,
|
|
3578
3584
|
start: deserializeU32(pos),
|
|
@@ -3598,7 +3604,7 @@ function deserializeTSTypeName(pos) {
|
|
|
3598
3604
|
|
|
3599
3605
|
function deserializeTSQualifiedName(pos) {
|
|
3600
3606
|
let node = {
|
|
3601
|
-
type:
|
|
3607
|
+
type: "TSQualifiedName",
|
|
3602
3608
|
left: null,
|
|
3603
3609
|
right: null,
|
|
3604
3610
|
start: deserializeU32(pos),
|
|
@@ -3611,7 +3617,7 @@ function deserializeTSQualifiedName(pos) {
|
|
|
3611
3617
|
|
|
3612
3618
|
function deserializeTSTypeParameterInstantiation(pos) {
|
|
3613
3619
|
let node = {
|
|
3614
|
-
type:
|
|
3620
|
+
type: "TSTypeParameterInstantiation",
|
|
3615
3621
|
params: null,
|
|
3616
3622
|
start: deserializeU32(pos),
|
|
3617
3623
|
end: deserializeU32(pos + 4),
|
|
@@ -3624,7 +3630,7 @@ function deserializeTSTypeParameter(pos) {
|
|
|
3624
3630
|
let start = deserializeU32(pos),
|
|
3625
3631
|
end = deserializeU32(pos + 4),
|
|
3626
3632
|
node = {
|
|
3627
|
-
type:
|
|
3633
|
+
type: "TSTypeParameter",
|
|
3628
3634
|
name: null,
|
|
3629
3635
|
constraint: null,
|
|
3630
3636
|
default: null,
|
|
@@ -3642,7 +3648,7 @@ function deserializeTSTypeParameter(pos) {
|
|
|
3642
3648
|
|
|
3643
3649
|
function deserializeTSTypeParameterDeclaration(pos) {
|
|
3644
3650
|
let node = {
|
|
3645
|
-
type:
|
|
3651
|
+
type: "TSTypeParameterDeclaration",
|
|
3646
3652
|
params: null,
|
|
3647
3653
|
start: deserializeU32(pos),
|
|
3648
3654
|
end: deserializeU32(pos + 4),
|
|
@@ -3655,7 +3661,7 @@ function deserializeTSTypeAliasDeclaration(pos) {
|
|
|
3655
3661
|
let start = deserializeU32(pos),
|
|
3656
3662
|
end = deserializeU32(pos + 4),
|
|
3657
3663
|
node = {
|
|
3658
|
-
type:
|
|
3664
|
+
type: "TSTypeAliasDeclaration",
|
|
3659
3665
|
id: null,
|
|
3660
3666
|
typeParameters: null,
|
|
3661
3667
|
typeAnnotation: null,
|
|
@@ -3672,11 +3678,11 @@ function deserializeTSTypeAliasDeclaration(pos) {
|
|
|
3672
3678
|
function deserializeTSAccessibility(pos) {
|
|
3673
3679
|
switch (uint8[pos]) {
|
|
3674
3680
|
case 0:
|
|
3675
|
-
return
|
|
3681
|
+
return "private";
|
|
3676
3682
|
case 1:
|
|
3677
|
-
return
|
|
3683
|
+
return "protected";
|
|
3678
3684
|
case 2:
|
|
3679
|
-
return
|
|
3685
|
+
return "public";
|
|
3680
3686
|
default:
|
|
3681
3687
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSAccessibility`);
|
|
3682
3688
|
}
|
|
@@ -3684,18 +3690,18 @@ function deserializeTSAccessibility(pos) {
|
|
|
3684
3690
|
|
|
3685
3691
|
function deserializeTSClassImplements(pos) {
|
|
3686
3692
|
let node = {
|
|
3687
|
-
type:
|
|
3693
|
+
type: "TSClassImplements",
|
|
3688
3694
|
expression: null,
|
|
3689
3695
|
typeArguments: null,
|
|
3690
3696
|
start: deserializeU32(pos),
|
|
3691
3697
|
end: deserializeU32(pos + 4),
|
|
3692
3698
|
},
|
|
3693
3699
|
expression = deserializeTSTypeName(pos + 8);
|
|
3694
|
-
if (expression.type ===
|
|
3700
|
+
if (expression.type === "TSQualifiedName") {
|
|
3695
3701
|
let object = expression.left,
|
|
3696
3702
|
{ right } = expression,
|
|
3697
3703
|
previous = (expression = {
|
|
3698
|
-
type:
|
|
3704
|
+
type: "MemberExpression",
|
|
3699
3705
|
object,
|
|
3700
3706
|
property: right,
|
|
3701
3707
|
optional: false,
|
|
@@ -3703,10 +3709,10 @@ function deserializeTSClassImplements(pos) {
|
|
|
3703
3709
|
start: expression.start,
|
|
3704
3710
|
end: expression.end,
|
|
3705
3711
|
});
|
|
3706
|
-
for (; object.type ===
|
|
3712
|
+
for (; object.type === "TSQualifiedName"; ) {
|
|
3707
3713
|
let { left, right } = object;
|
|
3708
3714
|
previous = previous.object = {
|
|
3709
|
-
type:
|
|
3715
|
+
type: "MemberExpression",
|
|
3710
3716
|
object: left,
|
|
3711
3717
|
property: right,
|
|
3712
3718
|
optional: false,
|
|
@@ -3726,7 +3732,7 @@ function deserializeTSInterfaceDeclaration(pos) {
|
|
|
3726
3732
|
let start = deserializeU32(pos),
|
|
3727
3733
|
end = deserializeU32(pos + 4),
|
|
3728
3734
|
node = {
|
|
3729
|
-
type:
|
|
3735
|
+
type: "TSInterfaceDeclaration",
|
|
3730
3736
|
id: null,
|
|
3731
3737
|
typeParameters: null,
|
|
3732
3738
|
extends: null,
|
|
@@ -3744,7 +3750,7 @@ function deserializeTSInterfaceDeclaration(pos) {
|
|
|
3744
3750
|
|
|
3745
3751
|
function deserializeTSInterfaceBody(pos) {
|
|
3746
3752
|
let node = {
|
|
3747
|
-
type:
|
|
3753
|
+
type: "TSInterfaceBody",
|
|
3748
3754
|
body: null,
|
|
3749
3755
|
start: deserializeU32(pos),
|
|
3750
3756
|
end: deserializeU32(pos + 4),
|
|
@@ -3757,7 +3763,7 @@ function deserializeTSPropertySignature(pos) {
|
|
|
3757
3763
|
let start = deserializeU32(pos),
|
|
3758
3764
|
end = deserializeU32(pos + 4),
|
|
3759
3765
|
node = {
|
|
3760
|
-
type:
|
|
3766
|
+
type: "TSPropertySignature",
|
|
3761
3767
|
computed: deserializeBool(pos + 32),
|
|
3762
3768
|
optional: deserializeBool(pos + 33),
|
|
3763
3769
|
readonly: deserializeBool(pos + 34),
|
|
@@ -3795,7 +3801,7 @@ function deserializeTSIndexSignature(pos) {
|
|
|
3795
3801
|
let start = deserializeU32(pos),
|
|
3796
3802
|
end = deserializeU32(pos + 4),
|
|
3797
3803
|
node = {
|
|
3798
|
-
type:
|
|
3804
|
+
type: "TSIndexSignature",
|
|
3799
3805
|
parameters: null,
|
|
3800
3806
|
typeAnnotation: null,
|
|
3801
3807
|
readonly: deserializeBool(pos + 40),
|
|
@@ -3811,7 +3817,7 @@ function deserializeTSIndexSignature(pos) {
|
|
|
3811
3817
|
|
|
3812
3818
|
function deserializeTSCallSignatureDeclaration(pos) {
|
|
3813
3819
|
let node = {
|
|
3814
|
-
type:
|
|
3820
|
+
type: "TSCallSignatureDeclaration",
|
|
3815
3821
|
typeParameters: null,
|
|
3816
3822
|
params: null,
|
|
3817
3823
|
returnType: null,
|
|
@@ -3830,11 +3836,11 @@ function deserializeTSCallSignatureDeclaration(pos) {
|
|
|
3830
3836
|
function deserializeTSMethodSignatureKind(pos) {
|
|
3831
3837
|
switch (uint8[pos]) {
|
|
3832
3838
|
case 0:
|
|
3833
|
-
return
|
|
3839
|
+
return "method";
|
|
3834
3840
|
case 1:
|
|
3835
|
-
return
|
|
3841
|
+
return "get";
|
|
3836
3842
|
case 2:
|
|
3837
|
-
return
|
|
3843
|
+
return "set";
|
|
3838
3844
|
default:
|
|
3839
3845
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSMethodSignatureKind`);
|
|
3840
3846
|
}
|
|
@@ -3844,7 +3850,7 @@ function deserializeTSMethodSignature(pos) {
|
|
|
3844
3850
|
let start = deserializeU32(pos),
|
|
3845
3851
|
end = deserializeU32(pos + 4),
|
|
3846
3852
|
node = {
|
|
3847
|
-
type:
|
|
3853
|
+
type: "TSMethodSignature",
|
|
3848
3854
|
key: null,
|
|
3849
3855
|
computed: deserializeBool(pos + 60),
|
|
3850
3856
|
optional: deserializeBool(pos + 61),
|
|
@@ -3872,7 +3878,7 @@ function deserializeTSMethodSignature(pos) {
|
|
|
3872
3878
|
|
|
3873
3879
|
function deserializeTSConstructSignatureDeclaration(pos) {
|
|
3874
3880
|
let node = {
|
|
3875
|
-
type:
|
|
3881
|
+
type: "TSConstructSignatureDeclaration",
|
|
3876
3882
|
typeParameters: null,
|
|
3877
3883
|
params: null,
|
|
3878
3884
|
returnType: null,
|
|
@@ -3889,7 +3895,7 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
3889
3895
|
let start = deserializeU32(pos),
|
|
3890
3896
|
end = deserializeU32(pos + 4),
|
|
3891
3897
|
node = {
|
|
3892
|
-
type:
|
|
3898
|
+
type: "Identifier",
|
|
3893
3899
|
decorators: null,
|
|
3894
3900
|
name: deserializeStr(pos + 8),
|
|
3895
3901
|
optional: null,
|
|
@@ -3905,7 +3911,7 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
3905
3911
|
|
|
3906
3912
|
function deserializeTSInterfaceHeritage(pos) {
|
|
3907
3913
|
let node = {
|
|
3908
|
-
type:
|
|
3914
|
+
type: "TSInterfaceHeritage",
|
|
3909
3915
|
expression: null,
|
|
3910
3916
|
typeArguments: null,
|
|
3911
3917
|
start: deserializeU32(pos),
|
|
@@ -3920,7 +3926,7 @@ function deserializeTSTypePredicate(pos) {
|
|
|
3920
3926
|
let start = deserializeU32(pos),
|
|
3921
3927
|
end = deserializeU32(pos + 4),
|
|
3922
3928
|
node = {
|
|
3923
|
-
type:
|
|
3929
|
+
type: "TSTypePredicate",
|
|
3924
3930
|
parameterName: null,
|
|
3925
3931
|
asserts: deserializeBool(pos + 32),
|
|
3926
3932
|
typeAnnotation: null,
|
|
@@ -3952,7 +3958,7 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3952
3958
|
body = deserializeOptionTSModuleDeclarationBody(pos + 64);
|
|
3953
3959
|
if (body === null) {
|
|
3954
3960
|
node = {
|
|
3955
|
-
type:
|
|
3961
|
+
type: "TSModuleDeclaration",
|
|
3956
3962
|
id: null,
|
|
3957
3963
|
kind,
|
|
3958
3964
|
declare,
|
|
@@ -3963,7 +3969,7 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3963
3969
|
node.id = deserializeTSModuleDeclarationName(pos + 8);
|
|
3964
3970
|
} else {
|
|
3965
3971
|
node = {
|
|
3966
|
-
type:
|
|
3972
|
+
type: "TSModuleDeclaration",
|
|
3967
3973
|
id: null,
|
|
3968
3974
|
body,
|
|
3969
3975
|
kind,
|
|
@@ -3973,12 +3979,12 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3973
3979
|
end,
|
|
3974
3980
|
};
|
|
3975
3981
|
let id = deserializeTSModuleDeclarationName(pos + 8);
|
|
3976
|
-
if (body.type ===
|
|
3982
|
+
if (body.type === "TSModuleBlock") node.id = id;
|
|
3977
3983
|
else {
|
|
3978
3984
|
let innerId = body.id;
|
|
3979
|
-
if (innerId.type ===
|
|
3985
|
+
if (innerId.type === "Identifier")
|
|
3980
3986
|
node.id = {
|
|
3981
|
-
type:
|
|
3987
|
+
type: "TSQualifiedName",
|
|
3982
3988
|
left: id,
|
|
3983
3989
|
right: innerId,
|
|
3984
3990
|
start: id.start,
|
|
@@ -3991,19 +3997,19 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3991
3997
|
let { start } = id;
|
|
3992
3998
|
for (;;) {
|
|
3993
3999
|
innerId.start = start;
|
|
3994
|
-
if (innerId.left.type ===
|
|
4000
|
+
if (innerId.left.type === "Identifier") break;
|
|
3995
4001
|
innerId = innerId.left;
|
|
3996
4002
|
}
|
|
3997
4003
|
let right = innerId.left;
|
|
3998
4004
|
innerId.left = {
|
|
3999
|
-
type:
|
|
4005
|
+
type: "TSQualifiedName",
|
|
4000
4006
|
left: id,
|
|
4001
4007
|
right,
|
|
4002
4008
|
start,
|
|
4003
4009
|
end: right.end,
|
|
4004
4010
|
};
|
|
4005
4011
|
}
|
|
4006
|
-
if (Object.hasOwn(body,
|
|
4012
|
+
if (Object.hasOwn(body, "body")) {
|
|
4007
4013
|
body = body.body;
|
|
4008
4014
|
node.body = body;
|
|
4009
4015
|
} else body = null;
|
|
@@ -4015,9 +4021,9 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
4015
4021
|
function deserializeTSModuleDeclarationKind(pos) {
|
|
4016
4022
|
switch (uint8[pos]) {
|
|
4017
4023
|
case 0:
|
|
4018
|
-
return
|
|
4024
|
+
return "module";
|
|
4019
4025
|
case 1:
|
|
4020
|
-
return
|
|
4026
|
+
return "namespace";
|
|
4021
4027
|
default:
|
|
4022
4028
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSModuleDeclarationKind`);
|
|
4023
4029
|
}
|
|
@@ -4049,7 +4055,7 @@ function deserializeTSGlobalDeclaration(pos) {
|
|
|
4049
4055
|
let start = deserializeU32(pos),
|
|
4050
4056
|
end = deserializeU32(pos + 4),
|
|
4051
4057
|
node = {
|
|
4052
|
-
type:
|
|
4058
|
+
type: "TSModuleDeclaration",
|
|
4053
4059
|
id: null,
|
|
4054
4060
|
body: null,
|
|
4055
4061
|
kind: null,
|
|
@@ -4059,23 +4065,23 @@ function deserializeTSGlobalDeclaration(pos) {
|
|
|
4059
4065
|
end,
|
|
4060
4066
|
};
|
|
4061
4067
|
node.id = {
|
|
4062
|
-
type:
|
|
4068
|
+
type: "Identifier",
|
|
4063
4069
|
decorators: [],
|
|
4064
|
-
name:
|
|
4070
|
+
name: "global",
|
|
4065
4071
|
optional: false,
|
|
4066
4072
|
typeAnnotation: null,
|
|
4067
4073
|
start: deserializeU32(pos + 8),
|
|
4068
4074
|
end: deserializeU32(pos + 12),
|
|
4069
4075
|
};
|
|
4070
4076
|
node.body = deserializeTSModuleBlock(pos + 16);
|
|
4071
|
-
node.kind =
|
|
4077
|
+
node.kind = "global";
|
|
4072
4078
|
node.global = true;
|
|
4073
4079
|
return node;
|
|
4074
4080
|
}
|
|
4075
4081
|
|
|
4076
4082
|
function deserializeTSModuleBlock(pos) {
|
|
4077
4083
|
let node = {
|
|
4078
|
-
type:
|
|
4084
|
+
type: "TSModuleBlock",
|
|
4079
4085
|
body: null,
|
|
4080
4086
|
start: deserializeU32(pos),
|
|
4081
4087
|
end: deserializeU32(pos + 4),
|
|
@@ -4088,7 +4094,7 @@ function deserializeTSModuleBlock(pos) {
|
|
|
4088
4094
|
|
|
4089
4095
|
function deserializeTSTypeLiteral(pos) {
|
|
4090
4096
|
let node = {
|
|
4091
|
-
type:
|
|
4097
|
+
type: "TSTypeLiteral",
|
|
4092
4098
|
members: null,
|
|
4093
4099
|
start: deserializeU32(pos),
|
|
4094
4100
|
end: deserializeU32(pos + 4),
|
|
@@ -4099,7 +4105,7 @@ function deserializeTSTypeLiteral(pos) {
|
|
|
4099
4105
|
|
|
4100
4106
|
function deserializeTSInferType(pos) {
|
|
4101
4107
|
let node = {
|
|
4102
|
-
type:
|
|
4108
|
+
type: "TSInferType",
|
|
4103
4109
|
typeParameter: null,
|
|
4104
4110
|
start: deserializeU32(pos),
|
|
4105
4111
|
end: deserializeU32(pos + 4),
|
|
@@ -4110,7 +4116,7 @@ function deserializeTSInferType(pos) {
|
|
|
4110
4116
|
|
|
4111
4117
|
function deserializeTSTypeQuery(pos) {
|
|
4112
4118
|
let node = {
|
|
4113
|
-
type:
|
|
4119
|
+
type: "TSTypeQuery",
|
|
4114
4120
|
exprName: null,
|
|
4115
4121
|
typeArguments: null,
|
|
4116
4122
|
start: deserializeU32(pos),
|
|
@@ -4138,18 +4144,18 @@ function deserializeTSTypeQueryExprName(pos) {
|
|
|
4138
4144
|
|
|
4139
4145
|
function deserializeTSImportType(pos) {
|
|
4140
4146
|
let node = {
|
|
4141
|
-
type:
|
|
4142
|
-
|
|
4147
|
+
type: "TSImportType",
|
|
4148
|
+
source: null,
|
|
4143
4149
|
options: null,
|
|
4144
4150
|
qualifier: null,
|
|
4145
4151
|
typeArguments: null,
|
|
4146
4152
|
start: deserializeU32(pos),
|
|
4147
4153
|
end: deserializeU32(pos + 4),
|
|
4148
4154
|
};
|
|
4149
|
-
node.
|
|
4150
|
-
node.options = deserializeOptionBoxObjectExpression(pos +
|
|
4151
|
-
node.qualifier = deserializeOptionTSImportTypeQualifier(pos +
|
|
4152
|
-
node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos +
|
|
4155
|
+
node.source = deserializeStringLiteral(pos + 8);
|
|
4156
|
+
node.options = deserializeOptionBoxObjectExpression(pos + 56);
|
|
4157
|
+
node.qualifier = deserializeOptionTSImportTypeQualifier(pos + 64);
|
|
4158
|
+
node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 80);
|
|
4153
4159
|
return node;
|
|
4154
4160
|
}
|
|
4155
4161
|
|
|
@@ -4166,7 +4172,7 @@ function deserializeTSImportTypeQualifier(pos) {
|
|
|
4166
4172
|
|
|
4167
4173
|
function deserializeTSImportTypeQualifiedName(pos) {
|
|
4168
4174
|
let node = {
|
|
4169
|
-
type:
|
|
4175
|
+
type: "TSQualifiedName",
|
|
4170
4176
|
left: null,
|
|
4171
4177
|
right: null,
|
|
4172
4178
|
start: deserializeU32(pos),
|
|
@@ -4179,7 +4185,7 @@ function deserializeTSImportTypeQualifiedName(pos) {
|
|
|
4179
4185
|
|
|
4180
4186
|
function deserializeTSFunctionType(pos) {
|
|
4181
4187
|
let node = {
|
|
4182
|
-
type:
|
|
4188
|
+
type: "TSFunctionType",
|
|
4183
4189
|
typeParameters: null,
|
|
4184
4190
|
params: null,
|
|
4185
4191
|
returnType: null,
|
|
@@ -4199,7 +4205,7 @@ function deserializeTSConstructorType(pos) {
|
|
|
4199
4205
|
let start = deserializeU32(pos),
|
|
4200
4206
|
end = deserializeU32(pos + 4),
|
|
4201
4207
|
node = {
|
|
4202
|
-
type:
|
|
4208
|
+
type: "TSConstructorType",
|
|
4203
4209
|
abstract: deserializeBool(pos + 36),
|
|
4204
4210
|
typeParameters: null,
|
|
4205
4211
|
params: null,
|
|
@@ -4217,7 +4223,7 @@ function deserializeTSMappedType(pos) {
|
|
|
4217
4223
|
let start = deserializeU32(pos),
|
|
4218
4224
|
end = deserializeU32(pos + 4),
|
|
4219
4225
|
node = {
|
|
4220
|
-
type:
|
|
4226
|
+
type: "TSMappedType",
|
|
4221
4227
|
key: null,
|
|
4222
4228
|
constraint: null,
|
|
4223
4229
|
nameType: null,
|
|
@@ -4245,9 +4251,9 @@ function deserializeTSMappedTypeModifierOperator(pos) {
|
|
|
4245
4251
|
case 0:
|
|
4246
4252
|
return true;
|
|
4247
4253
|
case 1:
|
|
4248
|
-
return
|
|
4254
|
+
return "+";
|
|
4249
4255
|
case 2:
|
|
4250
|
-
return
|
|
4256
|
+
return "-";
|
|
4251
4257
|
default:
|
|
4252
4258
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSMappedTypeModifierOperator`);
|
|
4253
4259
|
}
|
|
@@ -4255,7 +4261,7 @@ function deserializeTSMappedTypeModifierOperator(pos) {
|
|
|
4255
4261
|
|
|
4256
4262
|
function deserializeTSTemplateLiteralType(pos) {
|
|
4257
4263
|
let node = {
|
|
4258
|
-
type:
|
|
4264
|
+
type: "TSTemplateLiteralType",
|
|
4259
4265
|
quasis: null,
|
|
4260
4266
|
types: null,
|
|
4261
4267
|
start: deserializeU32(pos),
|
|
@@ -4268,7 +4274,7 @@ function deserializeTSTemplateLiteralType(pos) {
|
|
|
4268
4274
|
|
|
4269
4275
|
function deserializeTSAsExpression(pos) {
|
|
4270
4276
|
let node = {
|
|
4271
|
-
type:
|
|
4277
|
+
type: "TSAsExpression",
|
|
4272
4278
|
expression: null,
|
|
4273
4279
|
typeAnnotation: null,
|
|
4274
4280
|
start: deserializeU32(pos),
|
|
@@ -4281,7 +4287,7 @@ function deserializeTSAsExpression(pos) {
|
|
|
4281
4287
|
|
|
4282
4288
|
function deserializeTSSatisfiesExpression(pos) {
|
|
4283
4289
|
let node = {
|
|
4284
|
-
type:
|
|
4290
|
+
type: "TSSatisfiesExpression",
|
|
4285
4291
|
expression: null,
|
|
4286
4292
|
typeAnnotation: null,
|
|
4287
4293
|
start: deserializeU32(pos),
|
|
@@ -4294,7 +4300,7 @@ function deserializeTSSatisfiesExpression(pos) {
|
|
|
4294
4300
|
|
|
4295
4301
|
function deserializeTSTypeAssertion(pos) {
|
|
4296
4302
|
let node = {
|
|
4297
|
-
type:
|
|
4303
|
+
type: "TSTypeAssertion",
|
|
4298
4304
|
typeAnnotation: null,
|
|
4299
4305
|
expression: null,
|
|
4300
4306
|
start: deserializeU32(pos),
|
|
@@ -4309,7 +4315,7 @@ function deserializeTSImportEqualsDeclaration(pos) {
|
|
|
4309
4315
|
let start = deserializeU32(pos),
|
|
4310
4316
|
end = deserializeU32(pos + 4),
|
|
4311
4317
|
node = {
|
|
4312
|
-
type:
|
|
4318
|
+
type: "TSImportEqualsDeclaration",
|
|
4313
4319
|
id: null,
|
|
4314
4320
|
moduleReference: null,
|
|
4315
4321
|
importKind: deserializeImportOrExportKind(pos + 56),
|
|
@@ -4338,7 +4344,7 @@ function deserializeTSModuleReference(pos) {
|
|
|
4338
4344
|
|
|
4339
4345
|
function deserializeTSExternalModuleReference(pos) {
|
|
4340
4346
|
let node = {
|
|
4341
|
-
type:
|
|
4347
|
+
type: "TSExternalModuleReference",
|
|
4342
4348
|
expression: null,
|
|
4343
4349
|
start: deserializeU32(pos),
|
|
4344
4350
|
end: deserializeU32(pos + 4),
|
|
@@ -4349,7 +4355,7 @@ function deserializeTSExternalModuleReference(pos) {
|
|
|
4349
4355
|
|
|
4350
4356
|
function deserializeTSNonNullExpression(pos) {
|
|
4351
4357
|
let node = {
|
|
4352
|
-
type:
|
|
4358
|
+
type: "TSNonNullExpression",
|
|
4353
4359
|
expression: null,
|
|
4354
4360
|
start: deserializeU32(pos),
|
|
4355
4361
|
end: deserializeU32(pos + 4),
|
|
@@ -4360,7 +4366,7 @@ function deserializeTSNonNullExpression(pos) {
|
|
|
4360
4366
|
|
|
4361
4367
|
function deserializeDecorator(pos) {
|
|
4362
4368
|
let node = {
|
|
4363
|
-
type:
|
|
4369
|
+
type: "Decorator",
|
|
4364
4370
|
expression: null,
|
|
4365
4371
|
start: deserializeU32(pos),
|
|
4366
4372
|
end: deserializeU32(pos + 4),
|
|
@@ -4371,7 +4377,7 @@ function deserializeDecorator(pos) {
|
|
|
4371
4377
|
|
|
4372
4378
|
function deserializeTSExportAssignment(pos) {
|
|
4373
4379
|
let node = {
|
|
4374
|
-
type:
|
|
4380
|
+
type: "TSExportAssignment",
|
|
4375
4381
|
expression: null,
|
|
4376
4382
|
start: deserializeU32(pos),
|
|
4377
4383
|
end: deserializeU32(pos + 4),
|
|
@@ -4382,7 +4388,7 @@ function deserializeTSExportAssignment(pos) {
|
|
|
4382
4388
|
|
|
4383
4389
|
function deserializeTSNamespaceExportDeclaration(pos) {
|
|
4384
4390
|
let node = {
|
|
4385
|
-
type:
|
|
4391
|
+
type: "TSNamespaceExportDeclaration",
|
|
4386
4392
|
id: null,
|
|
4387
4393
|
start: deserializeU32(pos),
|
|
4388
4394
|
end: deserializeU32(pos + 4),
|
|
@@ -4393,7 +4399,7 @@ function deserializeTSNamespaceExportDeclaration(pos) {
|
|
|
4393
4399
|
|
|
4394
4400
|
function deserializeTSInstantiationExpression(pos) {
|
|
4395
4401
|
let node = {
|
|
4396
|
-
type:
|
|
4402
|
+
type: "TSInstantiationExpression",
|
|
4397
4403
|
expression: null,
|
|
4398
4404
|
typeArguments: null,
|
|
4399
4405
|
start: deserializeU32(pos),
|
|
@@ -4407,9 +4413,9 @@ function deserializeTSInstantiationExpression(pos) {
|
|
|
4407
4413
|
function deserializeImportOrExportKind(pos) {
|
|
4408
4414
|
switch (uint8[pos]) {
|
|
4409
4415
|
case 0:
|
|
4410
|
-
return
|
|
4416
|
+
return "value";
|
|
4411
4417
|
case 1:
|
|
4412
|
-
return
|
|
4418
|
+
return "type";
|
|
4413
4419
|
default:
|
|
4414
4420
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ImportOrExportKind`);
|
|
4415
4421
|
}
|
|
@@ -4419,7 +4425,7 @@ function deserializeJSDocNullableType(pos) {
|
|
|
4419
4425
|
let start = deserializeU32(pos),
|
|
4420
4426
|
end = deserializeU32(pos + 4),
|
|
4421
4427
|
node = {
|
|
4422
|
-
type:
|
|
4428
|
+
type: "TSJSDocNullableType",
|
|
4423
4429
|
typeAnnotation: null,
|
|
4424
4430
|
postfix: deserializeBool(pos + 24),
|
|
4425
4431
|
start,
|
|
@@ -4433,7 +4439,7 @@ function deserializeJSDocNonNullableType(pos) {
|
|
|
4433
4439
|
let start = deserializeU32(pos),
|
|
4434
4440
|
end = deserializeU32(pos + 4),
|
|
4435
4441
|
node = {
|
|
4436
|
-
type:
|
|
4442
|
+
type: "TSJSDocNonNullableType",
|
|
4437
4443
|
typeAnnotation: null,
|
|
4438
4444
|
postfix: deserializeBool(pos + 24),
|
|
4439
4445
|
start,
|
|
@@ -4445,7 +4451,7 @@ function deserializeJSDocNonNullableType(pos) {
|
|
|
4445
4451
|
|
|
4446
4452
|
function deserializeJSDocUnknownType(pos) {
|
|
4447
4453
|
return {
|
|
4448
|
-
type:
|
|
4454
|
+
type: "TSJSDocUnknownType",
|
|
4449
4455
|
start: deserializeU32(pos),
|
|
4450
4456
|
end: deserializeU32(pos + 4),
|
|
4451
4457
|
};
|
|
@@ -4454,9 +4460,9 @@ function deserializeJSDocUnknownType(pos) {
|
|
|
4454
4460
|
function deserializeCommentKind(pos) {
|
|
4455
4461
|
switch (uint8[pos]) {
|
|
4456
4462
|
case 0:
|
|
4457
|
-
return
|
|
4463
|
+
return "Line";
|
|
4458
4464
|
case 1:
|
|
4459
|
-
return
|
|
4465
|
+
return "Block";
|
|
4460
4466
|
default:
|
|
4461
4467
|
throw Error(`Unexpected discriminant ${uint8[pos]} for CommentKind`);
|
|
4462
4468
|
}
|
|
@@ -4468,7 +4474,7 @@ function deserializeComment(pos) {
|
|
|
4468
4474
|
end = deserializeU32(pos + 4);
|
|
4469
4475
|
return {
|
|
4470
4476
|
type,
|
|
4471
|
-
value: sourceText.slice(start + 2, end - (type ===
|
|
4477
|
+
value: sourceText.slice(start + 2, end - (type === "Line" ? 0 : 2)),
|
|
4472
4478
|
start,
|
|
4473
4479
|
end,
|
|
4474
4480
|
};
|
|
@@ -4497,14 +4503,14 @@ function deserializeImportImportName(pos) {
|
|
|
4497
4503
|
case 0:
|
|
4498
4504
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4499
4505
|
return {
|
|
4500
|
-
kind:
|
|
4506
|
+
kind: "Name",
|
|
4501
4507
|
name: nameSpan.value,
|
|
4502
4508
|
start: nameSpan.start,
|
|
4503
4509
|
end: nameSpan.end,
|
|
4504
4510
|
};
|
|
4505
4511
|
case 1:
|
|
4506
4512
|
return {
|
|
4507
|
-
kind:
|
|
4513
|
+
kind: "NamespaceObject",
|
|
4508
4514
|
name: null,
|
|
4509
4515
|
start: null,
|
|
4510
4516
|
end: null,
|
|
@@ -4512,7 +4518,7 @@ function deserializeImportImportName(pos) {
|
|
|
4512
4518
|
case 2:
|
|
4513
4519
|
var { start, end } = deserializeSpan(pos + 8);
|
|
4514
4520
|
return {
|
|
4515
|
-
kind:
|
|
4521
|
+
kind: "Default",
|
|
4516
4522
|
name: null,
|
|
4517
4523
|
start,
|
|
4518
4524
|
end,
|
|
@@ -4541,28 +4547,28 @@ function deserializeExportImportName(pos) {
|
|
|
4541
4547
|
case 0:
|
|
4542
4548
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4543
4549
|
return {
|
|
4544
|
-
kind:
|
|
4550
|
+
kind: "Name",
|
|
4545
4551
|
name: nameSpan.value,
|
|
4546
4552
|
start: nameSpan.start,
|
|
4547
4553
|
end: nameSpan.end,
|
|
4548
4554
|
};
|
|
4549
4555
|
case 1:
|
|
4550
4556
|
return {
|
|
4551
|
-
kind:
|
|
4557
|
+
kind: "All",
|
|
4552
4558
|
name: null,
|
|
4553
4559
|
start: null,
|
|
4554
4560
|
end: null,
|
|
4555
4561
|
};
|
|
4556
4562
|
case 2:
|
|
4557
4563
|
return {
|
|
4558
|
-
kind:
|
|
4564
|
+
kind: "AllButDefault",
|
|
4559
4565
|
name: null,
|
|
4560
4566
|
start: null,
|
|
4561
4567
|
end: null,
|
|
4562
4568
|
};
|
|
4563
4569
|
case 3:
|
|
4564
4570
|
return {
|
|
4565
|
-
kind:
|
|
4571
|
+
kind: "None",
|
|
4566
4572
|
name: null,
|
|
4567
4573
|
start: null,
|
|
4568
4574
|
end: null,
|
|
@@ -4577,7 +4583,7 @@ function deserializeExportExportName(pos) {
|
|
|
4577
4583
|
case 0:
|
|
4578
4584
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4579
4585
|
return {
|
|
4580
|
-
kind:
|
|
4586
|
+
kind: "Name",
|
|
4581
4587
|
name: nameSpan.value,
|
|
4582
4588
|
start: nameSpan.start,
|
|
4583
4589
|
end: nameSpan.end,
|
|
@@ -4585,14 +4591,14 @@ function deserializeExportExportName(pos) {
|
|
|
4585
4591
|
case 1:
|
|
4586
4592
|
var { start, end } = deserializeSpan(pos + 8);
|
|
4587
4593
|
return {
|
|
4588
|
-
kind:
|
|
4594
|
+
kind: "Default",
|
|
4589
4595
|
name: null,
|
|
4590
4596
|
start,
|
|
4591
4597
|
end,
|
|
4592
4598
|
};
|
|
4593
4599
|
case 2:
|
|
4594
4600
|
return {
|
|
4595
|
-
kind:
|
|
4601
|
+
kind: "None",
|
|
4596
4602
|
name: null,
|
|
4597
4603
|
start: null,
|
|
4598
4604
|
end: null,
|
|
@@ -4607,7 +4613,7 @@ function deserializeExportLocalName(pos) {
|
|
|
4607
4613
|
case 0:
|
|
4608
4614
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4609
4615
|
return {
|
|
4610
|
-
kind:
|
|
4616
|
+
kind: "Name",
|
|
4611
4617
|
name: nameSpan.value,
|
|
4612
4618
|
start: nameSpan.start,
|
|
4613
4619
|
end: nameSpan.end,
|
|
@@ -4615,14 +4621,14 @@ function deserializeExportLocalName(pos) {
|
|
|
4615
4621
|
case 1:
|
|
4616
4622
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4617
4623
|
return {
|
|
4618
|
-
kind:
|
|
4624
|
+
kind: "Default",
|
|
4619
4625
|
name: nameSpan.value,
|
|
4620
4626
|
start: nameSpan.start,
|
|
4621
4627
|
end: nameSpan.end,
|
|
4622
4628
|
};
|
|
4623
4629
|
case 2:
|
|
4624
4630
|
return {
|
|
4625
|
-
kind:
|
|
4631
|
+
kind: "None",
|
|
4626
4632
|
name: null,
|
|
4627
4633
|
start: null,
|
|
4628
4634
|
end: null,
|
|
@@ -4645,37 +4651,37 @@ function deserializeDynamicImport(pos) {
|
|
|
4645
4651
|
function deserializeAssignmentOperator(pos) {
|
|
4646
4652
|
switch (uint8[pos]) {
|
|
4647
4653
|
case 0:
|
|
4648
|
-
return
|
|
4654
|
+
return "=";
|
|
4649
4655
|
case 1:
|
|
4650
|
-
return
|
|
4656
|
+
return "+=";
|
|
4651
4657
|
case 2:
|
|
4652
|
-
return
|
|
4658
|
+
return "-=";
|
|
4653
4659
|
case 3:
|
|
4654
|
-
return
|
|
4660
|
+
return "*=";
|
|
4655
4661
|
case 4:
|
|
4656
|
-
return
|
|
4662
|
+
return "/=";
|
|
4657
4663
|
case 5:
|
|
4658
|
-
return
|
|
4664
|
+
return "%=";
|
|
4659
4665
|
case 6:
|
|
4660
|
-
return
|
|
4666
|
+
return "**=";
|
|
4661
4667
|
case 7:
|
|
4662
|
-
return
|
|
4668
|
+
return "<<=";
|
|
4663
4669
|
case 8:
|
|
4664
|
-
return
|
|
4670
|
+
return ">>=";
|
|
4665
4671
|
case 9:
|
|
4666
|
-
return
|
|
4672
|
+
return ">>>=";
|
|
4667
4673
|
case 10:
|
|
4668
|
-
return
|
|
4674
|
+
return "|=";
|
|
4669
4675
|
case 11:
|
|
4670
|
-
return
|
|
4676
|
+
return "^=";
|
|
4671
4677
|
case 12:
|
|
4672
|
-
return
|
|
4678
|
+
return "&=";
|
|
4673
4679
|
case 13:
|
|
4674
|
-
return
|
|
4680
|
+
return "||=";
|
|
4675
4681
|
case 14:
|
|
4676
|
-
return
|
|
4682
|
+
return "&&=";
|
|
4677
4683
|
case 15:
|
|
4678
|
-
return
|
|
4684
|
+
return "??=";
|
|
4679
4685
|
default:
|
|
4680
4686
|
throw Error(`Unexpected discriminant ${uint8[pos]} for AssignmentOperator`);
|
|
4681
4687
|
}
|
|
@@ -4684,49 +4690,49 @@ function deserializeAssignmentOperator(pos) {
|
|
|
4684
4690
|
function deserializeBinaryOperator(pos) {
|
|
4685
4691
|
switch (uint8[pos]) {
|
|
4686
4692
|
case 0:
|
|
4687
|
-
return
|
|
4693
|
+
return "==";
|
|
4688
4694
|
case 1:
|
|
4689
|
-
return
|
|
4695
|
+
return "!=";
|
|
4690
4696
|
case 2:
|
|
4691
|
-
return
|
|
4697
|
+
return "===";
|
|
4692
4698
|
case 3:
|
|
4693
|
-
return
|
|
4699
|
+
return "!==";
|
|
4694
4700
|
case 4:
|
|
4695
|
-
return
|
|
4701
|
+
return "<";
|
|
4696
4702
|
case 5:
|
|
4697
|
-
return
|
|
4703
|
+
return "<=";
|
|
4698
4704
|
case 6:
|
|
4699
|
-
return
|
|
4705
|
+
return ">";
|
|
4700
4706
|
case 7:
|
|
4701
|
-
return
|
|
4707
|
+
return ">=";
|
|
4702
4708
|
case 8:
|
|
4703
|
-
return
|
|
4709
|
+
return "+";
|
|
4704
4710
|
case 9:
|
|
4705
|
-
return
|
|
4711
|
+
return "-";
|
|
4706
4712
|
case 10:
|
|
4707
|
-
return
|
|
4713
|
+
return "*";
|
|
4708
4714
|
case 11:
|
|
4709
|
-
return
|
|
4715
|
+
return "/";
|
|
4710
4716
|
case 12:
|
|
4711
|
-
return
|
|
4717
|
+
return "%";
|
|
4712
4718
|
case 13:
|
|
4713
|
-
return
|
|
4719
|
+
return "**";
|
|
4714
4720
|
case 14:
|
|
4715
|
-
return
|
|
4721
|
+
return "<<";
|
|
4716
4722
|
case 15:
|
|
4717
|
-
return
|
|
4723
|
+
return ">>";
|
|
4718
4724
|
case 16:
|
|
4719
|
-
return
|
|
4725
|
+
return ">>>";
|
|
4720
4726
|
case 17:
|
|
4721
|
-
return
|
|
4727
|
+
return "|";
|
|
4722
4728
|
case 18:
|
|
4723
|
-
return
|
|
4729
|
+
return "^";
|
|
4724
4730
|
case 19:
|
|
4725
|
-
return
|
|
4731
|
+
return "&";
|
|
4726
4732
|
case 20:
|
|
4727
|
-
return
|
|
4733
|
+
return "in";
|
|
4728
4734
|
case 21:
|
|
4729
|
-
return
|
|
4735
|
+
return "instanceof";
|
|
4730
4736
|
default:
|
|
4731
4737
|
throw Error(`Unexpected discriminant ${uint8[pos]} for BinaryOperator`);
|
|
4732
4738
|
}
|
|
@@ -4735,11 +4741,11 @@ function deserializeBinaryOperator(pos) {
|
|
|
4735
4741
|
function deserializeLogicalOperator(pos) {
|
|
4736
4742
|
switch (uint8[pos]) {
|
|
4737
4743
|
case 0:
|
|
4738
|
-
return
|
|
4744
|
+
return "||";
|
|
4739
4745
|
case 1:
|
|
4740
|
-
return
|
|
4746
|
+
return "&&";
|
|
4741
4747
|
case 2:
|
|
4742
|
-
return
|
|
4748
|
+
return "??";
|
|
4743
4749
|
default:
|
|
4744
4750
|
throw Error(`Unexpected discriminant ${uint8[pos]} for LogicalOperator`);
|
|
4745
4751
|
}
|
|
@@ -4748,19 +4754,19 @@ function deserializeLogicalOperator(pos) {
|
|
|
4748
4754
|
function deserializeUnaryOperator(pos) {
|
|
4749
4755
|
switch (uint8[pos]) {
|
|
4750
4756
|
case 0:
|
|
4751
|
-
return
|
|
4757
|
+
return "+";
|
|
4752
4758
|
case 1:
|
|
4753
|
-
return
|
|
4759
|
+
return "-";
|
|
4754
4760
|
case 2:
|
|
4755
|
-
return
|
|
4761
|
+
return "!";
|
|
4756
4762
|
case 3:
|
|
4757
|
-
return
|
|
4763
|
+
return "~";
|
|
4758
4764
|
case 4:
|
|
4759
|
-
return
|
|
4765
|
+
return "typeof";
|
|
4760
4766
|
case 5:
|
|
4761
|
-
return
|
|
4767
|
+
return "void";
|
|
4762
4768
|
case 6:
|
|
4763
|
-
return
|
|
4769
|
+
return "delete";
|
|
4764
4770
|
default:
|
|
4765
4771
|
throw Error(`Unexpected discriminant ${uint8[pos]} for UnaryOperator`);
|
|
4766
4772
|
}
|
|
@@ -4769,9 +4775,9 @@ function deserializeUnaryOperator(pos) {
|
|
|
4769
4775
|
function deserializeUpdateOperator(pos) {
|
|
4770
4776
|
switch (uint8[pos]) {
|
|
4771
4777
|
case 0:
|
|
4772
|
-
return
|
|
4778
|
+
return "++";
|
|
4773
4779
|
case 1:
|
|
4774
|
-
return
|
|
4780
|
+
return "--";
|
|
4775
4781
|
default:
|
|
4776
4782
|
throw Error(`Unexpected discriminant ${uint8[pos]} for UpdateOperator`);
|
|
4777
4783
|
}
|
|
@@ -4787,9 +4793,9 @@ function deserializeSpan(pos) {
|
|
|
4787
4793
|
function deserializeModuleKind(pos) {
|
|
4788
4794
|
switch (uint8[pos]) {
|
|
4789
4795
|
case 0:
|
|
4790
|
-
return
|
|
4796
|
+
return "script";
|
|
4791
4797
|
case 1:
|
|
4792
|
-
return
|
|
4798
|
+
return "module";
|
|
4793
4799
|
default:
|
|
4794
4800
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ModuleKind`);
|
|
4795
4801
|
}
|
|
@@ -4817,11 +4823,11 @@ function deserializeError(pos) {
|
|
|
4817
4823
|
function deserializeErrorSeverity(pos) {
|
|
4818
4824
|
switch (uint8[pos]) {
|
|
4819
4825
|
case 0:
|
|
4820
|
-
return
|
|
4826
|
+
return "Error";
|
|
4821
4827
|
case 1:
|
|
4822
|
-
return
|
|
4828
|
+
return "Warning";
|
|
4823
4829
|
case 2:
|
|
4824
|
-
return
|
|
4830
|
+
return "Advice";
|
|
4825
4831
|
default:
|
|
4826
4832
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ErrorSeverity`);
|
|
4827
4833
|
}
|
|
@@ -4879,7 +4885,7 @@ function deserializeU8(pos) {
|
|
|
4879
4885
|
function deserializeStr(pos) {
|
|
4880
4886
|
let pos32 = pos >> 2,
|
|
4881
4887
|
len = uint32[pos32 + 2];
|
|
4882
|
-
if (len === 0) return
|
|
4888
|
+
if (len === 0) return "";
|
|
4883
4889
|
pos = uint32[pos32];
|
|
4884
4890
|
if (sourceIsAscii && pos < sourceByteLen) return sourceText.substr(pos, len);
|
|
4885
4891
|
// Longer strings use `TextDecoder`
|
|
@@ -4887,7 +4893,7 @@ function deserializeStr(pos) {
|
|
|
4887
4893
|
let end = pos + len;
|
|
4888
4894
|
if (len > 50) return decodeStr(uint8.subarray(pos, end));
|
|
4889
4895
|
// Shorter strings decode by hand to avoid native call
|
|
4890
|
-
let out =
|
|
4896
|
+
let out = "",
|
|
4891
4897
|
c;
|
|
4892
4898
|
do {
|
|
4893
4899
|
c = uint8[pos++];
|