oxc-parser 0.99.0 → 0.101.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 +3 -3
- package/src-js/index.js +9 -9
- package/src-js/raw-transfer/common.js +12 -8
- package/src-js/raw-transfer/eager.js +18 -12
- package/src-js/raw-transfer/lazy-common.js +1 -1
- package/src-js/raw-transfer/lazy.js +10 -8
- 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 +6 -6
|
@@ -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
|
|
|
@@ -32,7 +32,7 @@ function deserializeProgram(pos) {
|
|
|
32
32
|
let start = deserializeU32(pos),
|
|
33
33
|
end = deserializeU32(pos + 4),
|
|
34
34
|
program = {
|
|
35
|
-
type:
|
|
35
|
+
type: "Program",
|
|
36
36
|
body: null,
|
|
37
37
|
sourceType: deserializeModuleKind(pos + 125),
|
|
38
38
|
hashbang: null,
|
|
@@ -142,7 +142,7 @@ function deserializeIdentifierName(pos) {
|
|
|
142
142
|
let start = deserializeU32(pos),
|
|
143
143
|
end = deserializeU32(pos + 4);
|
|
144
144
|
return {
|
|
145
|
-
type:
|
|
145
|
+
type: "Identifier",
|
|
146
146
|
name: deserializeStr(pos + 8),
|
|
147
147
|
start,
|
|
148
148
|
end,
|
|
@@ -154,7 +154,7 @@ function deserializeIdentifierReference(pos) {
|
|
|
154
154
|
let start = deserializeU32(pos),
|
|
155
155
|
end = deserializeU32(pos + 4);
|
|
156
156
|
return {
|
|
157
|
-
type:
|
|
157
|
+
type: "Identifier",
|
|
158
158
|
name: deserializeStr(pos + 8),
|
|
159
159
|
start,
|
|
160
160
|
end,
|
|
@@ -166,7 +166,7 @@ function deserializeBindingIdentifier(pos) {
|
|
|
166
166
|
let start = deserializeU32(pos),
|
|
167
167
|
end = deserializeU32(pos + 4);
|
|
168
168
|
return {
|
|
169
|
-
type:
|
|
169
|
+
type: "Identifier",
|
|
170
170
|
name: deserializeStr(pos + 8),
|
|
171
171
|
start,
|
|
172
172
|
end,
|
|
@@ -178,7 +178,7 @@ function deserializeLabelIdentifier(pos) {
|
|
|
178
178
|
let start = deserializeU32(pos),
|
|
179
179
|
end = deserializeU32(pos + 4);
|
|
180
180
|
return {
|
|
181
|
-
type:
|
|
181
|
+
type: "Identifier",
|
|
182
182
|
name: deserializeStr(pos + 8),
|
|
183
183
|
start,
|
|
184
184
|
end,
|
|
@@ -190,7 +190,7 @@ function deserializeThisExpression(pos) {
|
|
|
190
190
|
let start = deserializeU32(pos),
|
|
191
191
|
end = deserializeU32(pos + 4);
|
|
192
192
|
return {
|
|
193
|
-
type:
|
|
193
|
+
type: "ThisExpression",
|
|
194
194
|
start,
|
|
195
195
|
end,
|
|
196
196
|
range: [start, end],
|
|
@@ -201,7 +201,7 @@ function deserializeArrayExpression(pos) {
|
|
|
201
201
|
let start = deserializeU32(pos),
|
|
202
202
|
end = deserializeU32(pos + 4),
|
|
203
203
|
node = {
|
|
204
|
-
type:
|
|
204
|
+
type: "ArrayExpression",
|
|
205
205
|
elements: null,
|
|
206
206
|
start,
|
|
207
207
|
end,
|
|
@@ -316,7 +316,7 @@ function deserializeObjectExpression(pos) {
|
|
|
316
316
|
let start = deserializeU32(pos),
|
|
317
317
|
end = deserializeU32(pos + 4),
|
|
318
318
|
node = {
|
|
319
|
-
type:
|
|
319
|
+
type: "ObjectExpression",
|
|
320
320
|
properties: null,
|
|
321
321
|
start,
|
|
322
322
|
end,
|
|
@@ -341,7 +341,7 @@ function deserializeObjectProperty(pos) {
|
|
|
341
341
|
let start = deserializeU32(pos),
|
|
342
342
|
end = deserializeU32(pos + 4),
|
|
343
343
|
node = {
|
|
344
|
-
type:
|
|
344
|
+
type: "Property",
|
|
345
345
|
kind: deserializePropertyKind(pos + 40),
|
|
346
346
|
key: null,
|
|
347
347
|
value: null,
|
|
@@ -457,11 +457,11 @@ function deserializePropertyKey(pos) {
|
|
|
457
457
|
function deserializePropertyKind(pos) {
|
|
458
458
|
switch (uint8[pos]) {
|
|
459
459
|
case 0:
|
|
460
|
-
return
|
|
460
|
+
return "init";
|
|
461
461
|
case 1:
|
|
462
|
-
return
|
|
462
|
+
return "get";
|
|
463
463
|
case 2:
|
|
464
|
-
return
|
|
464
|
+
return "set";
|
|
465
465
|
default:
|
|
466
466
|
throw Error(`Unexpected discriminant ${uint8[pos]} for PropertyKind`);
|
|
467
467
|
}
|
|
@@ -471,7 +471,7 @@ function deserializeTemplateLiteral(pos) {
|
|
|
471
471
|
let start = deserializeU32(pos),
|
|
472
472
|
end = deserializeU32(pos + 4),
|
|
473
473
|
node = {
|
|
474
|
-
type:
|
|
474
|
+
type: "TemplateLiteral",
|
|
475
475
|
quasis: null,
|
|
476
476
|
expressions: null,
|
|
477
477
|
start,
|
|
@@ -487,7 +487,7 @@ function deserializeTaggedTemplateExpression(pos) {
|
|
|
487
487
|
let start = deserializeU32(pos),
|
|
488
488
|
end = deserializeU32(pos + 4),
|
|
489
489
|
node = {
|
|
490
|
-
type:
|
|
490
|
+
type: "TaggedTemplateExpression",
|
|
491
491
|
tag: null,
|
|
492
492
|
quasi: null,
|
|
493
493
|
start,
|
|
@@ -506,9 +506,11 @@ function deserializeTemplateElement(pos) {
|
|
|
506
506
|
value = deserializeTemplateElementValue(pos + 8);
|
|
507
507
|
value.cooked !== null &&
|
|
508
508
|
deserializeBool(pos + 41) &&
|
|
509
|
-
(value.cooked = value.cooked.replace(/\uFFFD(.{4})/g, (_, hex) =>
|
|
509
|
+
(value.cooked = value.cooked.replace(/\uFFFD(.{4})/g, (_, hex) =>
|
|
510
|
+
String.fromCodePoint(parseInt(hex, 16)),
|
|
511
|
+
));
|
|
510
512
|
return {
|
|
511
|
-
type:
|
|
513
|
+
type: "TemplateElement",
|
|
512
514
|
value,
|
|
513
515
|
tail,
|
|
514
516
|
start,
|
|
@@ -528,7 +530,7 @@ function deserializeComputedMemberExpression(pos) {
|
|
|
528
530
|
let start = deserializeU32(pos),
|
|
529
531
|
end = deserializeU32(pos + 4),
|
|
530
532
|
node = {
|
|
531
|
-
type:
|
|
533
|
+
type: "MemberExpression",
|
|
532
534
|
object: null,
|
|
533
535
|
property: null,
|
|
534
536
|
optional: deserializeBool(pos + 40),
|
|
@@ -547,7 +549,7 @@ function deserializeStaticMemberExpression(pos) {
|
|
|
547
549
|
let start = deserializeU32(pos),
|
|
548
550
|
end = deserializeU32(pos + 4),
|
|
549
551
|
node = {
|
|
550
|
-
type:
|
|
552
|
+
type: "MemberExpression",
|
|
551
553
|
object: null,
|
|
552
554
|
property: null,
|
|
553
555
|
optional: deserializeBool(pos + 48),
|
|
@@ -566,7 +568,7 @@ function deserializePrivateFieldExpression(pos) {
|
|
|
566
568
|
let start = deserializeU32(pos),
|
|
567
569
|
end = deserializeU32(pos + 4),
|
|
568
570
|
node = {
|
|
569
|
-
type:
|
|
571
|
+
type: "MemberExpression",
|
|
570
572
|
object: null,
|
|
571
573
|
property: null,
|
|
572
574
|
optional: deserializeBool(pos + 48),
|
|
@@ -585,7 +587,7 @@ function deserializeCallExpression(pos) {
|
|
|
585
587
|
let start = deserializeU32(pos),
|
|
586
588
|
end = deserializeU32(pos + 4),
|
|
587
589
|
node = {
|
|
588
|
-
type:
|
|
590
|
+
type: "CallExpression",
|
|
589
591
|
callee: null,
|
|
590
592
|
arguments: null,
|
|
591
593
|
optional: deserializeBool(pos + 56),
|
|
@@ -602,7 +604,7 @@ function deserializeNewExpression(pos) {
|
|
|
602
604
|
let start = deserializeU32(pos),
|
|
603
605
|
end = deserializeU32(pos + 4),
|
|
604
606
|
node = {
|
|
605
|
-
type:
|
|
607
|
+
type: "NewExpression",
|
|
606
608
|
callee: null,
|
|
607
609
|
arguments: null,
|
|
608
610
|
start,
|
|
@@ -618,7 +620,7 @@ function deserializeMetaProperty(pos) {
|
|
|
618
620
|
let start = deserializeU32(pos),
|
|
619
621
|
end = deserializeU32(pos + 4),
|
|
620
622
|
node = {
|
|
621
|
-
type:
|
|
623
|
+
type: "MetaProperty",
|
|
622
624
|
meta: null,
|
|
623
625
|
property: null,
|
|
624
626
|
start,
|
|
@@ -634,7 +636,7 @@ function deserializeSpreadElement(pos) {
|
|
|
634
636
|
let start = deserializeU32(pos),
|
|
635
637
|
end = deserializeU32(pos + 4),
|
|
636
638
|
node = {
|
|
637
|
-
type:
|
|
639
|
+
type: "SpreadElement",
|
|
638
640
|
argument: null,
|
|
639
641
|
start,
|
|
640
642
|
end,
|
|
@@ -743,7 +745,7 @@ function deserializeUpdateExpression(pos) {
|
|
|
743
745
|
let start = deserializeU32(pos),
|
|
744
746
|
end = deserializeU32(pos + 4),
|
|
745
747
|
node = {
|
|
746
|
-
type:
|
|
748
|
+
type: "UpdateExpression",
|
|
747
749
|
operator: deserializeUpdateOperator(pos + 24),
|
|
748
750
|
prefix: deserializeBool(pos + 25),
|
|
749
751
|
argument: null,
|
|
@@ -759,7 +761,7 @@ function deserializeUnaryExpression(pos) {
|
|
|
759
761
|
let start = deserializeU32(pos),
|
|
760
762
|
end = deserializeU32(pos + 4),
|
|
761
763
|
node = {
|
|
762
|
-
type:
|
|
764
|
+
type: "UnaryExpression",
|
|
763
765
|
operator: deserializeUnaryOperator(pos + 24),
|
|
764
766
|
argument: null,
|
|
765
767
|
prefix: null,
|
|
@@ -776,7 +778,7 @@ function deserializeBinaryExpression(pos) {
|
|
|
776
778
|
let start = deserializeU32(pos),
|
|
777
779
|
end = deserializeU32(pos + 4),
|
|
778
780
|
node = {
|
|
779
|
-
type:
|
|
781
|
+
type: "BinaryExpression",
|
|
780
782
|
left: null,
|
|
781
783
|
operator: deserializeBinaryOperator(pos + 40),
|
|
782
784
|
right: null,
|
|
@@ -793,7 +795,7 @@ function deserializePrivateInExpression(pos) {
|
|
|
793
795
|
let start = deserializeU32(pos),
|
|
794
796
|
end = deserializeU32(pos + 4),
|
|
795
797
|
node = {
|
|
796
|
-
type:
|
|
798
|
+
type: "BinaryExpression",
|
|
797
799
|
left: null,
|
|
798
800
|
operator: null,
|
|
799
801
|
right: null,
|
|
@@ -802,7 +804,7 @@ function deserializePrivateInExpression(pos) {
|
|
|
802
804
|
range: [start, end],
|
|
803
805
|
};
|
|
804
806
|
node.left = deserializePrivateIdentifier(pos + 8);
|
|
805
|
-
node.operator =
|
|
807
|
+
node.operator = "in";
|
|
806
808
|
node.right = deserializeExpression(pos + 32);
|
|
807
809
|
return node;
|
|
808
810
|
}
|
|
@@ -811,7 +813,7 @@ function deserializeLogicalExpression(pos) {
|
|
|
811
813
|
let start = deserializeU32(pos),
|
|
812
814
|
end = deserializeU32(pos + 4),
|
|
813
815
|
node = {
|
|
814
|
-
type:
|
|
816
|
+
type: "LogicalExpression",
|
|
815
817
|
left: null,
|
|
816
818
|
operator: deserializeLogicalOperator(pos + 40),
|
|
817
819
|
right: null,
|
|
@@ -828,7 +830,7 @@ function deserializeConditionalExpression(pos) {
|
|
|
828
830
|
let start = deserializeU32(pos),
|
|
829
831
|
end = deserializeU32(pos + 4),
|
|
830
832
|
node = {
|
|
831
|
-
type:
|
|
833
|
+
type: "ConditionalExpression",
|
|
832
834
|
test: null,
|
|
833
835
|
consequent: null,
|
|
834
836
|
alternate: null,
|
|
@@ -846,7 +848,7 @@ function deserializeAssignmentExpression(pos) {
|
|
|
846
848
|
let start = deserializeU32(pos),
|
|
847
849
|
end = deserializeU32(pos + 4),
|
|
848
850
|
node = {
|
|
849
|
-
type:
|
|
851
|
+
type: "AssignmentExpression",
|
|
850
852
|
operator: deserializeAssignmentOperator(pos + 40),
|
|
851
853
|
left: null,
|
|
852
854
|
right: null,
|
|
@@ -913,7 +915,7 @@ function deserializeArrayAssignmentTarget(pos) {
|
|
|
913
915
|
let start = deserializeU32(pos),
|
|
914
916
|
end = deserializeU32(pos + 4),
|
|
915
917
|
node = {
|
|
916
|
-
type:
|
|
918
|
+
type: "ArrayPattern",
|
|
917
919
|
elements: null,
|
|
918
920
|
start,
|
|
919
921
|
end,
|
|
@@ -930,7 +932,7 @@ function deserializeObjectAssignmentTarget(pos) {
|
|
|
930
932
|
let start = deserializeU32(pos),
|
|
931
933
|
end = deserializeU32(pos + 4),
|
|
932
934
|
node = {
|
|
933
|
-
type:
|
|
935
|
+
type: "ObjectPattern",
|
|
934
936
|
properties: null,
|
|
935
937
|
start,
|
|
936
938
|
end,
|
|
@@ -947,7 +949,7 @@ function deserializeAssignmentTargetRest(pos) {
|
|
|
947
949
|
let start = deserializeU32(pos),
|
|
948
950
|
end = deserializeU32(pos + 4),
|
|
949
951
|
node = {
|
|
950
|
-
type:
|
|
952
|
+
type: "RestElement",
|
|
951
953
|
argument: null,
|
|
952
954
|
start,
|
|
953
955
|
end,
|
|
@@ -990,7 +992,7 @@ function deserializeAssignmentTargetWithDefault(pos) {
|
|
|
990
992
|
let start = deserializeU32(pos),
|
|
991
993
|
end = deserializeU32(pos + 4),
|
|
992
994
|
node = {
|
|
993
|
-
type:
|
|
995
|
+
type: "AssignmentPattern",
|
|
994
996
|
left: null,
|
|
995
997
|
right: null,
|
|
996
998
|
start,
|
|
@@ -1017,7 +1019,7 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
1017
1019
|
let start = deserializeU32(pos),
|
|
1018
1020
|
end = deserializeU32(pos + 4),
|
|
1019
1021
|
node = {
|
|
1020
|
-
type:
|
|
1022
|
+
type: "Property",
|
|
1021
1023
|
kind: null,
|
|
1022
1024
|
key: null,
|
|
1023
1025
|
value: null,
|
|
@@ -1032,7 +1034,7 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
1032
1034
|
keyStart,
|
|
1033
1035
|
keyEnd,
|
|
1034
1036
|
value = {
|
|
1035
|
-
type:
|
|
1037
|
+
type: "Identifier",
|
|
1036
1038
|
name: key.name,
|
|
1037
1039
|
start: (keyStart = key.start),
|
|
1038
1040
|
end: (keyEnd = key.end),
|
|
@@ -1041,14 +1043,14 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
1041
1043
|
init = deserializeOptionExpression(pos + 40);
|
|
1042
1044
|
init !== null &&
|
|
1043
1045
|
(value = {
|
|
1044
|
-
type:
|
|
1046
|
+
type: "AssignmentPattern",
|
|
1045
1047
|
left: value,
|
|
1046
1048
|
right: init,
|
|
1047
1049
|
start,
|
|
1048
1050
|
end,
|
|
1049
1051
|
range: [start, end],
|
|
1050
1052
|
});
|
|
1051
|
-
node.kind =
|
|
1053
|
+
node.kind = "init";
|
|
1052
1054
|
node.key = key;
|
|
1053
1055
|
node.value = value;
|
|
1054
1056
|
node.method = false;
|
|
@@ -1061,7 +1063,7 @@ function deserializeAssignmentTargetPropertyProperty(pos) {
|
|
|
1061
1063
|
let start = deserializeU32(pos),
|
|
1062
1064
|
end = deserializeU32(pos + 4),
|
|
1063
1065
|
node = {
|
|
1064
|
-
type:
|
|
1066
|
+
type: "Property",
|
|
1065
1067
|
kind: null,
|
|
1066
1068
|
key: null,
|
|
1067
1069
|
value: null,
|
|
@@ -1072,7 +1074,7 @@ function deserializeAssignmentTargetPropertyProperty(pos) {
|
|
|
1072
1074
|
end,
|
|
1073
1075
|
range: [start, end],
|
|
1074
1076
|
};
|
|
1075
|
-
node.kind =
|
|
1077
|
+
node.kind = "init";
|
|
1076
1078
|
node.key = deserializePropertyKey(pos + 8);
|
|
1077
1079
|
node.value = deserializeAssignmentTargetMaybeDefault(pos + 24);
|
|
1078
1080
|
node.method = false;
|
|
@@ -1084,7 +1086,7 @@ function deserializeSequenceExpression(pos) {
|
|
|
1084
1086
|
let start = deserializeU32(pos),
|
|
1085
1087
|
end = deserializeU32(pos + 4),
|
|
1086
1088
|
node = {
|
|
1087
|
-
type:
|
|
1089
|
+
type: "SequenceExpression",
|
|
1088
1090
|
expressions: null,
|
|
1089
1091
|
start,
|
|
1090
1092
|
end,
|
|
@@ -1098,7 +1100,7 @@ function deserializeSuper(pos) {
|
|
|
1098
1100
|
let start = deserializeU32(pos),
|
|
1099
1101
|
end = deserializeU32(pos + 4);
|
|
1100
1102
|
return {
|
|
1101
|
-
type:
|
|
1103
|
+
type: "Super",
|
|
1102
1104
|
start,
|
|
1103
1105
|
end,
|
|
1104
1106
|
range: [start, end],
|
|
@@ -1109,7 +1111,7 @@ function deserializeAwaitExpression(pos) {
|
|
|
1109
1111
|
let start = deserializeU32(pos),
|
|
1110
1112
|
end = deserializeU32(pos + 4),
|
|
1111
1113
|
node = {
|
|
1112
|
-
type:
|
|
1114
|
+
type: "AwaitExpression",
|
|
1113
1115
|
argument: null,
|
|
1114
1116
|
start,
|
|
1115
1117
|
end,
|
|
@@ -1123,7 +1125,7 @@ function deserializeChainExpression(pos) {
|
|
|
1123
1125
|
let start = deserializeU32(pos),
|
|
1124
1126
|
end = deserializeU32(pos + 4),
|
|
1125
1127
|
node = {
|
|
1126
|
-
type:
|
|
1128
|
+
type: "ChainExpression",
|
|
1127
1129
|
expression: null,
|
|
1128
1130
|
start,
|
|
1129
1131
|
end,
|
|
@@ -1155,7 +1157,7 @@ function deserializeParenthesizedExpression(pos) {
|
|
|
1155
1157
|
{
|
|
1156
1158
|
let start, end;
|
|
1157
1159
|
node = {
|
|
1158
|
-
type:
|
|
1160
|
+
type: "ParenthesizedExpression",
|
|
1159
1161
|
expression: null,
|
|
1160
1162
|
start: (start = deserializeU32(pos)),
|
|
1161
1163
|
end: (end = deserializeU32(pos + 4)),
|
|
@@ -1243,7 +1245,7 @@ function deserializeDirective(pos) {
|
|
|
1243
1245
|
let start = deserializeU32(pos),
|
|
1244
1246
|
end = deserializeU32(pos + 4),
|
|
1245
1247
|
node = {
|
|
1246
|
-
type:
|
|
1248
|
+
type: "ExpressionStatement",
|
|
1247
1249
|
expression: null,
|
|
1248
1250
|
directive: deserializeStr(pos + 56),
|
|
1249
1251
|
start,
|
|
@@ -1258,7 +1260,7 @@ function deserializeHashbang(pos) {
|
|
|
1258
1260
|
let start = deserializeU32(pos),
|
|
1259
1261
|
end = deserializeU32(pos + 4);
|
|
1260
1262
|
return {
|
|
1261
|
-
type:
|
|
1263
|
+
type: "Hashbang",
|
|
1262
1264
|
value: deserializeStr(pos + 8),
|
|
1263
1265
|
start,
|
|
1264
1266
|
end,
|
|
@@ -1270,7 +1272,7 @@ function deserializeBlockStatement(pos) {
|
|
|
1270
1272
|
let start = deserializeU32(pos),
|
|
1271
1273
|
end = deserializeU32(pos + 4),
|
|
1272
1274
|
node = {
|
|
1273
|
-
type:
|
|
1275
|
+
type: "BlockStatement",
|
|
1274
1276
|
body: null,
|
|
1275
1277
|
start,
|
|
1276
1278
|
end,
|
|
@@ -1309,7 +1311,7 @@ function deserializeVariableDeclaration(pos) {
|
|
|
1309
1311
|
let start = deserializeU32(pos),
|
|
1310
1312
|
end = deserializeU32(pos + 4),
|
|
1311
1313
|
node = {
|
|
1312
|
-
type:
|
|
1314
|
+
type: "VariableDeclaration",
|
|
1313
1315
|
kind: deserializeVariableDeclarationKind(pos + 32),
|
|
1314
1316
|
declarations: null,
|
|
1315
1317
|
start,
|
|
@@ -1323,15 +1325,15 @@ function deserializeVariableDeclaration(pos) {
|
|
|
1323
1325
|
function deserializeVariableDeclarationKind(pos) {
|
|
1324
1326
|
switch (uint8[pos]) {
|
|
1325
1327
|
case 0:
|
|
1326
|
-
return
|
|
1328
|
+
return "var";
|
|
1327
1329
|
case 1:
|
|
1328
|
-
return
|
|
1330
|
+
return "let";
|
|
1329
1331
|
case 2:
|
|
1330
|
-
return
|
|
1332
|
+
return "const";
|
|
1331
1333
|
case 3:
|
|
1332
|
-
return
|
|
1334
|
+
return "using";
|
|
1333
1335
|
case 4:
|
|
1334
|
-
return
|
|
1336
|
+
return "await using";
|
|
1335
1337
|
default:
|
|
1336
1338
|
throw Error(`Unexpected discriminant ${uint8[pos]} for VariableDeclarationKind`);
|
|
1337
1339
|
}
|
|
@@ -1341,7 +1343,7 @@ function deserializeVariableDeclarator(pos) {
|
|
|
1341
1343
|
let start = deserializeU32(pos),
|
|
1342
1344
|
end = deserializeU32(pos + 4),
|
|
1343
1345
|
node = {
|
|
1344
|
-
type:
|
|
1346
|
+
type: "VariableDeclarator",
|
|
1345
1347
|
id: null,
|
|
1346
1348
|
init: null,
|
|
1347
1349
|
start,
|
|
@@ -1357,7 +1359,7 @@ function deserializeEmptyStatement(pos) {
|
|
|
1357
1359
|
let start = deserializeU32(pos),
|
|
1358
1360
|
end = deserializeU32(pos + 4);
|
|
1359
1361
|
return {
|
|
1360
|
-
type:
|
|
1362
|
+
type: "EmptyStatement",
|
|
1361
1363
|
start,
|
|
1362
1364
|
end,
|
|
1363
1365
|
range: [start, end],
|
|
@@ -1368,7 +1370,7 @@ function deserializeExpressionStatement(pos) {
|
|
|
1368
1370
|
let start = deserializeU32(pos),
|
|
1369
1371
|
end = deserializeU32(pos + 4),
|
|
1370
1372
|
node = {
|
|
1371
|
-
type:
|
|
1373
|
+
type: "ExpressionStatement",
|
|
1372
1374
|
expression: null,
|
|
1373
1375
|
start,
|
|
1374
1376
|
end,
|
|
@@ -1382,7 +1384,7 @@ function deserializeIfStatement(pos) {
|
|
|
1382
1384
|
let start = deserializeU32(pos),
|
|
1383
1385
|
end = deserializeU32(pos + 4),
|
|
1384
1386
|
node = {
|
|
1385
|
-
type:
|
|
1387
|
+
type: "IfStatement",
|
|
1386
1388
|
test: null,
|
|
1387
1389
|
consequent: null,
|
|
1388
1390
|
alternate: null,
|
|
@@ -1400,7 +1402,7 @@ function deserializeDoWhileStatement(pos) {
|
|
|
1400
1402
|
let start = deserializeU32(pos),
|
|
1401
1403
|
end = deserializeU32(pos + 4),
|
|
1402
1404
|
node = {
|
|
1403
|
-
type:
|
|
1405
|
+
type: "DoWhileStatement",
|
|
1404
1406
|
body: null,
|
|
1405
1407
|
test: null,
|
|
1406
1408
|
start,
|
|
@@ -1416,7 +1418,7 @@ function deserializeWhileStatement(pos) {
|
|
|
1416
1418
|
let start = deserializeU32(pos),
|
|
1417
1419
|
end = deserializeU32(pos + 4),
|
|
1418
1420
|
node = {
|
|
1419
|
-
type:
|
|
1421
|
+
type: "WhileStatement",
|
|
1420
1422
|
test: null,
|
|
1421
1423
|
body: null,
|
|
1422
1424
|
start,
|
|
@@ -1432,7 +1434,7 @@ function deserializeForStatement(pos) {
|
|
|
1432
1434
|
let start = deserializeU32(pos),
|
|
1433
1435
|
end = deserializeU32(pos + 4),
|
|
1434
1436
|
node = {
|
|
1435
|
-
type:
|
|
1437
|
+
type: "ForStatement",
|
|
1436
1438
|
init: null,
|
|
1437
1439
|
test: null,
|
|
1438
1440
|
update: null,
|
|
@@ -1547,7 +1549,7 @@ function deserializeForInStatement(pos) {
|
|
|
1547
1549
|
let start = deserializeU32(pos),
|
|
1548
1550
|
end = deserializeU32(pos + 4),
|
|
1549
1551
|
node = {
|
|
1550
|
-
type:
|
|
1552
|
+
type: "ForInStatement",
|
|
1551
1553
|
left: null,
|
|
1552
1554
|
right: null,
|
|
1553
1555
|
body: null,
|
|
@@ -1594,7 +1596,7 @@ function deserializeForOfStatement(pos) {
|
|
|
1594
1596
|
let start = deserializeU32(pos),
|
|
1595
1597
|
end = deserializeU32(pos + 4),
|
|
1596
1598
|
node = {
|
|
1597
|
-
type:
|
|
1599
|
+
type: "ForOfStatement",
|
|
1598
1600
|
await: deserializeBool(pos + 60),
|
|
1599
1601
|
left: null,
|
|
1600
1602
|
right: null,
|
|
@@ -1613,7 +1615,7 @@ function deserializeContinueStatement(pos) {
|
|
|
1613
1615
|
let start = deserializeU32(pos),
|
|
1614
1616
|
end = deserializeU32(pos + 4),
|
|
1615
1617
|
node = {
|
|
1616
|
-
type:
|
|
1618
|
+
type: "ContinueStatement",
|
|
1617
1619
|
label: null,
|
|
1618
1620
|
start,
|
|
1619
1621
|
end,
|
|
@@ -1627,7 +1629,7 @@ function deserializeBreakStatement(pos) {
|
|
|
1627
1629
|
let start = deserializeU32(pos),
|
|
1628
1630
|
end = deserializeU32(pos + 4),
|
|
1629
1631
|
node = {
|
|
1630
|
-
type:
|
|
1632
|
+
type: "BreakStatement",
|
|
1631
1633
|
label: null,
|
|
1632
1634
|
start,
|
|
1633
1635
|
end,
|
|
@@ -1641,7 +1643,7 @@ function deserializeReturnStatement(pos) {
|
|
|
1641
1643
|
let start = deserializeU32(pos),
|
|
1642
1644
|
end = deserializeU32(pos + 4),
|
|
1643
1645
|
node = {
|
|
1644
|
-
type:
|
|
1646
|
+
type: "ReturnStatement",
|
|
1645
1647
|
argument: null,
|
|
1646
1648
|
start,
|
|
1647
1649
|
end,
|
|
@@ -1655,7 +1657,7 @@ function deserializeWithStatement(pos) {
|
|
|
1655
1657
|
let start = deserializeU32(pos),
|
|
1656
1658
|
end = deserializeU32(pos + 4),
|
|
1657
1659
|
node = {
|
|
1658
|
-
type:
|
|
1660
|
+
type: "WithStatement",
|
|
1659
1661
|
object: null,
|
|
1660
1662
|
body: null,
|
|
1661
1663
|
start,
|
|
@@ -1671,7 +1673,7 @@ function deserializeSwitchStatement(pos) {
|
|
|
1671
1673
|
let start = deserializeU32(pos),
|
|
1672
1674
|
end = deserializeU32(pos + 4),
|
|
1673
1675
|
node = {
|
|
1674
|
-
type:
|
|
1676
|
+
type: "SwitchStatement",
|
|
1675
1677
|
discriminant: null,
|
|
1676
1678
|
cases: null,
|
|
1677
1679
|
start,
|
|
@@ -1687,7 +1689,7 @@ function deserializeSwitchCase(pos) {
|
|
|
1687
1689
|
let start = deserializeU32(pos),
|
|
1688
1690
|
end = deserializeU32(pos + 4),
|
|
1689
1691
|
node = {
|
|
1690
|
-
type:
|
|
1692
|
+
type: "SwitchCase",
|
|
1691
1693
|
test: null,
|
|
1692
1694
|
consequent: null,
|
|
1693
1695
|
start,
|
|
@@ -1703,7 +1705,7 @@ function deserializeLabeledStatement(pos) {
|
|
|
1703
1705
|
let start = deserializeU32(pos),
|
|
1704
1706
|
end = deserializeU32(pos + 4),
|
|
1705
1707
|
node = {
|
|
1706
|
-
type:
|
|
1708
|
+
type: "LabeledStatement",
|
|
1707
1709
|
label: null,
|
|
1708
1710
|
body: null,
|
|
1709
1711
|
start,
|
|
@@ -1719,7 +1721,7 @@ function deserializeThrowStatement(pos) {
|
|
|
1719
1721
|
let start = deserializeU32(pos),
|
|
1720
1722
|
end = deserializeU32(pos + 4),
|
|
1721
1723
|
node = {
|
|
1722
|
-
type:
|
|
1724
|
+
type: "ThrowStatement",
|
|
1723
1725
|
argument: null,
|
|
1724
1726
|
start,
|
|
1725
1727
|
end,
|
|
@@ -1733,7 +1735,7 @@ function deserializeTryStatement(pos) {
|
|
|
1733
1735
|
let start = deserializeU32(pos),
|
|
1734
1736
|
end = deserializeU32(pos + 4),
|
|
1735
1737
|
node = {
|
|
1736
|
-
type:
|
|
1738
|
+
type: "TryStatement",
|
|
1737
1739
|
block: null,
|
|
1738
1740
|
handler: null,
|
|
1739
1741
|
finalizer: null,
|
|
@@ -1751,7 +1753,7 @@ function deserializeCatchClause(pos) {
|
|
|
1751
1753
|
let start = deserializeU32(pos),
|
|
1752
1754
|
end = deserializeU32(pos + 4),
|
|
1753
1755
|
node = {
|
|
1754
|
-
type:
|
|
1756
|
+
type: "CatchClause",
|
|
1755
1757
|
param: null,
|
|
1756
1758
|
body: null,
|
|
1757
1759
|
start,
|
|
@@ -1771,7 +1773,7 @@ function deserializeDebuggerStatement(pos) {
|
|
|
1771
1773
|
let start = deserializeU32(pos),
|
|
1772
1774
|
end = deserializeU32(pos + 4);
|
|
1773
1775
|
return {
|
|
1774
|
-
type:
|
|
1776
|
+
type: "DebuggerStatement",
|
|
1775
1777
|
start,
|
|
1776
1778
|
end,
|
|
1777
1779
|
range: [start, end],
|
|
@@ -1801,7 +1803,7 @@ function deserializeAssignmentPattern(pos) {
|
|
|
1801
1803
|
let start = deserializeU32(pos),
|
|
1802
1804
|
end = deserializeU32(pos + 4),
|
|
1803
1805
|
node = {
|
|
1804
|
-
type:
|
|
1806
|
+
type: "AssignmentPattern",
|
|
1805
1807
|
left: null,
|
|
1806
1808
|
right: null,
|
|
1807
1809
|
start,
|
|
@@ -1817,7 +1819,7 @@ function deserializeObjectPattern(pos) {
|
|
|
1817
1819
|
let start = deserializeU32(pos),
|
|
1818
1820
|
end = deserializeU32(pos + 4),
|
|
1819
1821
|
node = {
|
|
1820
|
-
type:
|
|
1822
|
+
type: "ObjectPattern",
|
|
1821
1823
|
properties: null,
|
|
1822
1824
|
start,
|
|
1823
1825
|
end,
|
|
@@ -1834,7 +1836,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1834
1836
|
let start = deserializeU32(pos),
|
|
1835
1837
|
end = deserializeU32(pos + 4),
|
|
1836
1838
|
node = {
|
|
1837
|
-
type:
|
|
1839
|
+
type: "Property",
|
|
1838
1840
|
kind: null,
|
|
1839
1841
|
key: null,
|
|
1840
1842
|
value: null,
|
|
@@ -1845,7 +1847,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1845
1847
|
end,
|
|
1846
1848
|
range: [start, end],
|
|
1847
1849
|
};
|
|
1848
|
-
node.kind =
|
|
1850
|
+
node.kind = "init";
|
|
1849
1851
|
node.key = deserializePropertyKey(pos + 8);
|
|
1850
1852
|
node.value = deserializeBindingPattern(pos + 24);
|
|
1851
1853
|
node.method = false;
|
|
@@ -1856,7 +1858,7 @@ function deserializeArrayPattern(pos) {
|
|
|
1856
1858
|
let start = deserializeU32(pos),
|
|
1857
1859
|
end = deserializeU32(pos + 4),
|
|
1858
1860
|
node = {
|
|
1859
|
-
type:
|
|
1861
|
+
type: "ArrayPattern",
|
|
1860
1862
|
elements: null,
|
|
1861
1863
|
start,
|
|
1862
1864
|
end,
|
|
@@ -1873,7 +1875,7 @@ function deserializeBindingRestElement(pos) {
|
|
|
1873
1875
|
let start = deserializeU32(pos),
|
|
1874
1876
|
end = deserializeU32(pos + 4),
|
|
1875
1877
|
node = {
|
|
1876
|
-
type:
|
|
1878
|
+
type: "RestElement",
|
|
1877
1879
|
argument: null,
|
|
1878
1880
|
start,
|
|
1879
1881
|
end,
|
|
@@ -1909,13 +1911,13 @@ function deserializeFunction(pos) {
|
|
|
1909
1911
|
function deserializeFunctionType(pos) {
|
|
1910
1912
|
switch (uint8[pos]) {
|
|
1911
1913
|
case 0:
|
|
1912
|
-
return
|
|
1914
|
+
return "FunctionDeclaration";
|
|
1913
1915
|
case 1:
|
|
1914
|
-
return
|
|
1916
|
+
return "FunctionExpression";
|
|
1915
1917
|
case 2:
|
|
1916
|
-
return
|
|
1918
|
+
return "TSDeclareFunction";
|
|
1917
1919
|
case 3:
|
|
1918
|
-
return
|
|
1920
|
+
return "TSEmptyBodyFunctionExpression";
|
|
1919
1921
|
default:
|
|
1920
1922
|
throw Error(`Unexpected discriminant ${uint8[pos]} for FunctionType`);
|
|
1921
1923
|
}
|
|
@@ -1928,7 +1930,7 @@ function deserializeFormalParameters(pos) {
|
|
|
1928
1930
|
let start,
|
|
1929
1931
|
end,
|
|
1930
1932
|
rest = {
|
|
1931
|
-
type:
|
|
1933
|
+
type: "RestElement",
|
|
1932
1934
|
argument: null,
|
|
1933
1935
|
start: (start = deserializeU32(pos)),
|
|
1934
1936
|
end: (end = deserializeU32(pos + 4)),
|
|
@@ -1950,7 +1952,7 @@ function deserializeFunctionBody(pos) {
|
|
|
1950
1952
|
let start = deserializeU32(pos),
|
|
1951
1953
|
end = deserializeU32(pos + 4),
|
|
1952
1954
|
node = {
|
|
1953
|
-
type:
|
|
1955
|
+
type: "BlockStatement",
|
|
1954
1956
|
body: null,
|
|
1955
1957
|
start,
|
|
1956
1958
|
end,
|
|
@@ -1967,7 +1969,7 @@ function deserializeArrowFunctionExpression(pos) {
|
|
|
1967
1969
|
start = deserializeU32(pos),
|
|
1968
1970
|
end = deserializeU32(pos + 4),
|
|
1969
1971
|
node = {
|
|
1970
|
-
type:
|
|
1972
|
+
type: "ArrowFunctionExpression",
|
|
1971
1973
|
expression,
|
|
1972
1974
|
async: deserializeBool(pos + 45),
|
|
1973
1975
|
params: null,
|
|
@@ -1990,7 +1992,7 @@ function deserializeYieldExpression(pos) {
|
|
|
1990
1992
|
let start = deserializeU32(pos),
|
|
1991
1993
|
end = deserializeU32(pos + 4),
|
|
1992
1994
|
node = {
|
|
1993
|
-
type:
|
|
1995
|
+
type: "YieldExpression",
|
|
1994
1996
|
delegate: deserializeBool(pos + 24),
|
|
1995
1997
|
argument: null,
|
|
1996
1998
|
start,
|
|
@@ -2024,9 +2026,9 @@ function deserializeClass(pos) {
|
|
|
2024
2026
|
function deserializeClassType(pos) {
|
|
2025
2027
|
switch (uint8[pos]) {
|
|
2026
2028
|
case 0:
|
|
2027
|
-
return
|
|
2029
|
+
return "ClassDeclaration";
|
|
2028
2030
|
case 1:
|
|
2029
|
-
return
|
|
2031
|
+
return "ClassExpression";
|
|
2030
2032
|
default:
|
|
2031
2033
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ClassType`);
|
|
2032
2034
|
}
|
|
@@ -2036,7 +2038,7 @@ function deserializeClassBody(pos) {
|
|
|
2036
2038
|
let start = deserializeU32(pos),
|
|
2037
2039
|
end = deserializeU32(pos + 4),
|
|
2038
2040
|
node = {
|
|
2039
|
-
type:
|
|
2041
|
+
type: "ClassBody",
|
|
2040
2042
|
body: null,
|
|
2041
2043
|
start,
|
|
2042
2044
|
end,
|
|
@@ -2087,9 +2089,9 @@ function deserializeMethodDefinition(pos) {
|
|
|
2087
2089
|
function deserializeMethodDefinitionType(pos) {
|
|
2088
2090
|
switch (uint8[pos]) {
|
|
2089
2091
|
case 0:
|
|
2090
|
-
return
|
|
2092
|
+
return "MethodDefinition";
|
|
2091
2093
|
case 1:
|
|
2092
|
-
return
|
|
2094
|
+
return "TSAbstractMethodDefinition";
|
|
2093
2095
|
default:
|
|
2094
2096
|
throw Error(`Unexpected discriminant ${uint8[pos]} for MethodDefinitionType`);
|
|
2095
2097
|
}
|
|
@@ -2118,9 +2120,9 @@ function deserializePropertyDefinition(pos) {
|
|
|
2118
2120
|
function deserializePropertyDefinitionType(pos) {
|
|
2119
2121
|
switch (uint8[pos]) {
|
|
2120
2122
|
case 0:
|
|
2121
|
-
return
|
|
2123
|
+
return "PropertyDefinition";
|
|
2122
2124
|
case 1:
|
|
2123
|
-
return
|
|
2125
|
+
return "TSAbstractPropertyDefinition";
|
|
2124
2126
|
default:
|
|
2125
2127
|
throw Error(`Unexpected discriminant ${uint8[pos]} for PropertyDefinitionType`);
|
|
2126
2128
|
}
|
|
@@ -2129,13 +2131,13 @@ function deserializePropertyDefinitionType(pos) {
|
|
|
2129
2131
|
function deserializeMethodDefinitionKind(pos) {
|
|
2130
2132
|
switch (uint8[pos]) {
|
|
2131
2133
|
case 0:
|
|
2132
|
-
return
|
|
2134
|
+
return "constructor";
|
|
2133
2135
|
case 1:
|
|
2134
|
-
return
|
|
2136
|
+
return "method";
|
|
2135
2137
|
case 2:
|
|
2136
|
-
return
|
|
2138
|
+
return "get";
|
|
2137
2139
|
case 3:
|
|
2138
|
-
return
|
|
2140
|
+
return "set";
|
|
2139
2141
|
default:
|
|
2140
2142
|
throw Error(`Unexpected discriminant ${uint8[pos]} for MethodDefinitionKind`);
|
|
2141
2143
|
}
|
|
@@ -2145,7 +2147,7 @@ function deserializePrivateIdentifier(pos) {
|
|
|
2145
2147
|
let start = deserializeU32(pos),
|
|
2146
2148
|
end = deserializeU32(pos + 4);
|
|
2147
2149
|
return {
|
|
2148
|
-
type:
|
|
2150
|
+
type: "PrivateIdentifier",
|
|
2149
2151
|
name: deserializeStr(pos + 8),
|
|
2150
2152
|
start,
|
|
2151
2153
|
end,
|
|
@@ -2157,7 +2159,7 @@ function deserializeStaticBlock(pos) {
|
|
|
2157
2159
|
let start = deserializeU32(pos),
|
|
2158
2160
|
end = deserializeU32(pos + 4),
|
|
2159
2161
|
node = {
|
|
2160
|
-
type:
|
|
2162
|
+
type: "StaticBlock",
|
|
2161
2163
|
body: null,
|
|
2162
2164
|
start,
|
|
2163
2165
|
end,
|
|
@@ -2170,9 +2172,9 @@ function deserializeStaticBlock(pos) {
|
|
|
2170
2172
|
function deserializeAccessorPropertyType(pos) {
|
|
2171
2173
|
switch (uint8[pos]) {
|
|
2172
2174
|
case 0:
|
|
2173
|
-
return
|
|
2175
|
+
return "AccessorProperty";
|
|
2174
2176
|
case 1:
|
|
2175
|
-
return
|
|
2177
|
+
return "TSAbstractAccessorProperty";
|
|
2176
2178
|
default:
|
|
2177
2179
|
throw Error(`Unexpected discriminant ${uint8[pos]} for AccessorPropertyType`);
|
|
2178
2180
|
}
|
|
@@ -2202,7 +2204,7 @@ function deserializeImportExpression(pos) {
|
|
|
2202
2204
|
let start = deserializeU32(pos),
|
|
2203
2205
|
end = deserializeU32(pos + 4),
|
|
2204
2206
|
node = {
|
|
2205
|
-
type:
|
|
2207
|
+
type: "ImportExpression",
|
|
2206
2208
|
source: null,
|
|
2207
2209
|
options: null,
|
|
2208
2210
|
phase: deserializeOptionImportPhase(pos + 40),
|
|
@@ -2219,7 +2221,7 @@ function deserializeImportDeclaration(pos) {
|
|
|
2219
2221
|
let start = deserializeU32(pos),
|
|
2220
2222
|
end = deserializeU32(pos + 4),
|
|
2221
2223
|
node = {
|
|
2222
|
-
type:
|
|
2224
|
+
type: "ImportDeclaration",
|
|
2223
2225
|
specifiers: null,
|
|
2224
2226
|
source: null,
|
|
2225
2227
|
phase: deserializeOptionImportPhase(pos + 88),
|
|
@@ -2240,9 +2242,9 @@ function deserializeImportDeclaration(pos) {
|
|
|
2240
2242
|
function deserializeImportPhase(pos) {
|
|
2241
2243
|
switch (uint8[pos]) {
|
|
2242
2244
|
case 0:
|
|
2243
|
-
return
|
|
2245
|
+
return "source";
|
|
2244
2246
|
case 1:
|
|
2245
|
-
return
|
|
2247
|
+
return "defer";
|
|
2246
2248
|
default:
|
|
2247
2249
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ImportPhase`);
|
|
2248
2250
|
}
|
|
@@ -2265,7 +2267,7 @@ function deserializeImportSpecifier(pos) {
|
|
|
2265
2267
|
let start = deserializeU32(pos),
|
|
2266
2268
|
end = deserializeU32(pos + 4),
|
|
2267
2269
|
node = {
|
|
2268
|
-
type:
|
|
2270
|
+
type: "ImportSpecifier",
|
|
2269
2271
|
imported: null,
|
|
2270
2272
|
local: null,
|
|
2271
2273
|
start,
|
|
@@ -2281,7 +2283,7 @@ function deserializeImportDefaultSpecifier(pos) {
|
|
|
2281
2283
|
let start = deserializeU32(pos),
|
|
2282
2284
|
end = deserializeU32(pos + 4),
|
|
2283
2285
|
node = {
|
|
2284
|
-
type:
|
|
2286
|
+
type: "ImportDefaultSpecifier",
|
|
2285
2287
|
local: null,
|
|
2286
2288
|
start,
|
|
2287
2289
|
end,
|
|
@@ -2295,7 +2297,7 @@ function deserializeImportNamespaceSpecifier(pos) {
|
|
|
2295
2297
|
let start = deserializeU32(pos),
|
|
2296
2298
|
end = deserializeU32(pos + 4),
|
|
2297
2299
|
node = {
|
|
2298
|
-
type:
|
|
2300
|
+
type: "ImportNamespaceSpecifier",
|
|
2299
2301
|
local: null,
|
|
2300
2302
|
start,
|
|
2301
2303
|
end,
|
|
@@ -2313,7 +2315,7 @@ function deserializeImportAttribute(pos) {
|
|
|
2313
2315
|
let start = deserializeU32(pos),
|
|
2314
2316
|
end = deserializeU32(pos + 4),
|
|
2315
2317
|
node = {
|
|
2316
|
-
type:
|
|
2318
|
+
type: "ImportAttribute",
|
|
2317
2319
|
key: null,
|
|
2318
2320
|
value: null,
|
|
2319
2321
|
start,
|
|
@@ -2340,7 +2342,7 @@ function deserializeExportNamedDeclaration(pos) {
|
|
|
2340
2342
|
let start = deserializeU32(pos),
|
|
2341
2343
|
end = deserializeU32(pos + 4),
|
|
2342
2344
|
node = {
|
|
2343
|
-
type:
|
|
2345
|
+
type: "ExportNamedDeclaration",
|
|
2344
2346
|
declaration: null,
|
|
2345
2347
|
specifiers: null,
|
|
2346
2348
|
source: null,
|
|
@@ -2361,7 +2363,7 @@ function deserializeExportDefaultDeclaration(pos) {
|
|
|
2361
2363
|
let start = deserializeU32(pos),
|
|
2362
2364
|
end = deserializeU32(pos + 4),
|
|
2363
2365
|
node = {
|
|
2364
|
-
type:
|
|
2366
|
+
type: "ExportDefaultDeclaration",
|
|
2365
2367
|
declaration: null,
|
|
2366
2368
|
start,
|
|
2367
2369
|
end,
|
|
@@ -2375,7 +2377,7 @@ function deserializeExportAllDeclaration(pos) {
|
|
|
2375
2377
|
let start = deserializeU32(pos),
|
|
2376
2378
|
end = deserializeU32(pos + 4),
|
|
2377
2379
|
node = {
|
|
2378
|
-
type:
|
|
2380
|
+
type: "ExportAllDeclaration",
|
|
2379
2381
|
exported: null,
|
|
2380
2382
|
source: null,
|
|
2381
2383
|
attributes: null,
|
|
@@ -2394,7 +2396,7 @@ function deserializeExportSpecifier(pos) {
|
|
|
2394
2396
|
let start = deserializeU32(pos),
|
|
2395
2397
|
end = deserializeU32(pos + 4),
|
|
2396
2398
|
node = {
|
|
2397
|
-
type:
|
|
2399
|
+
type: "ExportSpecifier",
|
|
2398
2400
|
local: null,
|
|
2399
2401
|
exported: null,
|
|
2400
2402
|
start,
|
|
@@ -2522,7 +2524,7 @@ function deserializeV8IntrinsicExpression(pos) {
|
|
|
2522
2524
|
let start = deserializeU32(pos),
|
|
2523
2525
|
end = deserializeU32(pos + 4),
|
|
2524
2526
|
node = {
|
|
2525
|
-
type:
|
|
2527
|
+
type: "V8IntrinsicExpression",
|
|
2526
2528
|
name: null,
|
|
2527
2529
|
arguments: null,
|
|
2528
2530
|
start,
|
|
@@ -2539,14 +2541,14 @@ function deserializeBooleanLiteral(pos) {
|
|
|
2539
2541
|
start = deserializeU32(pos),
|
|
2540
2542
|
end = deserializeU32(pos + 4),
|
|
2541
2543
|
node = {
|
|
2542
|
-
type:
|
|
2544
|
+
type: "Literal",
|
|
2543
2545
|
value,
|
|
2544
2546
|
raw: null,
|
|
2545
2547
|
start,
|
|
2546
2548
|
end,
|
|
2547
2549
|
range: [start, end],
|
|
2548
2550
|
};
|
|
2549
|
-
node.raw = start === 0 && end === 0 ? null : value +
|
|
2551
|
+
node.raw = start === 0 && end === 0 ? null : value + "";
|
|
2550
2552
|
return node;
|
|
2551
2553
|
}
|
|
2552
2554
|
|
|
@@ -2554,14 +2556,14 @@ function deserializeNullLiteral(pos) {
|
|
|
2554
2556
|
let start = deserializeU32(pos),
|
|
2555
2557
|
end = deserializeU32(pos + 4),
|
|
2556
2558
|
node = {
|
|
2557
|
-
type:
|
|
2559
|
+
type: "Literal",
|
|
2558
2560
|
value: null,
|
|
2559
2561
|
raw: null,
|
|
2560
2562
|
start,
|
|
2561
2563
|
end,
|
|
2562
2564
|
range: [start, end],
|
|
2563
2565
|
};
|
|
2564
|
-
node.raw = start === 0 && end === 0 ? null :
|
|
2566
|
+
node.raw = start === 0 && end === 0 ? null : "null";
|
|
2565
2567
|
return node;
|
|
2566
2568
|
}
|
|
2567
2569
|
|
|
@@ -2569,7 +2571,7 @@ function deserializeNumericLiteral(pos) {
|
|
|
2569
2571
|
let start = deserializeU32(pos),
|
|
2570
2572
|
end = deserializeU32(pos + 4);
|
|
2571
2573
|
return {
|
|
2572
|
-
type:
|
|
2574
|
+
type: "Literal",
|
|
2573
2575
|
value: deserializeF64(pos + 8),
|
|
2574
2576
|
raw: deserializeOptionStr(pos + 16),
|
|
2575
2577
|
start,
|
|
@@ -2582,7 +2584,7 @@ function deserializeStringLiteral(pos) {
|
|
|
2582
2584
|
let start = deserializeU32(pos),
|
|
2583
2585
|
end = deserializeU32(pos + 4),
|
|
2584
2586
|
node = {
|
|
2585
|
-
type:
|
|
2587
|
+
type: "Literal",
|
|
2586
2588
|
value: null,
|
|
2587
2589
|
raw: deserializeOptionStr(pos + 24),
|
|
2588
2590
|
start,
|
|
@@ -2600,7 +2602,7 @@ function deserializeBigIntLiteral(pos) {
|
|
|
2600
2602
|
let start = deserializeU32(pos),
|
|
2601
2603
|
end = deserializeU32(pos + 4),
|
|
2602
2604
|
node = {
|
|
2603
|
-
type:
|
|
2605
|
+
type: "Literal",
|
|
2604
2606
|
value: null,
|
|
2605
2607
|
raw: deserializeOptionStr(pos + 24),
|
|
2606
2608
|
bigint: null,
|
|
@@ -2618,7 +2620,7 @@ function deserializeRegExpLiteral(pos) {
|
|
|
2618
2620
|
let start = deserializeU32(pos),
|
|
2619
2621
|
end = deserializeU32(pos + 4),
|
|
2620
2622
|
node = {
|
|
2621
|
-
type:
|
|
2623
|
+
type: "Literal",
|
|
2622
2624
|
value: null,
|
|
2623
2625
|
raw: deserializeOptionStr(pos + 40),
|
|
2624
2626
|
regex: null,
|
|
@@ -2645,16 +2647,16 @@ function deserializeRegExp(pos) {
|
|
|
2645
2647
|
|
|
2646
2648
|
function deserializeRegExpFlags(pos) {
|
|
2647
2649
|
let flagBits = deserializeU8(pos),
|
|
2648
|
-
flags =
|
|
2650
|
+
flags = "";
|
|
2649
2651
|
// Alphabetical order
|
|
2650
|
-
flagBits & 64 && (flags +=
|
|
2651
|
-
flagBits & 1 && (flags +=
|
|
2652
|
-
flagBits & 2 && (flags +=
|
|
2653
|
-
flagBits & 4 && (flags +=
|
|
2654
|
-
flagBits & 8 && (flags +=
|
|
2655
|
-
flagBits & 16 && (flags +=
|
|
2656
|
-
flagBits & 128 && (flags +=
|
|
2657
|
-
flagBits & 32 && (flags +=
|
|
2652
|
+
flagBits & 64 && (flags += "d");
|
|
2653
|
+
flagBits & 1 && (flags += "g");
|
|
2654
|
+
flagBits & 2 && (flags += "i");
|
|
2655
|
+
flagBits & 4 && (flags += "m");
|
|
2656
|
+
flagBits & 8 && (flags += "s");
|
|
2657
|
+
flagBits & 16 && (flags += "u");
|
|
2658
|
+
flagBits & 128 && (flags += "v");
|
|
2659
|
+
flagBits & 32 && (flags += "y");
|
|
2658
2660
|
return flags;
|
|
2659
2661
|
}
|
|
2660
2662
|
|
|
@@ -2662,7 +2664,7 @@ function deserializeJSXElement(pos) {
|
|
|
2662
2664
|
let start = deserializeU32(pos),
|
|
2663
2665
|
end = deserializeU32(pos + 4),
|
|
2664
2666
|
node = {
|
|
2665
|
-
type:
|
|
2667
|
+
type: "JSXElement",
|
|
2666
2668
|
openingElement: null,
|
|
2667
2669
|
children: null,
|
|
2668
2670
|
closingElement: null,
|
|
@@ -2683,7 +2685,7 @@ function deserializeJSXOpeningElement(pos) {
|
|
|
2683
2685
|
let start = deserializeU32(pos),
|
|
2684
2686
|
end = deserializeU32(pos + 4),
|
|
2685
2687
|
node = {
|
|
2686
|
-
type:
|
|
2688
|
+
type: "JSXOpeningElement",
|
|
2687
2689
|
name: null,
|
|
2688
2690
|
attributes: null,
|
|
2689
2691
|
selfClosing: null,
|
|
@@ -2701,7 +2703,7 @@ function deserializeJSXClosingElement(pos) {
|
|
|
2701
2703
|
let start = deserializeU32(pos),
|
|
2702
2704
|
end = deserializeU32(pos + 4),
|
|
2703
2705
|
node = {
|
|
2704
|
-
type:
|
|
2706
|
+
type: "JSXClosingElement",
|
|
2705
2707
|
name: null,
|
|
2706
2708
|
start,
|
|
2707
2709
|
end,
|
|
@@ -2715,7 +2717,7 @@ function deserializeJSXFragment(pos) {
|
|
|
2715
2717
|
let start = deserializeU32(pos),
|
|
2716
2718
|
end = deserializeU32(pos + 4),
|
|
2717
2719
|
node = {
|
|
2718
|
-
type:
|
|
2720
|
+
type: "JSXFragment",
|
|
2719
2721
|
openingFragment: null,
|
|
2720
2722
|
children: null,
|
|
2721
2723
|
closingFragment: null,
|
|
@@ -2733,7 +2735,7 @@ function deserializeJSXOpeningFragment(pos) {
|
|
|
2733
2735
|
let start = deserializeU32(pos),
|
|
2734
2736
|
end = deserializeU32(pos + 4),
|
|
2735
2737
|
node = {
|
|
2736
|
-
type:
|
|
2738
|
+
type: "JSXOpeningFragment",
|
|
2737
2739
|
attributes: null,
|
|
2738
2740
|
selfClosing: null,
|
|
2739
2741
|
start,
|
|
@@ -2749,7 +2751,7 @@ function deserializeJSXClosingFragment(pos) {
|
|
|
2749
2751
|
let start = deserializeU32(pos),
|
|
2750
2752
|
end = deserializeU32(pos + 4);
|
|
2751
2753
|
return {
|
|
2752
|
-
type:
|
|
2754
|
+
type: "JSXClosingFragment",
|
|
2753
2755
|
start,
|
|
2754
2756
|
end,
|
|
2755
2757
|
range: [start, end],
|
|
@@ -2763,7 +2765,7 @@ function deserializeJSXElementName(pos) {
|
|
|
2763
2765
|
case 1:
|
|
2764
2766
|
let ident = deserializeBoxIdentifierReference(pos + 8);
|
|
2765
2767
|
return {
|
|
2766
|
-
type:
|
|
2768
|
+
type: "JSXIdentifier",
|
|
2767
2769
|
name: ident.name,
|
|
2768
2770
|
start: ident.start,
|
|
2769
2771
|
end: ident.end,
|
|
@@ -2776,8 +2778,8 @@ function deserializeJSXElementName(pos) {
|
|
|
2776
2778
|
case 4:
|
|
2777
2779
|
let thisExpr = deserializeBoxThisExpression(pos + 8);
|
|
2778
2780
|
return {
|
|
2779
|
-
type:
|
|
2780
|
-
name:
|
|
2781
|
+
type: "JSXIdentifier",
|
|
2782
|
+
name: "this",
|
|
2781
2783
|
start: thisExpr.start,
|
|
2782
2784
|
end: thisExpr.end,
|
|
2783
2785
|
range: thisExpr.range,
|
|
@@ -2791,7 +2793,7 @@ function deserializeJSXNamespacedName(pos) {
|
|
|
2791
2793
|
let start = deserializeU32(pos),
|
|
2792
2794
|
end = deserializeU32(pos + 4),
|
|
2793
2795
|
node = {
|
|
2794
|
-
type:
|
|
2796
|
+
type: "JSXNamespacedName",
|
|
2795
2797
|
namespace: null,
|
|
2796
2798
|
name: null,
|
|
2797
2799
|
start,
|
|
@@ -2807,7 +2809,7 @@ function deserializeJSXMemberExpression(pos) {
|
|
|
2807
2809
|
let start = deserializeU32(pos),
|
|
2808
2810
|
end = deserializeU32(pos + 4),
|
|
2809
2811
|
node = {
|
|
2810
|
-
type:
|
|
2812
|
+
type: "JSXMemberExpression",
|
|
2811
2813
|
object: null,
|
|
2812
2814
|
property: null,
|
|
2813
2815
|
start,
|
|
@@ -2824,7 +2826,7 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2824
2826
|
case 0:
|
|
2825
2827
|
let ident = deserializeBoxIdentifierReference(pos + 8);
|
|
2826
2828
|
return {
|
|
2827
|
-
type:
|
|
2829
|
+
type: "JSXIdentifier",
|
|
2828
2830
|
name: ident.name,
|
|
2829
2831
|
start: ident.start,
|
|
2830
2832
|
end: ident.end,
|
|
@@ -2835,8 +2837,8 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2835
2837
|
case 2:
|
|
2836
2838
|
let thisExpr = deserializeBoxThisExpression(pos + 8);
|
|
2837
2839
|
return {
|
|
2838
|
-
type:
|
|
2839
|
-
name:
|
|
2840
|
+
type: "JSXIdentifier",
|
|
2841
|
+
name: "this",
|
|
2840
2842
|
start: thisExpr.start,
|
|
2841
2843
|
end: thisExpr.end,
|
|
2842
2844
|
range: thisExpr.range,
|
|
@@ -2850,7 +2852,7 @@ function deserializeJSXExpressionContainer(pos) {
|
|
|
2850
2852
|
let start = deserializeU32(pos),
|
|
2851
2853
|
end = deserializeU32(pos + 4),
|
|
2852
2854
|
node = {
|
|
2853
|
-
type:
|
|
2855
|
+
type: "JSXExpressionContainer",
|
|
2854
2856
|
expression: null,
|
|
2855
2857
|
start,
|
|
2856
2858
|
end,
|
|
@@ -2959,7 +2961,7 @@ function deserializeJSXEmptyExpression(pos) {
|
|
|
2959
2961
|
let start = deserializeU32(pos),
|
|
2960
2962
|
end = deserializeU32(pos + 4);
|
|
2961
2963
|
return {
|
|
2962
|
-
type:
|
|
2964
|
+
type: "JSXEmptyExpression",
|
|
2963
2965
|
start,
|
|
2964
2966
|
end,
|
|
2965
2967
|
range: [start, end],
|
|
@@ -2981,7 +2983,7 @@ function deserializeJSXAttribute(pos) {
|
|
|
2981
2983
|
let start = deserializeU32(pos),
|
|
2982
2984
|
end = deserializeU32(pos + 4),
|
|
2983
2985
|
node = {
|
|
2984
|
-
type:
|
|
2986
|
+
type: "JSXAttribute",
|
|
2985
2987
|
name: null,
|
|
2986
2988
|
value: null,
|
|
2987
2989
|
start,
|
|
@@ -2997,7 +2999,7 @@ function deserializeJSXSpreadAttribute(pos) {
|
|
|
2997
2999
|
let start = deserializeU32(pos),
|
|
2998
3000
|
end = deserializeU32(pos + 4),
|
|
2999
3001
|
node = {
|
|
3000
|
-
type:
|
|
3002
|
+
type: "JSXSpreadAttribute",
|
|
3001
3003
|
argument: null,
|
|
3002
3004
|
start,
|
|
3003
3005
|
end,
|
|
@@ -3037,7 +3039,7 @@ function deserializeJSXIdentifier(pos) {
|
|
|
3037
3039
|
let start = deserializeU32(pos),
|
|
3038
3040
|
end = deserializeU32(pos + 4);
|
|
3039
3041
|
return {
|
|
3040
|
-
type:
|
|
3042
|
+
type: "JSXIdentifier",
|
|
3041
3043
|
name: deserializeStr(pos + 8),
|
|
3042
3044
|
start,
|
|
3043
3045
|
end,
|
|
@@ -3066,7 +3068,7 @@ function deserializeJSXSpreadChild(pos) {
|
|
|
3066
3068
|
let start = deserializeU32(pos),
|
|
3067
3069
|
end = deserializeU32(pos + 4),
|
|
3068
3070
|
node = {
|
|
3069
|
-
type:
|
|
3071
|
+
type: "JSXSpreadChild",
|
|
3070
3072
|
expression: null,
|
|
3071
3073
|
start,
|
|
3072
3074
|
end,
|
|
@@ -3080,7 +3082,7 @@ function deserializeJSXText(pos) {
|
|
|
3080
3082
|
let start = deserializeU32(pos),
|
|
3081
3083
|
end = deserializeU32(pos + 4);
|
|
3082
3084
|
return {
|
|
3083
|
-
type:
|
|
3085
|
+
type: "JSXText",
|
|
3084
3086
|
value: deserializeStr(pos + 8),
|
|
3085
3087
|
raw: deserializeOptionStr(pos + 24),
|
|
3086
3088
|
start,
|
|
@@ -3093,7 +3095,7 @@ function deserializeTSThisParameter(pos) {
|
|
|
3093
3095
|
let start = deserializeU32(pos),
|
|
3094
3096
|
end = deserializeU32(pos + 4),
|
|
3095
3097
|
node = {
|
|
3096
|
-
type:
|
|
3098
|
+
type: "Identifier",
|
|
3097
3099
|
decorators: null,
|
|
3098
3100
|
name: null,
|
|
3099
3101
|
optional: null,
|
|
@@ -3103,7 +3105,7 @@ function deserializeTSThisParameter(pos) {
|
|
|
3103
3105
|
range: [start, end],
|
|
3104
3106
|
};
|
|
3105
3107
|
node.decorators = [];
|
|
3106
|
-
node.name =
|
|
3108
|
+
node.name = "this";
|
|
3107
3109
|
node.optional = false;
|
|
3108
3110
|
node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 16);
|
|
3109
3111
|
return node;
|
|
@@ -3113,7 +3115,7 @@ function deserializeTSEnumDeclaration(pos) {
|
|
|
3113
3115
|
let start = deserializeU32(pos),
|
|
3114
3116
|
end = deserializeU32(pos + 4),
|
|
3115
3117
|
node = {
|
|
3116
|
-
type:
|
|
3118
|
+
type: "TSEnumDeclaration",
|
|
3117
3119
|
id: null,
|
|
3118
3120
|
body: null,
|
|
3119
3121
|
const: deserializeBool(pos + 76),
|
|
@@ -3131,7 +3133,7 @@ function deserializeTSEnumBody(pos) {
|
|
|
3131
3133
|
let start = deserializeU32(pos),
|
|
3132
3134
|
end = deserializeU32(pos + 4),
|
|
3133
3135
|
node = {
|
|
3134
|
-
type:
|
|
3136
|
+
type: "TSEnumBody",
|
|
3135
3137
|
members: null,
|
|
3136
3138
|
start,
|
|
3137
3139
|
end,
|
|
@@ -3145,7 +3147,7 @@ function deserializeTSEnumMember(pos) {
|
|
|
3145
3147
|
let start = deserializeU32(pos),
|
|
3146
3148
|
end = deserializeU32(pos + 4),
|
|
3147
3149
|
node = {
|
|
3148
|
-
type:
|
|
3150
|
+
type: "TSEnumMember",
|
|
3149
3151
|
id: null,
|
|
3150
3152
|
initializer: null,
|
|
3151
3153
|
computed: null,
|
|
@@ -3178,7 +3180,7 @@ function deserializeTSTypeAnnotation(pos) {
|
|
|
3178
3180
|
let start = deserializeU32(pos),
|
|
3179
3181
|
end = deserializeU32(pos + 4),
|
|
3180
3182
|
node = {
|
|
3181
|
-
type:
|
|
3183
|
+
type: "TSTypeAnnotation",
|
|
3182
3184
|
typeAnnotation: null,
|
|
3183
3185
|
start,
|
|
3184
3186
|
end,
|
|
@@ -3192,7 +3194,7 @@ function deserializeTSLiteralType(pos) {
|
|
|
3192
3194
|
let start = deserializeU32(pos),
|
|
3193
3195
|
end = deserializeU32(pos + 4),
|
|
3194
3196
|
node = {
|
|
3195
|
-
type:
|
|
3197
|
+
type: "TSLiteralType",
|
|
3196
3198
|
literal: null,
|
|
3197
3199
|
start,
|
|
3198
3200
|
end,
|
|
@@ -3306,7 +3308,7 @@ function deserializeTSConditionalType(pos) {
|
|
|
3306
3308
|
let start = deserializeU32(pos),
|
|
3307
3309
|
end = deserializeU32(pos + 4),
|
|
3308
3310
|
node = {
|
|
3309
|
-
type:
|
|
3311
|
+
type: "TSConditionalType",
|
|
3310
3312
|
checkType: null,
|
|
3311
3313
|
extendsType: null,
|
|
3312
3314
|
trueType: null,
|
|
@@ -3326,7 +3328,7 @@ function deserializeTSUnionType(pos) {
|
|
|
3326
3328
|
let start = deserializeU32(pos),
|
|
3327
3329
|
end = deserializeU32(pos + 4),
|
|
3328
3330
|
node = {
|
|
3329
|
-
type:
|
|
3331
|
+
type: "TSUnionType",
|
|
3330
3332
|
types: null,
|
|
3331
3333
|
start,
|
|
3332
3334
|
end,
|
|
@@ -3340,7 +3342,7 @@ function deserializeTSIntersectionType(pos) {
|
|
|
3340
3342
|
let start = deserializeU32(pos),
|
|
3341
3343
|
end = deserializeU32(pos + 4),
|
|
3342
3344
|
node = {
|
|
3343
|
-
type:
|
|
3345
|
+
type: "TSIntersectionType",
|
|
3344
3346
|
types: null,
|
|
3345
3347
|
start,
|
|
3346
3348
|
end,
|
|
@@ -3355,7 +3357,7 @@ function deserializeTSParenthesizedType(pos) {
|
|
|
3355
3357
|
{
|
|
3356
3358
|
let start, end;
|
|
3357
3359
|
node = {
|
|
3358
|
-
type:
|
|
3360
|
+
type: "TSParenthesizedType",
|
|
3359
3361
|
typeAnnotation: null,
|
|
3360
3362
|
start: (start = deserializeU32(pos)),
|
|
3361
3363
|
end: (end = deserializeU32(pos + 4)),
|
|
@@ -3370,7 +3372,7 @@ function deserializeTSTypeOperator(pos) {
|
|
|
3370
3372
|
let start = deserializeU32(pos),
|
|
3371
3373
|
end = deserializeU32(pos + 4),
|
|
3372
3374
|
node = {
|
|
3373
|
-
type:
|
|
3375
|
+
type: "TSTypeOperator",
|
|
3374
3376
|
operator: deserializeTSTypeOperatorOperator(pos + 24),
|
|
3375
3377
|
typeAnnotation: null,
|
|
3376
3378
|
start,
|
|
@@ -3384,11 +3386,11 @@ function deserializeTSTypeOperator(pos) {
|
|
|
3384
3386
|
function deserializeTSTypeOperatorOperator(pos) {
|
|
3385
3387
|
switch (uint8[pos]) {
|
|
3386
3388
|
case 0:
|
|
3387
|
-
return
|
|
3389
|
+
return "keyof";
|
|
3388
3390
|
case 1:
|
|
3389
|
-
return
|
|
3391
|
+
return "unique";
|
|
3390
3392
|
case 2:
|
|
3391
|
-
return
|
|
3393
|
+
return "readonly";
|
|
3392
3394
|
default:
|
|
3393
3395
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSTypeOperatorOperator`);
|
|
3394
3396
|
}
|
|
@@ -3398,7 +3400,7 @@ function deserializeTSArrayType(pos) {
|
|
|
3398
3400
|
let start = deserializeU32(pos),
|
|
3399
3401
|
end = deserializeU32(pos + 4),
|
|
3400
3402
|
node = {
|
|
3401
|
-
type:
|
|
3403
|
+
type: "TSArrayType",
|
|
3402
3404
|
elementType: null,
|
|
3403
3405
|
start,
|
|
3404
3406
|
end,
|
|
@@ -3412,7 +3414,7 @@ function deserializeTSIndexedAccessType(pos) {
|
|
|
3412
3414
|
let start = deserializeU32(pos),
|
|
3413
3415
|
end = deserializeU32(pos + 4),
|
|
3414
3416
|
node = {
|
|
3415
|
-
type:
|
|
3417
|
+
type: "TSIndexedAccessType",
|
|
3416
3418
|
objectType: null,
|
|
3417
3419
|
indexType: null,
|
|
3418
3420
|
start,
|
|
@@ -3428,7 +3430,7 @@ function deserializeTSTupleType(pos) {
|
|
|
3428
3430
|
let start = deserializeU32(pos),
|
|
3429
3431
|
end = deserializeU32(pos + 4),
|
|
3430
3432
|
node = {
|
|
3431
|
-
type:
|
|
3433
|
+
type: "TSTupleType",
|
|
3432
3434
|
elementTypes: null,
|
|
3433
3435
|
start,
|
|
3434
3436
|
end,
|
|
@@ -3442,7 +3444,7 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
3442
3444
|
let start = deserializeU32(pos),
|
|
3443
3445
|
end = deserializeU32(pos + 4),
|
|
3444
3446
|
node = {
|
|
3445
|
-
type:
|
|
3447
|
+
type: "TSNamedTupleMember",
|
|
3446
3448
|
label: null,
|
|
3447
3449
|
elementType: null,
|
|
3448
3450
|
optional: deserializeBool(pos + 48),
|
|
@@ -3459,7 +3461,7 @@ function deserializeTSOptionalType(pos) {
|
|
|
3459
3461
|
let start = deserializeU32(pos),
|
|
3460
3462
|
end = deserializeU32(pos + 4),
|
|
3461
3463
|
node = {
|
|
3462
|
-
type:
|
|
3464
|
+
type: "TSOptionalType",
|
|
3463
3465
|
typeAnnotation: null,
|
|
3464
3466
|
start,
|
|
3465
3467
|
end,
|
|
@@ -3473,7 +3475,7 @@ function deserializeTSRestType(pos) {
|
|
|
3473
3475
|
let start = deserializeU32(pos),
|
|
3474
3476
|
end = deserializeU32(pos + 4),
|
|
3475
3477
|
node = {
|
|
3476
|
-
type:
|
|
3478
|
+
type: "TSRestType",
|
|
3477
3479
|
typeAnnotation: null,
|
|
3478
3480
|
start,
|
|
3479
3481
|
end,
|
|
@@ -3572,7 +3574,7 @@ function deserializeTSAnyKeyword(pos) {
|
|
|
3572
3574
|
let start = deserializeU32(pos),
|
|
3573
3575
|
end = deserializeU32(pos + 4);
|
|
3574
3576
|
return {
|
|
3575
|
-
type:
|
|
3577
|
+
type: "TSAnyKeyword",
|
|
3576
3578
|
start,
|
|
3577
3579
|
end,
|
|
3578
3580
|
range: [start, end],
|
|
@@ -3583,7 +3585,7 @@ function deserializeTSStringKeyword(pos) {
|
|
|
3583
3585
|
let start = deserializeU32(pos),
|
|
3584
3586
|
end = deserializeU32(pos + 4);
|
|
3585
3587
|
return {
|
|
3586
|
-
type:
|
|
3588
|
+
type: "TSStringKeyword",
|
|
3587
3589
|
start,
|
|
3588
3590
|
end,
|
|
3589
3591
|
range: [start, end],
|
|
@@ -3594,7 +3596,7 @@ function deserializeTSBooleanKeyword(pos) {
|
|
|
3594
3596
|
let start = deserializeU32(pos),
|
|
3595
3597
|
end = deserializeU32(pos + 4);
|
|
3596
3598
|
return {
|
|
3597
|
-
type:
|
|
3599
|
+
type: "TSBooleanKeyword",
|
|
3598
3600
|
start,
|
|
3599
3601
|
end,
|
|
3600
3602
|
range: [start, end],
|
|
@@ -3605,7 +3607,7 @@ function deserializeTSNumberKeyword(pos) {
|
|
|
3605
3607
|
let start = deserializeU32(pos),
|
|
3606
3608
|
end = deserializeU32(pos + 4);
|
|
3607
3609
|
return {
|
|
3608
|
-
type:
|
|
3610
|
+
type: "TSNumberKeyword",
|
|
3609
3611
|
start,
|
|
3610
3612
|
end,
|
|
3611
3613
|
range: [start, end],
|
|
@@ -3616,7 +3618,7 @@ function deserializeTSNeverKeyword(pos) {
|
|
|
3616
3618
|
let start = deserializeU32(pos),
|
|
3617
3619
|
end = deserializeU32(pos + 4);
|
|
3618
3620
|
return {
|
|
3619
|
-
type:
|
|
3621
|
+
type: "TSNeverKeyword",
|
|
3620
3622
|
start,
|
|
3621
3623
|
end,
|
|
3622
3624
|
range: [start, end],
|
|
@@ -3627,7 +3629,7 @@ function deserializeTSIntrinsicKeyword(pos) {
|
|
|
3627
3629
|
let start = deserializeU32(pos),
|
|
3628
3630
|
end = deserializeU32(pos + 4);
|
|
3629
3631
|
return {
|
|
3630
|
-
type:
|
|
3632
|
+
type: "TSIntrinsicKeyword",
|
|
3631
3633
|
start,
|
|
3632
3634
|
end,
|
|
3633
3635
|
range: [start, end],
|
|
@@ -3638,7 +3640,7 @@ function deserializeTSUnknownKeyword(pos) {
|
|
|
3638
3640
|
let start = deserializeU32(pos),
|
|
3639
3641
|
end = deserializeU32(pos + 4);
|
|
3640
3642
|
return {
|
|
3641
|
-
type:
|
|
3643
|
+
type: "TSUnknownKeyword",
|
|
3642
3644
|
start,
|
|
3643
3645
|
end,
|
|
3644
3646
|
range: [start, end],
|
|
@@ -3649,7 +3651,7 @@ function deserializeTSNullKeyword(pos) {
|
|
|
3649
3651
|
let start = deserializeU32(pos),
|
|
3650
3652
|
end = deserializeU32(pos + 4);
|
|
3651
3653
|
return {
|
|
3652
|
-
type:
|
|
3654
|
+
type: "TSNullKeyword",
|
|
3653
3655
|
start,
|
|
3654
3656
|
end,
|
|
3655
3657
|
range: [start, end],
|
|
@@ -3660,7 +3662,7 @@ function deserializeTSUndefinedKeyword(pos) {
|
|
|
3660
3662
|
let start = deserializeU32(pos),
|
|
3661
3663
|
end = deserializeU32(pos + 4);
|
|
3662
3664
|
return {
|
|
3663
|
-
type:
|
|
3665
|
+
type: "TSUndefinedKeyword",
|
|
3664
3666
|
start,
|
|
3665
3667
|
end,
|
|
3666
3668
|
range: [start, end],
|
|
@@ -3671,7 +3673,7 @@ function deserializeTSVoidKeyword(pos) {
|
|
|
3671
3673
|
let start = deserializeU32(pos),
|
|
3672
3674
|
end = deserializeU32(pos + 4);
|
|
3673
3675
|
return {
|
|
3674
|
-
type:
|
|
3676
|
+
type: "TSVoidKeyword",
|
|
3675
3677
|
start,
|
|
3676
3678
|
end,
|
|
3677
3679
|
range: [start, end],
|
|
@@ -3682,7 +3684,7 @@ function deserializeTSSymbolKeyword(pos) {
|
|
|
3682
3684
|
let start = deserializeU32(pos),
|
|
3683
3685
|
end = deserializeU32(pos + 4);
|
|
3684
3686
|
return {
|
|
3685
|
-
type:
|
|
3687
|
+
type: "TSSymbolKeyword",
|
|
3686
3688
|
start,
|
|
3687
3689
|
end,
|
|
3688
3690
|
range: [start, end],
|
|
@@ -3693,7 +3695,7 @@ function deserializeTSThisType(pos) {
|
|
|
3693
3695
|
let start = deserializeU32(pos),
|
|
3694
3696
|
end = deserializeU32(pos + 4);
|
|
3695
3697
|
return {
|
|
3696
|
-
type:
|
|
3698
|
+
type: "TSThisType",
|
|
3697
3699
|
start,
|
|
3698
3700
|
end,
|
|
3699
3701
|
range: [start, end],
|
|
@@ -3704,7 +3706,7 @@ function deserializeTSObjectKeyword(pos) {
|
|
|
3704
3706
|
let start = deserializeU32(pos),
|
|
3705
3707
|
end = deserializeU32(pos + 4);
|
|
3706
3708
|
return {
|
|
3707
|
-
type:
|
|
3709
|
+
type: "TSObjectKeyword",
|
|
3708
3710
|
start,
|
|
3709
3711
|
end,
|
|
3710
3712
|
range: [start, end],
|
|
@@ -3715,7 +3717,7 @@ function deserializeTSBigIntKeyword(pos) {
|
|
|
3715
3717
|
let start = deserializeU32(pos),
|
|
3716
3718
|
end = deserializeU32(pos + 4);
|
|
3717
3719
|
return {
|
|
3718
|
-
type:
|
|
3720
|
+
type: "TSBigIntKeyword",
|
|
3719
3721
|
start,
|
|
3720
3722
|
end,
|
|
3721
3723
|
range: [start, end],
|
|
@@ -3726,7 +3728,7 @@ function deserializeTSTypeReference(pos) {
|
|
|
3726
3728
|
let start = deserializeU32(pos),
|
|
3727
3729
|
end = deserializeU32(pos + 4),
|
|
3728
3730
|
node = {
|
|
3729
|
-
type:
|
|
3731
|
+
type: "TSTypeReference",
|
|
3730
3732
|
typeName: null,
|
|
3731
3733
|
typeArguments: null,
|
|
3732
3734
|
start,
|
|
@@ -3755,7 +3757,7 @@ function deserializeTSQualifiedName(pos) {
|
|
|
3755
3757
|
let start = deserializeU32(pos),
|
|
3756
3758
|
end = deserializeU32(pos + 4),
|
|
3757
3759
|
node = {
|
|
3758
|
-
type:
|
|
3760
|
+
type: "TSQualifiedName",
|
|
3759
3761
|
left: null,
|
|
3760
3762
|
right: null,
|
|
3761
3763
|
start,
|
|
@@ -3771,7 +3773,7 @@ function deserializeTSTypeParameterInstantiation(pos) {
|
|
|
3771
3773
|
let start = deserializeU32(pos),
|
|
3772
3774
|
end = deserializeU32(pos + 4),
|
|
3773
3775
|
node = {
|
|
3774
|
-
type:
|
|
3776
|
+
type: "TSTypeParameterInstantiation",
|
|
3775
3777
|
params: null,
|
|
3776
3778
|
start,
|
|
3777
3779
|
end,
|
|
@@ -3785,7 +3787,7 @@ function deserializeTSTypeParameter(pos) {
|
|
|
3785
3787
|
let start = deserializeU32(pos),
|
|
3786
3788
|
end = deserializeU32(pos + 4),
|
|
3787
3789
|
node = {
|
|
3788
|
-
type:
|
|
3790
|
+
type: "TSTypeParameter",
|
|
3789
3791
|
name: null,
|
|
3790
3792
|
constraint: null,
|
|
3791
3793
|
default: null,
|
|
@@ -3806,7 +3808,7 @@ function deserializeTSTypeParameterDeclaration(pos) {
|
|
|
3806
3808
|
let start = deserializeU32(pos),
|
|
3807
3809
|
end = deserializeU32(pos + 4),
|
|
3808
3810
|
node = {
|
|
3809
|
-
type:
|
|
3811
|
+
type: "TSTypeParameterDeclaration",
|
|
3810
3812
|
params: null,
|
|
3811
3813
|
start,
|
|
3812
3814
|
end,
|
|
@@ -3820,7 +3822,7 @@ function deserializeTSTypeAliasDeclaration(pos) {
|
|
|
3820
3822
|
let start = deserializeU32(pos),
|
|
3821
3823
|
end = deserializeU32(pos + 4),
|
|
3822
3824
|
node = {
|
|
3823
|
-
type:
|
|
3825
|
+
type: "TSTypeAliasDeclaration",
|
|
3824
3826
|
id: null,
|
|
3825
3827
|
typeParameters: null,
|
|
3826
3828
|
typeAnnotation: null,
|
|
@@ -3839,7 +3841,7 @@ function deserializeTSInterfaceDeclaration(pos) {
|
|
|
3839
3841
|
let start = deserializeU32(pos),
|
|
3840
3842
|
end = deserializeU32(pos + 4),
|
|
3841
3843
|
node = {
|
|
3842
|
-
type:
|
|
3844
|
+
type: "TSInterfaceDeclaration",
|
|
3843
3845
|
id: null,
|
|
3844
3846
|
typeParameters: null,
|
|
3845
3847
|
extends: null,
|
|
@@ -3860,7 +3862,7 @@ function deserializeTSInterfaceBody(pos) {
|
|
|
3860
3862
|
let start = deserializeU32(pos),
|
|
3861
3863
|
end = deserializeU32(pos + 4),
|
|
3862
3864
|
node = {
|
|
3863
|
-
type:
|
|
3865
|
+
type: "TSInterfaceBody",
|
|
3864
3866
|
body: null,
|
|
3865
3867
|
start,
|
|
3866
3868
|
end,
|
|
@@ -3874,7 +3876,7 @@ function deserializeTSPropertySignature(pos) {
|
|
|
3874
3876
|
let start = deserializeU32(pos),
|
|
3875
3877
|
end = deserializeU32(pos + 4),
|
|
3876
3878
|
node = {
|
|
3877
|
-
type:
|
|
3879
|
+
type: "TSPropertySignature",
|
|
3878
3880
|
computed: deserializeBool(pos + 32),
|
|
3879
3881
|
optional: deserializeBool(pos + 33),
|
|
3880
3882
|
readonly: deserializeBool(pos + 34),
|
|
@@ -3913,7 +3915,7 @@ function deserializeTSIndexSignature(pos) {
|
|
|
3913
3915
|
let start = deserializeU32(pos),
|
|
3914
3916
|
end = deserializeU32(pos + 4),
|
|
3915
3917
|
node = {
|
|
3916
|
-
type:
|
|
3918
|
+
type: "TSIndexSignature",
|
|
3917
3919
|
parameters: null,
|
|
3918
3920
|
typeAnnotation: null,
|
|
3919
3921
|
readonly: deserializeBool(pos + 40),
|
|
@@ -3932,7 +3934,7 @@ function deserializeTSCallSignatureDeclaration(pos) {
|
|
|
3932
3934
|
let start = deserializeU32(pos),
|
|
3933
3935
|
end = deserializeU32(pos + 4),
|
|
3934
3936
|
node = {
|
|
3935
|
-
type:
|
|
3937
|
+
type: "TSCallSignatureDeclaration",
|
|
3936
3938
|
typeParameters: null,
|
|
3937
3939
|
params: null,
|
|
3938
3940
|
returnType: null,
|
|
@@ -3952,11 +3954,11 @@ function deserializeTSCallSignatureDeclaration(pos) {
|
|
|
3952
3954
|
function deserializeTSMethodSignatureKind(pos) {
|
|
3953
3955
|
switch (uint8[pos]) {
|
|
3954
3956
|
case 0:
|
|
3955
|
-
return
|
|
3957
|
+
return "method";
|
|
3956
3958
|
case 1:
|
|
3957
|
-
return
|
|
3959
|
+
return "get";
|
|
3958
3960
|
case 2:
|
|
3959
|
-
return
|
|
3961
|
+
return "set";
|
|
3960
3962
|
default:
|
|
3961
3963
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSMethodSignatureKind`);
|
|
3962
3964
|
}
|
|
@@ -3966,7 +3968,7 @@ function deserializeTSMethodSignature(pos) {
|
|
|
3966
3968
|
let start = deserializeU32(pos),
|
|
3967
3969
|
end = deserializeU32(pos + 4),
|
|
3968
3970
|
node = {
|
|
3969
|
-
type:
|
|
3971
|
+
type: "TSMethodSignature",
|
|
3970
3972
|
key: null,
|
|
3971
3973
|
computed: deserializeBool(pos + 60),
|
|
3972
3974
|
optional: deserializeBool(pos + 61),
|
|
@@ -3997,7 +3999,7 @@ function deserializeTSConstructSignatureDeclaration(pos) {
|
|
|
3997
3999
|
let start = deserializeU32(pos),
|
|
3998
4000
|
end = deserializeU32(pos + 4),
|
|
3999
4001
|
node = {
|
|
4000
|
-
type:
|
|
4002
|
+
type: "TSConstructSignatureDeclaration",
|
|
4001
4003
|
typeParameters: null,
|
|
4002
4004
|
params: null,
|
|
4003
4005
|
returnType: null,
|
|
@@ -4015,7 +4017,7 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
4015
4017
|
let start = deserializeU32(pos),
|
|
4016
4018
|
end = deserializeU32(pos + 4),
|
|
4017
4019
|
node = {
|
|
4018
|
-
type:
|
|
4020
|
+
type: "Identifier",
|
|
4019
4021
|
decorators: null,
|
|
4020
4022
|
name: deserializeStr(pos + 8),
|
|
4021
4023
|
optional: null,
|
|
@@ -4034,7 +4036,7 @@ function deserializeTSInterfaceHeritage(pos) {
|
|
|
4034
4036
|
let start = deserializeU32(pos),
|
|
4035
4037
|
end = deserializeU32(pos + 4),
|
|
4036
4038
|
node = {
|
|
4037
|
-
type:
|
|
4039
|
+
type: "TSInterfaceHeritage",
|
|
4038
4040
|
expression: null,
|
|
4039
4041
|
typeArguments: null,
|
|
4040
4042
|
start,
|
|
@@ -4050,7 +4052,7 @@ function deserializeTSTypePredicate(pos) {
|
|
|
4050
4052
|
let start = deserializeU32(pos),
|
|
4051
4053
|
end = deserializeU32(pos + 4),
|
|
4052
4054
|
node = {
|
|
4053
|
-
type:
|
|
4055
|
+
type: "TSTypePredicate",
|
|
4054
4056
|
parameterName: null,
|
|
4055
4057
|
asserts: deserializeBool(pos + 32),
|
|
4056
4058
|
typeAnnotation: null,
|
|
@@ -4083,7 +4085,7 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
4083
4085
|
body = deserializeOptionTSModuleDeclarationBody(pos + 64);
|
|
4084
4086
|
if (body === null) {
|
|
4085
4087
|
node = {
|
|
4086
|
-
type:
|
|
4088
|
+
type: "TSModuleDeclaration",
|
|
4087
4089
|
id: null,
|
|
4088
4090
|
kind,
|
|
4089
4091
|
declare,
|
|
@@ -4095,7 +4097,7 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
4095
4097
|
node.id = deserializeTSModuleDeclarationName(pos + 8);
|
|
4096
4098
|
} else {
|
|
4097
4099
|
node = {
|
|
4098
|
-
type:
|
|
4100
|
+
type: "TSModuleDeclaration",
|
|
4099
4101
|
id: null,
|
|
4100
4102
|
body,
|
|
4101
4103
|
kind,
|
|
@@ -4106,13 +4108,13 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
4106
4108
|
range: [start, end],
|
|
4107
4109
|
};
|
|
4108
4110
|
let id = deserializeTSModuleDeclarationName(pos + 8);
|
|
4109
|
-
if (body.type ===
|
|
4111
|
+
if (body.type === "TSModuleBlock") node.id = id;
|
|
4110
4112
|
else {
|
|
4111
4113
|
let innerId = body.id;
|
|
4112
|
-
if (innerId.type ===
|
|
4114
|
+
if (innerId.type === "Identifier") {
|
|
4113
4115
|
let start, end;
|
|
4114
4116
|
node.id = {
|
|
4115
|
-
type:
|
|
4117
|
+
type: "TSQualifiedName",
|
|
4116
4118
|
left: id,
|
|
4117
4119
|
right: innerId,
|
|
4118
4120
|
start: (start = id.start),
|
|
@@ -4126,13 +4128,13 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
4126
4128
|
let { start } = id;
|
|
4127
4129
|
for (;;) {
|
|
4128
4130
|
innerId.start = innerId.range[0] = start;
|
|
4129
|
-
if (innerId.left.type ===
|
|
4131
|
+
if (innerId.left.type === "Identifier") break;
|
|
4130
4132
|
innerId = innerId.left;
|
|
4131
4133
|
}
|
|
4132
4134
|
let end,
|
|
4133
4135
|
right = innerId.left;
|
|
4134
4136
|
innerId.left = {
|
|
4135
|
-
type:
|
|
4137
|
+
type: "TSQualifiedName",
|
|
4136
4138
|
left: id,
|
|
4137
4139
|
right,
|
|
4138
4140
|
start,
|
|
@@ -4140,7 +4142,7 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
4140
4142
|
range: [start, end],
|
|
4141
4143
|
};
|
|
4142
4144
|
}
|
|
4143
|
-
if (Object.hasOwn(body,
|
|
4145
|
+
if (Object.hasOwn(body, "body")) {
|
|
4144
4146
|
body = body.body;
|
|
4145
4147
|
node.body = body;
|
|
4146
4148
|
} else body = null;
|
|
@@ -4152,9 +4154,9 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
4152
4154
|
function deserializeTSModuleDeclarationKind(pos) {
|
|
4153
4155
|
switch (uint8[pos]) {
|
|
4154
4156
|
case 0:
|
|
4155
|
-
return
|
|
4157
|
+
return "module";
|
|
4156
4158
|
case 1:
|
|
4157
|
-
return
|
|
4159
|
+
return "namespace";
|
|
4158
4160
|
default:
|
|
4159
4161
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSModuleDeclarationKind`);
|
|
4160
4162
|
}
|
|
@@ -4186,7 +4188,7 @@ function deserializeTSGlobalDeclaration(pos) {
|
|
|
4186
4188
|
let start = deserializeU32(pos),
|
|
4187
4189
|
end = deserializeU32(pos + 4),
|
|
4188
4190
|
node = {
|
|
4189
|
-
type:
|
|
4191
|
+
type: "TSModuleDeclaration",
|
|
4190
4192
|
id: null,
|
|
4191
4193
|
body: null,
|
|
4192
4194
|
kind: null,
|
|
@@ -4199,14 +4201,14 @@ function deserializeTSGlobalDeclaration(pos) {
|
|
|
4199
4201
|
keywordStart,
|
|
4200
4202
|
keywordEnd;
|
|
4201
4203
|
node.id = {
|
|
4202
|
-
type:
|
|
4203
|
-
name:
|
|
4204
|
+
type: "Identifier",
|
|
4205
|
+
name: "global",
|
|
4204
4206
|
start: (keywordStart = deserializeU32(pos + 8)),
|
|
4205
4207
|
end: (keywordEnd = deserializeU32(pos + 12)),
|
|
4206
4208
|
range: [keywordStart, keywordEnd],
|
|
4207
4209
|
};
|
|
4208
4210
|
node.body = deserializeTSModuleBlock(pos + 16);
|
|
4209
|
-
node.kind =
|
|
4211
|
+
node.kind = "global";
|
|
4210
4212
|
node.global = true;
|
|
4211
4213
|
return node;
|
|
4212
4214
|
}
|
|
@@ -4215,7 +4217,7 @@ function deserializeTSModuleBlock(pos) {
|
|
|
4215
4217
|
let start = deserializeU32(pos),
|
|
4216
4218
|
end = deserializeU32(pos + 4),
|
|
4217
4219
|
node = {
|
|
4218
|
-
type:
|
|
4220
|
+
type: "TSModuleBlock",
|
|
4219
4221
|
body: null,
|
|
4220
4222
|
start,
|
|
4221
4223
|
end,
|
|
@@ -4231,7 +4233,7 @@ function deserializeTSTypeLiteral(pos) {
|
|
|
4231
4233
|
let start = deserializeU32(pos),
|
|
4232
4234
|
end = deserializeU32(pos + 4),
|
|
4233
4235
|
node = {
|
|
4234
|
-
type:
|
|
4236
|
+
type: "TSTypeLiteral",
|
|
4235
4237
|
members: null,
|
|
4236
4238
|
start,
|
|
4237
4239
|
end,
|
|
@@ -4245,7 +4247,7 @@ function deserializeTSInferType(pos) {
|
|
|
4245
4247
|
let start = deserializeU32(pos),
|
|
4246
4248
|
end = deserializeU32(pos + 4),
|
|
4247
4249
|
node = {
|
|
4248
|
-
type:
|
|
4250
|
+
type: "TSInferType",
|
|
4249
4251
|
typeParameter: null,
|
|
4250
4252
|
start,
|
|
4251
4253
|
end,
|
|
@@ -4259,7 +4261,7 @@ function deserializeTSTypeQuery(pos) {
|
|
|
4259
4261
|
let start = deserializeU32(pos),
|
|
4260
4262
|
end = deserializeU32(pos + 4),
|
|
4261
4263
|
node = {
|
|
4262
|
-
type:
|
|
4264
|
+
type: "TSTypeQuery",
|
|
4263
4265
|
exprName: null,
|
|
4264
4266
|
typeArguments: null,
|
|
4265
4267
|
start,
|
|
@@ -4290,8 +4292,8 @@ function deserializeTSImportType(pos) {
|
|
|
4290
4292
|
let start = deserializeU32(pos),
|
|
4291
4293
|
end = deserializeU32(pos + 4),
|
|
4292
4294
|
node = {
|
|
4293
|
-
type:
|
|
4294
|
-
|
|
4295
|
+
type: "TSImportType",
|
|
4296
|
+
source: null,
|
|
4295
4297
|
options: null,
|
|
4296
4298
|
qualifier: null,
|
|
4297
4299
|
typeArguments: null,
|
|
@@ -4299,10 +4301,10 @@ function deserializeTSImportType(pos) {
|
|
|
4299
4301
|
end,
|
|
4300
4302
|
range: [start, end],
|
|
4301
4303
|
};
|
|
4302
|
-
node.
|
|
4303
|
-
node.options = deserializeOptionBoxObjectExpression(pos +
|
|
4304
|
-
node.qualifier = deserializeOptionTSImportTypeQualifier(pos +
|
|
4305
|
-
node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos +
|
|
4304
|
+
node.source = deserializeStringLiteral(pos + 8);
|
|
4305
|
+
node.options = deserializeOptionBoxObjectExpression(pos + 56);
|
|
4306
|
+
node.qualifier = deserializeOptionTSImportTypeQualifier(pos + 64);
|
|
4307
|
+
node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 80);
|
|
4306
4308
|
return node;
|
|
4307
4309
|
}
|
|
4308
4310
|
|
|
@@ -4321,7 +4323,7 @@ function deserializeTSImportTypeQualifiedName(pos) {
|
|
|
4321
4323
|
let start = deserializeU32(pos),
|
|
4322
4324
|
end = deserializeU32(pos + 4),
|
|
4323
4325
|
node = {
|
|
4324
|
-
type:
|
|
4326
|
+
type: "TSQualifiedName",
|
|
4325
4327
|
left: null,
|
|
4326
4328
|
right: null,
|
|
4327
4329
|
start,
|
|
@@ -4337,7 +4339,7 @@ function deserializeTSFunctionType(pos) {
|
|
|
4337
4339
|
let start = deserializeU32(pos),
|
|
4338
4340
|
end = deserializeU32(pos + 4),
|
|
4339
4341
|
node = {
|
|
4340
|
-
type:
|
|
4342
|
+
type: "TSFunctionType",
|
|
4341
4343
|
typeParameters: null,
|
|
4342
4344
|
params: null,
|
|
4343
4345
|
returnType: null,
|
|
@@ -4358,7 +4360,7 @@ function deserializeTSConstructorType(pos) {
|
|
|
4358
4360
|
let start = deserializeU32(pos),
|
|
4359
4361
|
end = deserializeU32(pos + 4),
|
|
4360
4362
|
node = {
|
|
4361
|
-
type:
|
|
4363
|
+
type: "TSConstructorType",
|
|
4362
4364
|
abstract: deserializeBool(pos + 36),
|
|
4363
4365
|
typeParameters: null,
|
|
4364
4366
|
params: null,
|
|
@@ -4377,7 +4379,7 @@ function deserializeTSMappedType(pos) {
|
|
|
4377
4379
|
let start = deserializeU32(pos),
|
|
4378
4380
|
end = deserializeU32(pos + 4),
|
|
4379
4381
|
node = {
|
|
4380
|
-
type:
|
|
4382
|
+
type: "TSMappedType",
|
|
4381
4383
|
key: null,
|
|
4382
4384
|
constraint: null,
|
|
4383
4385
|
nameType: null,
|
|
@@ -4406,9 +4408,9 @@ function deserializeTSMappedTypeModifierOperator(pos) {
|
|
|
4406
4408
|
case 0:
|
|
4407
4409
|
return true;
|
|
4408
4410
|
case 1:
|
|
4409
|
-
return
|
|
4411
|
+
return "+";
|
|
4410
4412
|
case 2:
|
|
4411
|
-
return
|
|
4413
|
+
return "-";
|
|
4412
4414
|
default:
|
|
4413
4415
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSMappedTypeModifierOperator`);
|
|
4414
4416
|
}
|
|
@@ -4418,7 +4420,7 @@ function deserializeTSTemplateLiteralType(pos) {
|
|
|
4418
4420
|
let start = deserializeU32(pos),
|
|
4419
4421
|
end = deserializeU32(pos + 4),
|
|
4420
4422
|
node = {
|
|
4421
|
-
type:
|
|
4423
|
+
type: "TSTemplateLiteralType",
|
|
4422
4424
|
quasis: null,
|
|
4423
4425
|
types: null,
|
|
4424
4426
|
start,
|
|
@@ -4434,7 +4436,7 @@ function deserializeTSAsExpression(pos) {
|
|
|
4434
4436
|
let start = deserializeU32(pos),
|
|
4435
4437
|
end = deserializeU32(pos + 4),
|
|
4436
4438
|
node = {
|
|
4437
|
-
type:
|
|
4439
|
+
type: "TSAsExpression",
|
|
4438
4440
|
expression: null,
|
|
4439
4441
|
typeAnnotation: null,
|
|
4440
4442
|
start,
|
|
@@ -4450,7 +4452,7 @@ function deserializeTSSatisfiesExpression(pos) {
|
|
|
4450
4452
|
let start = deserializeU32(pos),
|
|
4451
4453
|
end = deserializeU32(pos + 4),
|
|
4452
4454
|
node = {
|
|
4453
|
-
type:
|
|
4455
|
+
type: "TSSatisfiesExpression",
|
|
4454
4456
|
expression: null,
|
|
4455
4457
|
typeAnnotation: null,
|
|
4456
4458
|
start,
|
|
@@ -4466,7 +4468,7 @@ function deserializeTSTypeAssertion(pos) {
|
|
|
4466
4468
|
let start = deserializeU32(pos),
|
|
4467
4469
|
end = deserializeU32(pos + 4),
|
|
4468
4470
|
node = {
|
|
4469
|
-
type:
|
|
4471
|
+
type: "TSTypeAssertion",
|
|
4470
4472
|
typeAnnotation: null,
|
|
4471
4473
|
expression: null,
|
|
4472
4474
|
start,
|
|
@@ -4482,7 +4484,7 @@ function deserializeTSImportEqualsDeclaration(pos) {
|
|
|
4482
4484
|
let start = deserializeU32(pos),
|
|
4483
4485
|
end = deserializeU32(pos + 4),
|
|
4484
4486
|
node = {
|
|
4485
|
-
type:
|
|
4487
|
+
type: "TSImportEqualsDeclaration",
|
|
4486
4488
|
id: null,
|
|
4487
4489
|
moduleReference: null,
|
|
4488
4490
|
importKind: deserializeImportOrExportKind(pos + 56),
|
|
@@ -4514,7 +4516,7 @@ function deserializeTSExternalModuleReference(pos) {
|
|
|
4514
4516
|
let start = deserializeU32(pos),
|
|
4515
4517
|
end = deserializeU32(pos + 4),
|
|
4516
4518
|
node = {
|
|
4517
|
-
type:
|
|
4519
|
+
type: "TSExternalModuleReference",
|
|
4518
4520
|
expression: null,
|
|
4519
4521
|
start,
|
|
4520
4522
|
end,
|
|
@@ -4528,7 +4530,7 @@ function deserializeTSNonNullExpression(pos) {
|
|
|
4528
4530
|
let start = deserializeU32(pos),
|
|
4529
4531
|
end = deserializeU32(pos + 4),
|
|
4530
4532
|
node = {
|
|
4531
|
-
type:
|
|
4533
|
+
type: "TSNonNullExpression",
|
|
4532
4534
|
expression: null,
|
|
4533
4535
|
start,
|
|
4534
4536
|
end,
|
|
@@ -4542,7 +4544,7 @@ function deserializeDecorator(pos) {
|
|
|
4542
4544
|
let start = deserializeU32(pos),
|
|
4543
4545
|
end = deserializeU32(pos + 4),
|
|
4544
4546
|
node = {
|
|
4545
|
-
type:
|
|
4547
|
+
type: "Decorator",
|
|
4546
4548
|
expression: null,
|
|
4547
4549
|
start,
|
|
4548
4550
|
end,
|
|
@@ -4556,7 +4558,7 @@ function deserializeTSExportAssignment(pos) {
|
|
|
4556
4558
|
let start = deserializeU32(pos),
|
|
4557
4559
|
end = deserializeU32(pos + 4),
|
|
4558
4560
|
node = {
|
|
4559
|
-
type:
|
|
4561
|
+
type: "TSExportAssignment",
|
|
4560
4562
|
expression: null,
|
|
4561
4563
|
start,
|
|
4562
4564
|
end,
|
|
@@ -4570,7 +4572,7 @@ function deserializeTSNamespaceExportDeclaration(pos) {
|
|
|
4570
4572
|
let start = deserializeU32(pos),
|
|
4571
4573
|
end = deserializeU32(pos + 4),
|
|
4572
4574
|
node = {
|
|
4573
|
-
type:
|
|
4575
|
+
type: "TSNamespaceExportDeclaration",
|
|
4574
4576
|
id: null,
|
|
4575
4577
|
start,
|
|
4576
4578
|
end,
|
|
@@ -4584,7 +4586,7 @@ function deserializeTSInstantiationExpression(pos) {
|
|
|
4584
4586
|
let start = deserializeU32(pos),
|
|
4585
4587
|
end = deserializeU32(pos + 4),
|
|
4586
4588
|
node = {
|
|
4587
|
-
type:
|
|
4589
|
+
type: "TSInstantiationExpression",
|
|
4588
4590
|
expression: null,
|
|
4589
4591
|
typeArguments: null,
|
|
4590
4592
|
start,
|
|
@@ -4599,9 +4601,9 @@ function deserializeTSInstantiationExpression(pos) {
|
|
|
4599
4601
|
function deserializeImportOrExportKind(pos) {
|
|
4600
4602
|
switch (uint8[pos]) {
|
|
4601
4603
|
case 0:
|
|
4602
|
-
return
|
|
4604
|
+
return "value";
|
|
4603
4605
|
case 1:
|
|
4604
|
-
return
|
|
4606
|
+
return "type";
|
|
4605
4607
|
default:
|
|
4606
4608
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ImportOrExportKind`);
|
|
4607
4609
|
}
|
|
@@ -4611,7 +4613,7 @@ function deserializeJSDocNullableType(pos) {
|
|
|
4611
4613
|
let start = deserializeU32(pos),
|
|
4612
4614
|
end = deserializeU32(pos + 4),
|
|
4613
4615
|
node = {
|
|
4614
|
-
type:
|
|
4616
|
+
type: "TSJSDocNullableType",
|
|
4615
4617
|
typeAnnotation: null,
|
|
4616
4618
|
postfix: deserializeBool(pos + 24),
|
|
4617
4619
|
start,
|
|
@@ -4626,7 +4628,7 @@ function deserializeJSDocNonNullableType(pos) {
|
|
|
4626
4628
|
let start = deserializeU32(pos),
|
|
4627
4629
|
end = deserializeU32(pos + 4),
|
|
4628
4630
|
node = {
|
|
4629
|
-
type:
|
|
4631
|
+
type: "TSJSDocNonNullableType",
|
|
4630
4632
|
typeAnnotation: null,
|
|
4631
4633
|
postfix: deserializeBool(pos + 24),
|
|
4632
4634
|
start,
|
|
@@ -4641,7 +4643,7 @@ function deserializeJSDocUnknownType(pos) {
|
|
|
4641
4643
|
let start = deserializeU32(pos),
|
|
4642
4644
|
end = deserializeU32(pos + 4);
|
|
4643
4645
|
return {
|
|
4644
|
-
type:
|
|
4646
|
+
type: "TSJSDocUnknownType",
|
|
4645
4647
|
start,
|
|
4646
4648
|
end,
|
|
4647
4649
|
range: [start, end],
|
|
@@ -4651,9 +4653,9 @@ function deserializeJSDocUnknownType(pos) {
|
|
|
4651
4653
|
function deserializeCommentKind(pos) {
|
|
4652
4654
|
switch (uint8[pos]) {
|
|
4653
4655
|
case 0:
|
|
4654
|
-
return
|
|
4656
|
+
return "Line";
|
|
4655
4657
|
case 1:
|
|
4656
|
-
return
|
|
4658
|
+
return "Block";
|
|
4657
4659
|
default:
|
|
4658
4660
|
throw Error(`Unexpected discriminant ${uint8[pos]} for CommentKind`);
|
|
4659
4661
|
}
|
|
@@ -4665,7 +4667,7 @@ function deserializeComment(pos) {
|
|
|
4665
4667
|
end = deserializeU32(pos + 4);
|
|
4666
4668
|
return {
|
|
4667
4669
|
type,
|
|
4668
|
-
value: sourceText.slice(start + 2, end - (type ===
|
|
4670
|
+
value: sourceText.slice(start + 2, end - (type === "Line" ? 0 : 2)),
|
|
4669
4671
|
start,
|
|
4670
4672
|
end,
|
|
4671
4673
|
range: [start, end],
|
|
@@ -4696,7 +4698,7 @@ function deserializeImportImportName(pos) {
|
|
|
4696
4698
|
case 0:
|
|
4697
4699
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4698
4700
|
return {
|
|
4699
|
-
kind:
|
|
4701
|
+
kind: "Name",
|
|
4700
4702
|
name: nameSpan.value,
|
|
4701
4703
|
start: nameSpan.start,
|
|
4702
4704
|
end: nameSpan.end,
|
|
@@ -4704,7 +4706,7 @@ function deserializeImportImportName(pos) {
|
|
|
4704
4706
|
};
|
|
4705
4707
|
case 1:
|
|
4706
4708
|
return {
|
|
4707
|
-
kind:
|
|
4709
|
+
kind: "NamespaceObject",
|
|
4708
4710
|
name: null,
|
|
4709
4711
|
start: null,
|
|
4710
4712
|
end: null,
|
|
@@ -4713,7 +4715,7 @@ function deserializeImportImportName(pos) {
|
|
|
4713
4715
|
case 2:
|
|
4714
4716
|
var { start, end } = deserializeSpan(pos + 8);
|
|
4715
4717
|
return {
|
|
4716
|
-
kind:
|
|
4718
|
+
kind: "Default",
|
|
4717
4719
|
name: null,
|
|
4718
4720
|
start,
|
|
4719
4721
|
end,
|
|
@@ -4744,7 +4746,7 @@ function deserializeExportImportName(pos) {
|
|
|
4744
4746
|
case 0:
|
|
4745
4747
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4746
4748
|
return {
|
|
4747
|
-
kind:
|
|
4749
|
+
kind: "Name",
|
|
4748
4750
|
name: nameSpan.value,
|
|
4749
4751
|
start: nameSpan.start,
|
|
4750
4752
|
end: nameSpan.end,
|
|
@@ -4752,7 +4754,7 @@ function deserializeExportImportName(pos) {
|
|
|
4752
4754
|
};
|
|
4753
4755
|
case 1:
|
|
4754
4756
|
return {
|
|
4755
|
-
kind:
|
|
4757
|
+
kind: "All",
|
|
4756
4758
|
name: null,
|
|
4757
4759
|
start: null,
|
|
4758
4760
|
end: null,
|
|
@@ -4760,7 +4762,7 @@ function deserializeExportImportName(pos) {
|
|
|
4760
4762
|
};
|
|
4761
4763
|
case 2:
|
|
4762
4764
|
return {
|
|
4763
|
-
kind:
|
|
4765
|
+
kind: "AllButDefault",
|
|
4764
4766
|
name: null,
|
|
4765
4767
|
start: null,
|
|
4766
4768
|
end: null,
|
|
@@ -4768,7 +4770,7 @@ function deserializeExportImportName(pos) {
|
|
|
4768
4770
|
};
|
|
4769
4771
|
case 3:
|
|
4770
4772
|
return {
|
|
4771
|
-
kind:
|
|
4773
|
+
kind: "None",
|
|
4772
4774
|
name: null,
|
|
4773
4775
|
start: null,
|
|
4774
4776
|
end: null,
|
|
@@ -4784,7 +4786,7 @@ function deserializeExportExportName(pos) {
|
|
|
4784
4786
|
case 0:
|
|
4785
4787
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4786
4788
|
return {
|
|
4787
|
-
kind:
|
|
4789
|
+
kind: "Name",
|
|
4788
4790
|
name: nameSpan.value,
|
|
4789
4791
|
start: nameSpan.start,
|
|
4790
4792
|
end: nameSpan.end,
|
|
@@ -4793,7 +4795,7 @@ function deserializeExportExportName(pos) {
|
|
|
4793
4795
|
case 1:
|
|
4794
4796
|
var { start, end } = deserializeSpan(pos + 8);
|
|
4795
4797
|
return {
|
|
4796
|
-
kind:
|
|
4798
|
+
kind: "Default",
|
|
4797
4799
|
name: null,
|
|
4798
4800
|
start,
|
|
4799
4801
|
end,
|
|
@@ -4801,7 +4803,7 @@ function deserializeExportExportName(pos) {
|
|
|
4801
4803
|
};
|
|
4802
4804
|
case 2:
|
|
4803
4805
|
return {
|
|
4804
|
-
kind:
|
|
4806
|
+
kind: "None",
|
|
4805
4807
|
name: null,
|
|
4806
4808
|
start: null,
|
|
4807
4809
|
end: null,
|
|
@@ -4817,7 +4819,7 @@ function deserializeExportLocalName(pos) {
|
|
|
4817
4819
|
case 0:
|
|
4818
4820
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4819
4821
|
return {
|
|
4820
|
-
kind:
|
|
4822
|
+
kind: "Name",
|
|
4821
4823
|
name: nameSpan.value,
|
|
4822
4824
|
start: nameSpan.start,
|
|
4823
4825
|
end: nameSpan.end,
|
|
@@ -4826,7 +4828,7 @@ function deserializeExportLocalName(pos) {
|
|
|
4826
4828
|
case 1:
|
|
4827
4829
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4828
4830
|
return {
|
|
4829
|
-
kind:
|
|
4831
|
+
kind: "Default",
|
|
4830
4832
|
name: nameSpan.value,
|
|
4831
4833
|
start: nameSpan.start,
|
|
4832
4834
|
end: nameSpan.end,
|
|
@@ -4834,7 +4836,7 @@ function deserializeExportLocalName(pos) {
|
|
|
4834
4836
|
};
|
|
4835
4837
|
case 2:
|
|
4836
4838
|
return {
|
|
4837
|
-
kind:
|
|
4839
|
+
kind: "None",
|
|
4838
4840
|
name: null,
|
|
4839
4841
|
start: null,
|
|
4840
4842
|
end: null,
|
|
@@ -4859,37 +4861,37 @@ function deserializeDynamicImport(pos) {
|
|
|
4859
4861
|
function deserializeAssignmentOperator(pos) {
|
|
4860
4862
|
switch (uint8[pos]) {
|
|
4861
4863
|
case 0:
|
|
4862
|
-
return
|
|
4864
|
+
return "=";
|
|
4863
4865
|
case 1:
|
|
4864
|
-
return
|
|
4866
|
+
return "+=";
|
|
4865
4867
|
case 2:
|
|
4866
|
-
return
|
|
4868
|
+
return "-=";
|
|
4867
4869
|
case 3:
|
|
4868
|
-
return
|
|
4870
|
+
return "*=";
|
|
4869
4871
|
case 4:
|
|
4870
|
-
return
|
|
4872
|
+
return "/=";
|
|
4871
4873
|
case 5:
|
|
4872
|
-
return
|
|
4874
|
+
return "%=";
|
|
4873
4875
|
case 6:
|
|
4874
|
-
return
|
|
4876
|
+
return "**=";
|
|
4875
4877
|
case 7:
|
|
4876
|
-
return
|
|
4878
|
+
return "<<=";
|
|
4877
4879
|
case 8:
|
|
4878
|
-
return
|
|
4880
|
+
return ">>=";
|
|
4879
4881
|
case 9:
|
|
4880
|
-
return
|
|
4882
|
+
return ">>>=";
|
|
4881
4883
|
case 10:
|
|
4882
|
-
return
|
|
4884
|
+
return "|=";
|
|
4883
4885
|
case 11:
|
|
4884
|
-
return
|
|
4886
|
+
return "^=";
|
|
4885
4887
|
case 12:
|
|
4886
|
-
return
|
|
4888
|
+
return "&=";
|
|
4887
4889
|
case 13:
|
|
4888
|
-
return
|
|
4890
|
+
return "||=";
|
|
4889
4891
|
case 14:
|
|
4890
|
-
return
|
|
4892
|
+
return "&&=";
|
|
4891
4893
|
case 15:
|
|
4892
|
-
return
|
|
4894
|
+
return "??=";
|
|
4893
4895
|
default:
|
|
4894
4896
|
throw Error(`Unexpected discriminant ${uint8[pos]} for AssignmentOperator`);
|
|
4895
4897
|
}
|
|
@@ -4898,49 +4900,49 @@ function deserializeAssignmentOperator(pos) {
|
|
|
4898
4900
|
function deserializeBinaryOperator(pos) {
|
|
4899
4901
|
switch (uint8[pos]) {
|
|
4900
4902
|
case 0:
|
|
4901
|
-
return
|
|
4903
|
+
return "==";
|
|
4902
4904
|
case 1:
|
|
4903
|
-
return
|
|
4905
|
+
return "!=";
|
|
4904
4906
|
case 2:
|
|
4905
|
-
return
|
|
4907
|
+
return "===";
|
|
4906
4908
|
case 3:
|
|
4907
|
-
return
|
|
4909
|
+
return "!==";
|
|
4908
4910
|
case 4:
|
|
4909
|
-
return
|
|
4911
|
+
return "<";
|
|
4910
4912
|
case 5:
|
|
4911
|
-
return
|
|
4913
|
+
return "<=";
|
|
4912
4914
|
case 6:
|
|
4913
|
-
return
|
|
4915
|
+
return ">";
|
|
4914
4916
|
case 7:
|
|
4915
|
-
return
|
|
4917
|
+
return ">=";
|
|
4916
4918
|
case 8:
|
|
4917
|
-
return
|
|
4919
|
+
return "+";
|
|
4918
4920
|
case 9:
|
|
4919
|
-
return
|
|
4921
|
+
return "-";
|
|
4920
4922
|
case 10:
|
|
4921
|
-
return
|
|
4923
|
+
return "*";
|
|
4922
4924
|
case 11:
|
|
4923
|
-
return
|
|
4925
|
+
return "/";
|
|
4924
4926
|
case 12:
|
|
4925
|
-
return
|
|
4927
|
+
return "%";
|
|
4926
4928
|
case 13:
|
|
4927
|
-
return
|
|
4929
|
+
return "**";
|
|
4928
4930
|
case 14:
|
|
4929
|
-
return
|
|
4931
|
+
return "<<";
|
|
4930
4932
|
case 15:
|
|
4931
|
-
return
|
|
4933
|
+
return ">>";
|
|
4932
4934
|
case 16:
|
|
4933
|
-
return
|
|
4935
|
+
return ">>>";
|
|
4934
4936
|
case 17:
|
|
4935
|
-
return
|
|
4937
|
+
return "|";
|
|
4936
4938
|
case 18:
|
|
4937
|
-
return
|
|
4939
|
+
return "^";
|
|
4938
4940
|
case 19:
|
|
4939
|
-
return
|
|
4941
|
+
return "&";
|
|
4940
4942
|
case 20:
|
|
4941
|
-
return
|
|
4943
|
+
return "in";
|
|
4942
4944
|
case 21:
|
|
4943
|
-
return
|
|
4945
|
+
return "instanceof";
|
|
4944
4946
|
default:
|
|
4945
4947
|
throw Error(`Unexpected discriminant ${uint8[pos]} for BinaryOperator`);
|
|
4946
4948
|
}
|
|
@@ -4949,11 +4951,11 @@ function deserializeBinaryOperator(pos) {
|
|
|
4949
4951
|
function deserializeLogicalOperator(pos) {
|
|
4950
4952
|
switch (uint8[pos]) {
|
|
4951
4953
|
case 0:
|
|
4952
|
-
return
|
|
4954
|
+
return "||";
|
|
4953
4955
|
case 1:
|
|
4954
|
-
return
|
|
4956
|
+
return "&&";
|
|
4955
4957
|
case 2:
|
|
4956
|
-
return
|
|
4958
|
+
return "??";
|
|
4957
4959
|
default:
|
|
4958
4960
|
throw Error(`Unexpected discriminant ${uint8[pos]} for LogicalOperator`);
|
|
4959
4961
|
}
|
|
@@ -4962,19 +4964,19 @@ function deserializeLogicalOperator(pos) {
|
|
|
4962
4964
|
function deserializeUnaryOperator(pos) {
|
|
4963
4965
|
switch (uint8[pos]) {
|
|
4964
4966
|
case 0:
|
|
4965
|
-
return
|
|
4967
|
+
return "+";
|
|
4966
4968
|
case 1:
|
|
4967
|
-
return
|
|
4969
|
+
return "-";
|
|
4968
4970
|
case 2:
|
|
4969
|
-
return
|
|
4971
|
+
return "!";
|
|
4970
4972
|
case 3:
|
|
4971
|
-
return
|
|
4973
|
+
return "~";
|
|
4972
4974
|
case 4:
|
|
4973
|
-
return
|
|
4975
|
+
return "typeof";
|
|
4974
4976
|
case 5:
|
|
4975
|
-
return
|
|
4977
|
+
return "void";
|
|
4976
4978
|
case 6:
|
|
4977
|
-
return
|
|
4979
|
+
return "delete";
|
|
4978
4980
|
default:
|
|
4979
4981
|
throw Error(`Unexpected discriminant ${uint8[pos]} for UnaryOperator`);
|
|
4980
4982
|
}
|
|
@@ -4983,9 +4985,9 @@ function deserializeUnaryOperator(pos) {
|
|
|
4983
4985
|
function deserializeUpdateOperator(pos) {
|
|
4984
4986
|
switch (uint8[pos]) {
|
|
4985
4987
|
case 0:
|
|
4986
|
-
return
|
|
4988
|
+
return "++";
|
|
4987
4989
|
case 1:
|
|
4988
|
-
return
|
|
4990
|
+
return "--";
|
|
4989
4991
|
default:
|
|
4990
4992
|
throw Error(`Unexpected discriminant ${uint8[pos]} for UpdateOperator`);
|
|
4991
4993
|
}
|
|
@@ -5001,9 +5003,9 @@ function deserializeSpan(pos) {
|
|
|
5001
5003
|
function deserializeModuleKind(pos) {
|
|
5002
5004
|
switch (uint8[pos]) {
|
|
5003
5005
|
case 0:
|
|
5004
|
-
return
|
|
5006
|
+
return "script";
|
|
5005
5007
|
case 1:
|
|
5006
|
-
return
|
|
5008
|
+
return "module";
|
|
5007
5009
|
default:
|
|
5008
5010
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ModuleKind`);
|
|
5009
5011
|
}
|
|
@@ -5031,11 +5033,11 @@ function deserializeError(pos) {
|
|
|
5031
5033
|
function deserializeErrorSeverity(pos) {
|
|
5032
5034
|
switch (uint8[pos]) {
|
|
5033
5035
|
case 0:
|
|
5034
|
-
return
|
|
5036
|
+
return "Error";
|
|
5035
5037
|
case 1:
|
|
5036
|
-
return
|
|
5038
|
+
return "Warning";
|
|
5037
5039
|
case 2:
|
|
5038
|
-
return
|
|
5040
|
+
return "Advice";
|
|
5039
5041
|
default:
|
|
5040
5042
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ErrorSeverity`);
|
|
5041
5043
|
}
|
|
@@ -5096,7 +5098,7 @@ function deserializeU8(pos) {
|
|
|
5096
5098
|
function deserializeStr(pos) {
|
|
5097
5099
|
let pos32 = pos >> 2,
|
|
5098
5100
|
len = uint32[pos32 + 2];
|
|
5099
|
-
if (len === 0) return
|
|
5101
|
+
if (len === 0) return "";
|
|
5100
5102
|
pos = uint32[pos32];
|
|
5101
5103
|
if (sourceIsAscii && pos < sourceByteLen) return sourceText.substr(pos, len);
|
|
5102
5104
|
// Longer strings use `TextDecoder`
|
|
@@ -5104,7 +5106,7 @@ function deserializeStr(pos) {
|
|
|
5104
5106
|
let end = pos + len;
|
|
5105
5107
|
if (len > 50) return decodeStr(uint8.subarray(pos, end));
|
|
5106
5108
|
// Shorter strings decode by hand to avoid native call
|
|
5107
|
-
let out =
|
|
5109
|
+
let out = "",
|
|
5108
5110
|
c;
|
|
5109
5111
|
do {
|
|
5110
5112
|
c = uint8[pos++];
|