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
|
|
|
@@ -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,
|
|
@@ -141,7 +141,7 @@ function deserializeIdentifierName(pos) {
|
|
|
141
141
|
let start = deserializeU32(pos),
|
|
142
142
|
end = deserializeU32(pos + 4);
|
|
143
143
|
return {
|
|
144
|
-
type:
|
|
144
|
+
type: "Identifier",
|
|
145
145
|
name: deserializeStr(pos + 8),
|
|
146
146
|
start,
|
|
147
147
|
end,
|
|
@@ -152,7 +152,7 @@ function deserializeIdentifierReference(pos) {
|
|
|
152
152
|
let start = deserializeU32(pos),
|
|
153
153
|
end = deserializeU32(pos + 4);
|
|
154
154
|
return {
|
|
155
|
-
type:
|
|
155
|
+
type: "Identifier",
|
|
156
156
|
name: deserializeStr(pos + 8),
|
|
157
157
|
start,
|
|
158
158
|
end,
|
|
@@ -163,7 +163,7 @@ function deserializeBindingIdentifier(pos) {
|
|
|
163
163
|
let start = deserializeU32(pos),
|
|
164
164
|
end = deserializeU32(pos + 4);
|
|
165
165
|
return {
|
|
166
|
-
type:
|
|
166
|
+
type: "Identifier",
|
|
167
167
|
name: deserializeStr(pos + 8),
|
|
168
168
|
start,
|
|
169
169
|
end,
|
|
@@ -174,7 +174,7 @@ function deserializeLabelIdentifier(pos) {
|
|
|
174
174
|
let start = deserializeU32(pos),
|
|
175
175
|
end = deserializeU32(pos + 4);
|
|
176
176
|
return {
|
|
177
|
-
type:
|
|
177
|
+
type: "Identifier",
|
|
178
178
|
name: deserializeStr(pos + 8),
|
|
179
179
|
start,
|
|
180
180
|
end,
|
|
@@ -183,7 +183,7 @@ function deserializeLabelIdentifier(pos) {
|
|
|
183
183
|
|
|
184
184
|
function deserializeThisExpression(pos) {
|
|
185
185
|
return {
|
|
186
|
-
type:
|
|
186
|
+
type: "ThisExpression",
|
|
187
187
|
start: deserializeU32(pos),
|
|
188
188
|
end: deserializeU32(pos + 4),
|
|
189
189
|
};
|
|
@@ -191,7 +191,7 @@ function deserializeThisExpression(pos) {
|
|
|
191
191
|
|
|
192
192
|
function deserializeArrayExpression(pos) {
|
|
193
193
|
let node = {
|
|
194
|
-
type:
|
|
194
|
+
type: "ArrayExpression",
|
|
195
195
|
elements: null,
|
|
196
196
|
start: deserializeU32(pos),
|
|
197
197
|
end: deserializeU32(pos + 4),
|
|
@@ -303,7 +303,7 @@ function deserializeElision(pos) {
|
|
|
303
303
|
|
|
304
304
|
function deserializeObjectExpression(pos) {
|
|
305
305
|
let node = {
|
|
306
|
-
type:
|
|
306
|
+
type: "ObjectExpression",
|
|
307
307
|
properties: null,
|
|
308
308
|
start: deserializeU32(pos),
|
|
309
309
|
end: deserializeU32(pos + 4),
|
|
@@ -327,7 +327,7 @@ function deserializeObjectProperty(pos) {
|
|
|
327
327
|
let start = deserializeU32(pos),
|
|
328
328
|
end = deserializeU32(pos + 4),
|
|
329
329
|
node = {
|
|
330
|
-
type:
|
|
330
|
+
type: "Property",
|
|
331
331
|
kind: deserializePropertyKind(pos + 40),
|
|
332
332
|
key: null,
|
|
333
333
|
value: null,
|
|
@@ -442,11 +442,11 @@ function deserializePropertyKey(pos) {
|
|
|
442
442
|
function deserializePropertyKind(pos) {
|
|
443
443
|
switch (uint8[pos]) {
|
|
444
444
|
case 0:
|
|
445
|
-
return
|
|
445
|
+
return "init";
|
|
446
446
|
case 1:
|
|
447
|
-
return
|
|
447
|
+
return "get";
|
|
448
448
|
case 2:
|
|
449
|
-
return
|
|
449
|
+
return "set";
|
|
450
450
|
default:
|
|
451
451
|
throw Error(`Unexpected discriminant ${uint8[pos]} for PropertyKind`);
|
|
452
452
|
}
|
|
@@ -454,7 +454,7 @@ function deserializePropertyKind(pos) {
|
|
|
454
454
|
|
|
455
455
|
function deserializeTemplateLiteral(pos) {
|
|
456
456
|
let node = {
|
|
457
|
-
type:
|
|
457
|
+
type: "TemplateLiteral",
|
|
458
458
|
quasis: null,
|
|
459
459
|
expressions: null,
|
|
460
460
|
start: deserializeU32(pos),
|
|
@@ -467,7 +467,7 @@ function deserializeTemplateLiteral(pos) {
|
|
|
467
467
|
|
|
468
468
|
function deserializeTaggedTemplateExpression(pos) {
|
|
469
469
|
let node = {
|
|
470
|
-
type:
|
|
470
|
+
type: "TaggedTemplateExpression",
|
|
471
471
|
tag: null,
|
|
472
472
|
quasi: null,
|
|
473
473
|
start: deserializeU32(pos),
|
|
@@ -485,9 +485,11 @@ function deserializeTemplateElement(pos) {
|
|
|
485
485
|
value = deserializeTemplateElementValue(pos + 8);
|
|
486
486
|
value.cooked !== null &&
|
|
487
487
|
deserializeBool(pos + 41) &&
|
|
488
|
-
(value.cooked = value.cooked.replace(/\uFFFD(.{4})/g, (_, hex) =>
|
|
488
|
+
(value.cooked = value.cooked.replace(/\uFFFD(.{4})/g, (_, hex) =>
|
|
489
|
+
String.fromCodePoint(parseInt(hex, 16)),
|
|
490
|
+
));
|
|
489
491
|
return {
|
|
490
|
-
type:
|
|
492
|
+
type: "TemplateElement",
|
|
491
493
|
value,
|
|
492
494
|
tail,
|
|
493
495
|
start,
|
|
@@ -506,7 +508,7 @@ function deserializeComputedMemberExpression(pos) {
|
|
|
506
508
|
let start = deserializeU32(pos),
|
|
507
509
|
end = deserializeU32(pos + 4),
|
|
508
510
|
node = {
|
|
509
|
-
type:
|
|
511
|
+
type: "MemberExpression",
|
|
510
512
|
object: null,
|
|
511
513
|
property: null,
|
|
512
514
|
optional: deserializeBool(pos + 40),
|
|
@@ -524,7 +526,7 @@ function deserializeStaticMemberExpression(pos) {
|
|
|
524
526
|
let start = deserializeU32(pos),
|
|
525
527
|
end = deserializeU32(pos + 4),
|
|
526
528
|
node = {
|
|
527
|
-
type:
|
|
529
|
+
type: "MemberExpression",
|
|
528
530
|
object: null,
|
|
529
531
|
property: null,
|
|
530
532
|
optional: deserializeBool(pos + 48),
|
|
@@ -542,7 +544,7 @@ function deserializePrivateFieldExpression(pos) {
|
|
|
542
544
|
let start = deserializeU32(pos),
|
|
543
545
|
end = deserializeU32(pos + 4),
|
|
544
546
|
node = {
|
|
545
|
-
type:
|
|
547
|
+
type: "MemberExpression",
|
|
546
548
|
object: null,
|
|
547
549
|
property: null,
|
|
548
550
|
optional: deserializeBool(pos + 48),
|
|
@@ -560,7 +562,7 @@ function deserializeCallExpression(pos) {
|
|
|
560
562
|
let start = deserializeU32(pos),
|
|
561
563
|
end = deserializeU32(pos + 4),
|
|
562
564
|
node = {
|
|
563
|
-
type:
|
|
565
|
+
type: "CallExpression",
|
|
564
566
|
callee: null,
|
|
565
567
|
arguments: null,
|
|
566
568
|
optional: deserializeBool(pos + 56),
|
|
@@ -574,7 +576,7 @@ function deserializeCallExpression(pos) {
|
|
|
574
576
|
|
|
575
577
|
function deserializeNewExpression(pos) {
|
|
576
578
|
let node = {
|
|
577
|
-
type:
|
|
579
|
+
type: "NewExpression",
|
|
578
580
|
callee: null,
|
|
579
581
|
arguments: null,
|
|
580
582
|
start: deserializeU32(pos),
|
|
@@ -587,7 +589,7 @@ function deserializeNewExpression(pos) {
|
|
|
587
589
|
|
|
588
590
|
function deserializeMetaProperty(pos) {
|
|
589
591
|
let node = {
|
|
590
|
-
type:
|
|
592
|
+
type: "MetaProperty",
|
|
591
593
|
meta: null,
|
|
592
594
|
property: null,
|
|
593
595
|
start: deserializeU32(pos),
|
|
@@ -600,7 +602,7 @@ function deserializeMetaProperty(pos) {
|
|
|
600
602
|
|
|
601
603
|
function deserializeSpreadElement(pos) {
|
|
602
604
|
let node = {
|
|
603
|
-
type:
|
|
605
|
+
type: "SpreadElement",
|
|
604
606
|
argument: null,
|
|
605
607
|
start: deserializeU32(pos),
|
|
606
608
|
end: deserializeU32(pos + 4),
|
|
@@ -708,7 +710,7 @@ function deserializeUpdateExpression(pos) {
|
|
|
708
710
|
let start = deserializeU32(pos),
|
|
709
711
|
end = deserializeU32(pos + 4),
|
|
710
712
|
node = {
|
|
711
|
-
type:
|
|
713
|
+
type: "UpdateExpression",
|
|
712
714
|
operator: deserializeUpdateOperator(pos + 24),
|
|
713
715
|
prefix: deserializeBool(pos + 25),
|
|
714
716
|
argument: null,
|
|
@@ -723,7 +725,7 @@ function deserializeUnaryExpression(pos) {
|
|
|
723
725
|
let start = deserializeU32(pos),
|
|
724
726
|
end = deserializeU32(pos + 4),
|
|
725
727
|
node = {
|
|
726
|
-
type:
|
|
728
|
+
type: "UnaryExpression",
|
|
727
729
|
operator: deserializeUnaryOperator(pos + 24),
|
|
728
730
|
argument: null,
|
|
729
731
|
prefix: null,
|
|
@@ -739,7 +741,7 @@ function deserializeBinaryExpression(pos) {
|
|
|
739
741
|
let start = deserializeU32(pos),
|
|
740
742
|
end = deserializeU32(pos + 4),
|
|
741
743
|
node = {
|
|
742
|
-
type:
|
|
744
|
+
type: "BinaryExpression",
|
|
743
745
|
left: null,
|
|
744
746
|
operator: deserializeBinaryOperator(pos + 40),
|
|
745
747
|
right: null,
|
|
@@ -753,7 +755,7 @@ function deserializeBinaryExpression(pos) {
|
|
|
753
755
|
|
|
754
756
|
function deserializePrivateInExpression(pos) {
|
|
755
757
|
let node = {
|
|
756
|
-
type:
|
|
758
|
+
type: "BinaryExpression",
|
|
757
759
|
left: null,
|
|
758
760
|
operator: null,
|
|
759
761
|
right: null,
|
|
@@ -761,7 +763,7 @@ function deserializePrivateInExpression(pos) {
|
|
|
761
763
|
end: deserializeU32(pos + 4),
|
|
762
764
|
};
|
|
763
765
|
node.left = deserializePrivateIdentifier(pos + 8);
|
|
764
|
-
node.operator =
|
|
766
|
+
node.operator = "in";
|
|
765
767
|
node.right = deserializeExpression(pos + 32);
|
|
766
768
|
return node;
|
|
767
769
|
}
|
|
@@ -770,7 +772,7 @@ function deserializeLogicalExpression(pos) {
|
|
|
770
772
|
let start = deserializeU32(pos),
|
|
771
773
|
end = deserializeU32(pos + 4),
|
|
772
774
|
node = {
|
|
773
|
-
type:
|
|
775
|
+
type: "LogicalExpression",
|
|
774
776
|
left: null,
|
|
775
777
|
operator: deserializeLogicalOperator(pos + 40),
|
|
776
778
|
right: null,
|
|
@@ -784,7 +786,7 @@ function deserializeLogicalExpression(pos) {
|
|
|
784
786
|
|
|
785
787
|
function deserializeConditionalExpression(pos) {
|
|
786
788
|
let node = {
|
|
787
|
-
type:
|
|
789
|
+
type: "ConditionalExpression",
|
|
788
790
|
test: null,
|
|
789
791
|
consequent: null,
|
|
790
792
|
alternate: null,
|
|
@@ -801,7 +803,7 @@ function deserializeAssignmentExpression(pos) {
|
|
|
801
803
|
let start = deserializeU32(pos),
|
|
802
804
|
end = deserializeU32(pos + 4),
|
|
803
805
|
node = {
|
|
804
|
-
type:
|
|
806
|
+
type: "AssignmentExpression",
|
|
805
807
|
operator: deserializeAssignmentOperator(pos + 40),
|
|
806
808
|
left: null,
|
|
807
809
|
right: null,
|
|
@@ -865,7 +867,7 @@ function deserializeSimpleAssignmentTarget(pos) {
|
|
|
865
867
|
|
|
866
868
|
function deserializeArrayAssignmentTarget(pos) {
|
|
867
869
|
let node = {
|
|
868
|
-
type:
|
|
870
|
+
type: "ArrayPattern",
|
|
869
871
|
elements: null,
|
|
870
872
|
start: deserializeU32(pos),
|
|
871
873
|
end: deserializeU32(pos + 4),
|
|
@@ -879,7 +881,7 @@ function deserializeArrayAssignmentTarget(pos) {
|
|
|
879
881
|
|
|
880
882
|
function deserializeObjectAssignmentTarget(pos) {
|
|
881
883
|
let node = {
|
|
882
|
-
type:
|
|
884
|
+
type: "ObjectPattern",
|
|
883
885
|
properties: null,
|
|
884
886
|
start: deserializeU32(pos),
|
|
885
887
|
end: deserializeU32(pos + 4),
|
|
@@ -893,7 +895,7 @@ function deserializeObjectAssignmentTarget(pos) {
|
|
|
893
895
|
|
|
894
896
|
function deserializeAssignmentTargetRest(pos) {
|
|
895
897
|
let node = {
|
|
896
|
-
type:
|
|
898
|
+
type: "RestElement",
|
|
897
899
|
argument: null,
|
|
898
900
|
start: deserializeU32(pos),
|
|
899
901
|
end: deserializeU32(pos + 4),
|
|
@@ -933,7 +935,7 @@ function deserializeAssignmentTargetMaybeDefault(pos) {
|
|
|
933
935
|
|
|
934
936
|
function deserializeAssignmentTargetWithDefault(pos) {
|
|
935
937
|
let node = {
|
|
936
|
-
type:
|
|
938
|
+
type: "AssignmentPattern",
|
|
937
939
|
left: null,
|
|
938
940
|
right: null,
|
|
939
941
|
start: deserializeU32(pos),
|
|
@@ -959,7 +961,7 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
959
961
|
let start = deserializeU32(pos),
|
|
960
962
|
end = deserializeU32(pos + 4),
|
|
961
963
|
node = {
|
|
962
|
-
type:
|
|
964
|
+
type: "Property",
|
|
963
965
|
kind: null,
|
|
964
966
|
key: null,
|
|
965
967
|
value: null,
|
|
@@ -971,7 +973,7 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
971
973
|
},
|
|
972
974
|
key = deserializeIdentifierReference(pos + 8),
|
|
973
975
|
value = {
|
|
974
|
-
type:
|
|
976
|
+
type: "Identifier",
|
|
975
977
|
name: key.name,
|
|
976
978
|
start: key.start,
|
|
977
979
|
end: key.end,
|
|
@@ -979,13 +981,13 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
|
|
|
979
981
|
init = deserializeOptionExpression(pos + 40);
|
|
980
982
|
init !== null &&
|
|
981
983
|
(value = {
|
|
982
|
-
type:
|
|
984
|
+
type: "AssignmentPattern",
|
|
983
985
|
left: value,
|
|
984
986
|
right: init,
|
|
985
987
|
start,
|
|
986
988
|
end,
|
|
987
989
|
});
|
|
988
|
-
node.kind =
|
|
990
|
+
node.kind = "init";
|
|
989
991
|
node.key = key;
|
|
990
992
|
node.value = value;
|
|
991
993
|
node.method = false;
|
|
@@ -998,7 +1000,7 @@ function deserializeAssignmentTargetPropertyProperty(pos) {
|
|
|
998
1000
|
let start = deserializeU32(pos),
|
|
999
1001
|
end = deserializeU32(pos + 4),
|
|
1000
1002
|
node = {
|
|
1001
|
-
type:
|
|
1003
|
+
type: "Property",
|
|
1002
1004
|
kind: null,
|
|
1003
1005
|
key: null,
|
|
1004
1006
|
value: null,
|
|
@@ -1008,7 +1010,7 @@ function deserializeAssignmentTargetPropertyProperty(pos) {
|
|
|
1008
1010
|
start,
|
|
1009
1011
|
end,
|
|
1010
1012
|
};
|
|
1011
|
-
node.kind =
|
|
1013
|
+
node.kind = "init";
|
|
1012
1014
|
node.key = deserializePropertyKey(pos + 8);
|
|
1013
1015
|
node.value = deserializeAssignmentTargetMaybeDefault(pos + 24);
|
|
1014
1016
|
node.method = false;
|
|
@@ -1018,7 +1020,7 @@ function deserializeAssignmentTargetPropertyProperty(pos) {
|
|
|
1018
1020
|
|
|
1019
1021
|
function deserializeSequenceExpression(pos) {
|
|
1020
1022
|
let node = {
|
|
1021
|
-
type:
|
|
1023
|
+
type: "SequenceExpression",
|
|
1022
1024
|
expressions: null,
|
|
1023
1025
|
start: deserializeU32(pos),
|
|
1024
1026
|
end: deserializeU32(pos + 4),
|
|
@@ -1029,7 +1031,7 @@ function deserializeSequenceExpression(pos) {
|
|
|
1029
1031
|
|
|
1030
1032
|
function deserializeSuper(pos) {
|
|
1031
1033
|
return {
|
|
1032
|
-
type:
|
|
1034
|
+
type: "Super",
|
|
1033
1035
|
start: deserializeU32(pos),
|
|
1034
1036
|
end: deserializeU32(pos + 4),
|
|
1035
1037
|
};
|
|
@@ -1037,7 +1039,7 @@ function deserializeSuper(pos) {
|
|
|
1037
1039
|
|
|
1038
1040
|
function deserializeAwaitExpression(pos) {
|
|
1039
1041
|
let node = {
|
|
1040
|
-
type:
|
|
1042
|
+
type: "AwaitExpression",
|
|
1041
1043
|
argument: null,
|
|
1042
1044
|
start: deserializeU32(pos),
|
|
1043
1045
|
end: deserializeU32(pos + 4),
|
|
@@ -1048,7 +1050,7 @@ function deserializeAwaitExpression(pos) {
|
|
|
1048
1050
|
|
|
1049
1051
|
function deserializeChainExpression(pos) {
|
|
1050
1052
|
let node = {
|
|
1051
|
-
type:
|
|
1053
|
+
type: "ChainExpression",
|
|
1052
1054
|
expression: null,
|
|
1053
1055
|
start: deserializeU32(pos),
|
|
1054
1056
|
end: deserializeU32(pos + 4),
|
|
@@ -1077,7 +1079,7 @@ function deserializeChainElement(pos) {
|
|
|
1077
1079
|
function deserializeParenthesizedExpression(pos) {
|
|
1078
1080
|
let node;
|
|
1079
1081
|
node = {
|
|
1080
|
-
type:
|
|
1082
|
+
type: "ParenthesizedExpression",
|
|
1081
1083
|
expression: null,
|
|
1082
1084
|
start: deserializeU32(pos),
|
|
1083
1085
|
end: deserializeU32(pos + 4),
|
|
@@ -1163,7 +1165,7 @@ function deserializeDirective(pos) {
|
|
|
1163
1165
|
let start = deserializeU32(pos),
|
|
1164
1166
|
end = deserializeU32(pos + 4),
|
|
1165
1167
|
node = {
|
|
1166
|
-
type:
|
|
1168
|
+
type: "ExpressionStatement",
|
|
1167
1169
|
expression: null,
|
|
1168
1170
|
directive: deserializeStr(pos + 56),
|
|
1169
1171
|
start,
|
|
@@ -1177,7 +1179,7 @@ function deserializeHashbang(pos) {
|
|
|
1177
1179
|
let start = deserializeU32(pos),
|
|
1178
1180
|
end = deserializeU32(pos + 4);
|
|
1179
1181
|
return {
|
|
1180
|
-
type:
|
|
1182
|
+
type: "Hashbang",
|
|
1181
1183
|
value: deserializeStr(pos + 8),
|
|
1182
1184
|
start,
|
|
1183
1185
|
end,
|
|
@@ -1186,7 +1188,7 @@ function deserializeHashbang(pos) {
|
|
|
1186
1188
|
|
|
1187
1189
|
function deserializeBlockStatement(pos) {
|
|
1188
1190
|
let node = {
|
|
1189
|
-
type:
|
|
1191
|
+
type: "BlockStatement",
|
|
1190
1192
|
body: null,
|
|
1191
1193
|
start: deserializeU32(pos),
|
|
1192
1194
|
end: deserializeU32(pos + 4),
|
|
@@ -1224,7 +1226,7 @@ function deserializeVariableDeclaration(pos) {
|
|
|
1224
1226
|
let start = deserializeU32(pos),
|
|
1225
1227
|
end = deserializeU32(pos + 4),
|
|
1226
1228
|
node = {
|
|
1227
|
-
type:
|
|
1229
|
+
type: "VariableDeclaration",
|
|
1228
1230
|
kind: deserializeVariableDeclarationKind(pos + 32),
|
|
1229
1231
|
declarations: null,
|
|
1230
1232
|
start,
|
|
@@ -1237,15 +1239,15 @@ function deserializeVariableDeclaration(pos) {
|
|
|
1237
1239
|
function deserializeVariableDeclarationKind(pos) {
|
|
1238
1240
|
switch (uint8[pos]) {
|
|
1239
1241
|
case 0:
|
|
1240
|
-
return
|
|
1242
|
+
return "var";
|
|
1241
1243
|
case 1:
|
|
1242
|
-
return
|
|
1244
|
+
return "let";
|
|
1243
1245
|
case 2:
|
|
1244
|
-
return
|
|
1246
|
+
return "const";
|
|
1245
1247
|
case 3:
|
|
1246
|
-
return
|
|
1248
|
+
return "using";
|
|
1247
1249
|
case 4:
|
|
1248
|
-
return
|
|
1250
|
+
return "await using";
|
|
1249
1251
|
default:
|
|
1250
1252
|
throw Error(`Unexpected discriminant ${uint8[pos]} for VariableDeclarationKind`);
|
|
1251
1253
|
}
|
|
@@ -1253,7 +1255,7 @@ function deserializeVariableDeclarationKind(pos) {
|
|
|
1253
1255
|
|
|
1254
1256
|
function deserializeVariableDeclarator(pos) {
|
|
1255
1257
|
let node = {
|
|
1256
|
-
type:
|
|
1258
|
+
type: "VariableDeclarator",
|
|
1257
1259
|
id: null,
|
|
1258
1260
|
init: null,
|
|
1259
1261
|
start: deserializeU32(pos),
|
|
@@ -1266,7 +1268,7 @@ function deserializeVariableDeclarator(pos) {
|
|
|
1266
1268
|
|
|
1267
1269
|
function deserializeEmptyStatement(pos) {
|
|
1268
1270
|
return {
|
|
1269
|
-
type:
|
|
1271
|
+
type: "EmptyStatement",
|
|
1270
1272
|
start: deserializeU32(pos),
|
|
1271
1273
|
end: deserializeU32(pos + 4),
|
|
1272
1274
|
};
|
|
@@ -1274,7 +1276,7 @@ function deserializeEmptyStatement(pos) {
|
|
|
1274
1276
|
|
|
1275
1277
|
function deserializeExpressionStatement(pos) {
|
|
1276
1278
|
let node = {
|
|
1277
|
-
type:
|
|
1279
|
+
type: "ExpressionStatement",
|
|
1278
1280
|
expression: null,
|
|
1279
1281
|
start: deserializeU32(pos),
|
|
1280
1282
|
end: deserializeU32(pos + 4),
|
|
@@ -1285,7 +1287,7 @@ function deserializeExpressionStatement(pos) {
|
|
|
1285
1287
|
|
|
1286
1288
|
function deserializeIfStatement(pos) {
|
|
1287
1289
|
let node = {
|
|
1288
|
-
type:
|
|
1290
|
+
type: "IfStatement",
|
|
1289
1291
|
test: null,
|
|
1290
1292
|
consequent: null,
|
|
1291
1293
|
alternate: null,
|
|
@@ -1300,7 +1302,7 @@ function deserializeIfStatement(pos) {
|
|
|
1300
1302
|
|
|
1301
1303
|
function deserializeDoWhileStatement(pos) {
|
|
1302
1304
|
let node = {
|
|
1303
|
-
type:
|
|
1305
|
+
type: "DoWhileStatement",
|
|
1304
1306
|
body: null,
|
|
1305
1307
|
test: null,
|
|
1306
1308
|
start: deserializeU32(pos),
|
|
@@ -1313,7 +1315,7 @@ function deserializeDoWhileStatement(pos) {
|
|
|
1313
1315
|
|
|
1314
1316
|
function deserializeWhileStatement(pos) {
|
|
1315
1317
|
let node = {
|
|
1316
|
-
type:
|
|
1318
|
+
type: "WhileStatement",
|
|
1317
1319
|
test: null,
|
|
1318
1320
|
body: null,
|
|
1319
1321
|
start: deserializeU32(pos),
|
|
@@ -1326,7 +1328,7 @@ function deserializeWhileStatement(pos) {
|
|
|
1326
1328
|
|
|
1327
1329
|
function deserializeForStatement(pos) {
|
|
1328
1330
|
let node = {
|
|
1329
|
-
type:
|
|
1331
|
+
type: "ForStatement",
|
|
1330
1332
|
init: null,
|
|
1331
1333
|
test: null,
|
|
1332
1334
|
update: null,
|
|
@@ -1438,7 +1440,7 @@ function deserializeForStatementInit(pos) {
|
|
|
1438
1440
|
|
|
1439
1441
|
function deserializeForInStatement(pos) {
|
|
1440
1442
|
let node = {
|
|
1441
|
-
type:
|
|
1443
|
+
type: "ForInStatement",
|
|
1442
1444
|
left: null,
|
|
1443
1445
|
right: null,
|
|
1444
1446
|
body: null,
|
|
@@ -1484,7 +1486,7 @@ function deserializeForOfStatement(pos) {
|
|
|
1484
1486
|
let start = deserializeU32(pos),
|
|
1485
1487
|
end = deserializeU32(pos + 4),
|
|
1486
1488
|
node = {
|
|
1487
|
-
type:
|
|
1489
|
+
type: "ForOfStatement",
|
|
1488
1490
|
await: deserializeBool(pos + 60),
|
|
1489
1491
|
left: null,
|
|
1490
1492
|
right: null,
|
|
@@ -1500,7 +1502,7 @@ function deserializeForOfStatement(pos) {
|
|
|
1500
1502
|
|
|
1501
1503
|
function deserializeContinueStatement(pos) {
|
|
1502
1504
|
let node = {
|
|
1503
|
-
type:
|
|
1505
|
+
type: "ContinueStatement",
|
|
1504
1506
|
label: null,
|
|
1505
1507
|
start: deserializeU32(pos),
|
|
1506
1508
|
end: deserializeU32(pos + 4),
|
|
@@ -1511,7 +1513,7 @@ function deserializeContinueStatement(pos) {
|
|
|
1511
1513
|
|
|
1512
1514
|
function deserializeBreakStatement(pos) {
|
|
1513
1515
|
let node = {
|
|
1514
|
-
type:
|
|
1516
|
+
type: "BreakStatement",
|
|
1515
1517
|
label: null,
|
|
1516
1518
|
start: deserializeU32(pos),
|
|
1517
1519
|
end: deserializeU32(pos + 4),
|
|
@@ -1522,7 +1524,7 @@ function deserializeBreakStatement(pos) {
|
|
|
1522
1524
|
|
|
1523
1525
|
function deserializeReturnStatement(pos) {
|
|
1524
1526
|
let node = {
|
|
1525
|
-
type:
|
|
1527
|
+
type: "ReturnStatement",
|
|
1526
1528
|
argument: null,
|
|
1527
1529
|
start: deserializeU32(pos),
|
|
1528
1530
|
end: deserializeU32(pos + 4),
|
|
@@ -1533,7 +1535,7 @@ function deserializeReturnStatement(pos) {
|
|
|
1533
1535
|
|
|
1534
1536
|
function deserializeWithStatement(pos) {
|
|
1535
1537
|
let node = {
|
|
1536
|
-
type:
|
|
1538
|
+
type: "WithStatement",
|
|
1537
1539
|
object: null,
|
|
1538
1540
|
body: null,
|
|
1539
1541
|
start: deserializeU32(pos),
|
|
@@ -1546,7 +1548,7 @@ function deserializeWithStatement(pos) {
|
|
|
1546
1548
|
|
|
1547
1549
|
function deserializeSwitchStatement(pos) {
|
|
1548
1550
|
let node = {
|
|
1549
|
-
type:
|
|
1551
|
+
type: "SwitchStatement",
|
|
1550
1552
|
discriminant: null,
|
|
1551
1553
|
cases: null,
|
|
1552
1554
|
start: deserializeU32(pos),
|
|
@@ -1559,7 +1561,7 @@ function deserializeSwitchStatement(pos) {
|
|
|
1559
1561
|
|
|
1560
1562
|
function deserializeSwitchCase(pos) {
|
|
1561
1563
|
let node = {
|
|
1562
|
-
type:
|
|
1564
|
+
type: "SwitchCase",
|
|
1563
1565
|
test: null,
|
|
1564
1566
|
consequent: null,
|
|
1565
1567
|
start: deserializeU32(pos),
|
|
@@ -1572,7 +1574,7 @@ function deserializeSwitchCase(pos) {
|
|
|
1572
1574
|
|
|
1573
1575
|
function deserializeLabeledStatement(pos) {
|
|
1574
1576
|
let node = {
|
|
1575
|
-
type:
|
|
1577
|
+
type: "LabeledStatement",
|
|
1576
1578
|
label: null,
|
|
1577
1579
|
body: null,
|
|
1578
1580
|
start: deserializeU32(pos),
|
|
@@ -1585,7 +1587,7 @@ function deserializeLabeledStatement(pos) {
|
|
|
1585
1587
|
|
|
1586
1588
|
function deserializeThrowStatement(pos) {
|
|
1587
1589
|
let node = {
|
|
1588
|
-
type:
|
|
1590
|
+
type: "ThrowStatement",
|
|
1589
1591
|
argument: null,
|
|
1590
1592
|
start: deserializeU32(pos),
|
|
1591
1593
|
end: deserializeU32(pos + 4),
|
|
@@ -1596,7 +1598,7 @@ function deserializeThrowStatement(pos) {
|
|
|
1596
1598
|
|
|
1597
1599
|
function deserializeTryStatement(pos) {
|
|
1598
1600
|
let node = {
|
|
1599
|
-
type:
|
|
1601
|
+
type: "TryStatement",
|
|
1600
1602
|
block: null,
|
|
1601
1603
|
handler: null,
|
|
1602
1604
|
finalizer: null,
|
|
@@ -1611,7 +1613,7 @@ function deserializeTryStatement(pos) {
|
|
|
1611
1613
|
|
|
1612
1614
|
function deserializeCatchClause(pos) {
|
|
1613
1615
|
let node = {
|
|
1614
|
-
type:
|
|
1616
|
+
type: "CatchClause",
|
|
1615
1617
|
param: null,
|
|
1616
1618
|
body: null,
|
|
1617
1619
|
start: deserializeU32(pos),
|
|
@@ -1628,7 +1630,7 @@ function deserializeCatchParameter(pos) {
|
|
|
1628
1630
|
|
|
1629
1631
|
function deserializeDebuggerStatement(pos) {
|
|
1630
1632
|
return {
|
|
1631
|
-
type:
|
|
1633
|
+
type: "DebuggerStatement",
|
|
1632
1634
|
start: deserializeU32(pos),
|
|
1633
1635
|
end: deserializeU32(pos + 4),
|
|
1634
1636
|
};
|
|
@@ -1655,7 +1657,7 @@ function deserializeBindingPatternKind(pos) {
|
|
|
1655
1657
|
|
|
1656
1658
|
function deserializeAssignmentPattern(pos) {
|
|
1657
1659
|
let node = {
|
|
1658
|
-
type:
|
|
1660
|
+
type: "AssignmentPattern",
|
|
1659
1661
|
left: null,
|
|
1660
1662
|
right: null,
|
|
1661
1663
|
start: deserializeU32(pos),
|
|
@@ -1668,7 +1670,7 @@ function deserializeAssignmentPattern(pos) {
|
|
|
1668
1670
|
|
|
1669
1671
|
function deserializeObjectPattern(pos) {
|
|
1670
1672
|
let node = {
|
|
1671
|
-
type:
|
|
1673
|
+
type: "ObjectPattern",
|
|
1672
1674
|
properties: null,
|
|
1673
1675
|
start: deserializeU32(pos),
|
|
1674
1676
|
end: deserializeU32(pos + 4),
|
|
@@ -1684,7 +1686,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1684
1686
|
let start = deserializeU32(pos),
|
|
1685
1687
|
end = deserializeU32(pos + 4),
|
|
1686
1688
|
node = {
|
|
1687
|
-
type:
|
|
1689
|
+
type: "Property",
|
|
1688
1690
|
kind: null,
|
|
1689
1691
|
key: null,
|
|
1690
1692
|
value: null,
|
|
@@ -1694,7 +1696,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1694
1696
|
start,
|
|
1695
1697
|
end,
|
|
1696
1698
|
};
|
|
1697
|
-
node.kind =
|
|
1699
|
+
node.kind = "init";
|
|
1698
1700
|
node.key = deserializePropertyKey(pos + 8);
|
|
1699
1701
|
node.value = deserializeBindingPattern(pos + 24);
|
|
1700
1702
|
node.method = false;
|
|
@@ -1703,7 +1705,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1703
1705
|
|
|
1704
1706
|
function deserializeArrayPattern(pos) {
|
|
1705
1707
|
let node = {
|
|
1706
|
-
type:
|
|
1708
|
+
type: "ArrayPattern",
|
|
1707
1709
|
elements: null,
|
|
1708
1710
|
start: deserializeU32(pos),
|
|
1709
1711
|
end: deserializeU32(pos + 4),
|
|
@@ -1717,7 +1719,7 @@ function deserializeArrayPattern(pos) {
|
|
|
1717
1719
|
|
|
1718
1720
|
function deserializeBindingRestElement(pos) {
|
|
1719
1721
|
let node = {
|
|
1720
|
-
type:
|
|
1722
|
+
type: "RestElement",
|
|
1721
1723
|
argument: null,
|
|
1722
1724
|
start: deserializeU32(pos),
|
|
1723
1725
|
end: deserializeU32(pos + 4),
|
|
@@ -1751,13 +1753,13 @@ function deserializeFunction(pos) {
|
|
|
1751
1753
|
function deserializeFunctionType(pos) {
|
|
1752
1754
|
switch (uint8[pos]) {
|
|
1753
1755
|
case 0:
|
|
1754
|
-
return
|
|
1756
|
+
return "FunctionDeclaration";
|
|
1755
1757
|
case 1:
|
|
1756
|
-
return
|
|
1758
|
+
return "FunctionExpression";
|
|
1757
1759
|
case 2:
|
|
1758
|
-
return
|
|
1760
|
+
return "TSDeclareFunction";
|
|
1759
1761
|
case 3:
|
|
1760
|
-
return
|
|
1762
|
+
return "TSEmptyBodyFunctionExpression";
|
|
1761
1763
|
default:
|
|
1762
1764
|
throw Error(`Unexpected discriminant ${uint8[pos]} for FunctionType`);
|
|
1763
1765
|
}
|
|
@@ -1768,7 +1770,7 @@ function deserializeFormalParameters(pos) {
|
|
|
1768
1770
|
if (uint32[(pos + 32) >> 2] !== 0 && uint32[(pos + 36) >> 2] !== 0) {
|
|
1769
1771
|
pos = uint32[(pos + 32) >> 2];
|
|
1770
1772
|
let rest = {
|
|
1771
|
-
type:
|
|
1773
|
+
type: "RestElement",
|
|
1772
1774
|
argument: null,
|
|
1773
1775
|
start: deserializeU32(pos),
|
|
1774
1776
|
end: deserializeU32(pos + 4),
|
|
@@ -1787,7 +1789,7 @@ function deserializeFormalParameter(pos) {
|
|
|
1787
1789
|
|
|
1788
1790
|
function deserializeFunctionBody(pos) {
|
|
1789
1791
|
let node = {
|
|
1790
|
-
type:
|
|
1792
|
+
type: "BlockStatement",
|
|
1791
1793
|
body: null,
|
|
1792
1794
|
start: deserializeU32(pos),
|
|
1793
1795
|
end: deserializeU32(pos + 4),
|
|
@@ -1803,7 +1805,7 @@ function deserializeArrowFunctionExpression(pos) {
|
|
|
1803
1805
|
start = deserializeU32(pos),
|
|
1804
1806
|
end = deserializeU32(pos + 4),
|
|
1805
1807
|
node = {
|
|
1806
|
-
type:
|
|
1808
|
+
type: "ArrowFunctionExpression",
|
|
1807
1809
|
expression,
|
|
1808
1810
|
async: deserializeBool(pos + 45),
|
|
1809
1811
|
params: null,
|
|
@@ -1825,7 +1827,7 @@ function deserializeYieldExpression(pos) {
|
|
|
1825
1827
|
let start = deserializeU32(pos),
|
|
1826
1828
|
end = deserializeU32(pos + 4),
|
|
1827
1829
|
node = {
|
|
1828
|
-
type:
|
|
1830
|
+
type: "YieldExpression",
|
|
1829
1831
|
delegate: deserializeBool(pos + 24),
|
|
1830
1832
|
argument: null,
|
|
1831
1833
|
start,
|
|
@@ -1857,9 +1859,9 @@ function deserializeClass(pos) {
|
|
|
1857
1859
|
function deserializeClassType(pos) {
|
|
1858
1860
|
switch (uint8[pos]) {
|
|
1859
1861
|
case 0:
|
|
1860
|
-
return
|
|
1862
|
+
return "ClassDeclaration";
|
|
1861
1863
|
case 1:
|
|
1862
|
-
return
|
|
1864
|
+
return "ClassExpression";
|
|
1863
1865
|
default:
|
|
1864
1866
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ClassType`);
|
|
1865
1867
|
}
|
|
@@ -1867,7 +1869,7 @@ function deserializeClassType(pos) {
|
|
|
1867
1869
|
|
|
1868
1870
|
function deserializeClassBody(pos) {
|
|
1869
1871
|
let node = {
|
|
1870
|
-
type:
|
|
1872
|
+
type: "ClassBody",
|
|
1871
1873
|
body: null,
|
|
1872
1874
|
start: deserializeU32(pos),
|
|
1873
1875
|
end: deserializeU32(pos + 4),
|
|
@@ -1916,9 +1918,9 @@ function deserializeMethodDefinition(pos) {
|
|
|
1916
1918
|
function deserializeMethodDefinitionType(pos) {
|
|
1917
1919
|
switch (uint8[pos]) {
|
|
1918
1920
|
case 0:
|
|
1919
|
-
return
|
|
1921
|
+
return "MethodDefinition";
|
|
1920
1922
|
case 1:
|
|
1921
|
-
return
|
|
1923
|
+
return "TSAbstractMethodDefinition";
|
|
1922
1924
|
default:
|
|
1923
1925
|
throw Error(`Unexpected discriminant ${uint8[pos]} for MethodDefinitionType`);
|
|
1924
1926
|
}
|
|
@@ -1946,9 +1948,9 @@ function deserializePropertyDefinition(pos) {
|
|
|
1946
1948
|
function deserializePropertyDefinitionType(pos) {
|
|
1947
1949
|
switch (uint8[pos]) {
|
|
1948
1950
|
case 0:
|
|
1949
|
-
return
|
|
1951
|
+
return "PropertyDefinition";
|
|
1950
1952
|
case 1:
|
|
1951
|
-
return
|
|
1953
|
+
return "TSAbstractPropertyDefinition";
|
|
1952
1954
|
default:
|
|
1953
1955
|
throw Error(`Unexpected discriminant ${uint8[pos]} for PropertyDefinitionType`);
|
|
1954
1956
|
}
|
|
@@ -1957,13 +1959,13 @@ function deserializePropertyDefinitionType(pos) {
|
|
|
1957
1959
|
function deserializeMethodDefinitionKind(pos) {
|
|
1958
1960
|
switch (uint8[pos]) {
|
|
1959
1961
|
case 0:
|
|
1960
|
-
return
|
|
1962
|
+
return "constructor";
|
|
1961
1963
|
case 1:
|
|
1962
|
-
return
|
|
1964
|
+
return "method";
|
|
1963
1965
|
case 2:
|
|
1964
|
-
return
|
|
1966
|
+
return "get";
|
|
1965
1967
|
case 3:
|
|
1966
|
-
return
|
|
1968
|
+
return "set";
|
|
1967
1969
|
default:
|
|
1968
1970
|
throw Error(`Unexpected discriminant ${uint8[pos]} for MethodDefinitionKind`);
|
|
1969
1971
|
}
|
|
@@ -1973,7 +1975,7 @@ function deserializePrivateIdentifier(pos) {
|
|
|
1973
1975
|
let start = deserializeU32(pos),
|
|
1974
1976
|
end = deserializeU32(pos + 4);
|
|
1975
1977
|
return {
|
|
1976
|
-
type:
|
|
1978
|
+
type: "PrivateIdentifier",
|
|
1977
1979
|
name: deserializeStr(pos + 8),
|
|
1978
1980
|
start,
|
|
1979
1981
|
end,
|
|
@@ -1982,7 +1984,7 @@ function deserializePrivateIdentifier(pos) {
|
|
|
1982
1984
|
|
|
1983
1985
|
function deserializeStaticBlock(pos) {
|
|
1984
1986
|
let node = {
|
|
1985
|
-
type:
|
|
1987
|
+
type: "StaticBlock",
|
|
1986
1988
|
body: null,
|
|
1987
1989
|
start: deserializeU32(pos),
|
|
1988
1990
|
end: deserializeU32(pos + 4),
|
|
@@ -1994,9 +1996,9 @@ function deserializeStaticBlock(pos) {
|
|
|
1994
1996
|
function deserializeAccessorPropertyType(pos) {
|
|
1995
1997
|
switch (uint8[pos]) {
|
|
1996
1998
|
case 0:
|
|
1997
|
-
return
|
|
1999
|
+
return "AccessorProperty";
|
|
1998
2000
|
case 1:
|
|
1999
|
-
return
|
|
2001
|
+
return "TSAbstractAccessorProperty";
|
|
2000
2002
|
default:
|
|
2001
2003
|
throw Error(`Unexpected discriminant ${uint8[pos]} for AccessorPropertyType`);
|
|
2002
2004
|
}
|
|
@@ -2025,7 +2027,7 @@ function deserializeImportExpression(pos) {
|
|
|
2025
2027
|
let start = deserializeU32(pos),
|
|
2026
2028
|
end = deserializeU32(pos + 4),
|
|
2027
2029
|
node = {
|
|
2028
|
-
type:
|
|
2030
|
+
type: "ImportExpression",
|
|
2029
2031
|
source: null,
|
|
2030
2032
|
options: null,
|
|
2031
2033
|
phase: deserializeOptionImportPhase(pos + 40),
|
|
@@ -2041,7 +2043,7 @@ function deserializeImportDeclaration(pos) {
|
|
|
2041
2043
|
let start = deserializeU32(pos),
|
|
2042
2044
|
end = deserializeU32(pos + 4),
|
|
2043
2045
|
node = {
|
|
2044
|
-
type:
|
|
2046
|
+
type: "ImportDeclaration",
|
|
2045
2047
|
specifiers: null,
|
|
2046
2048
|
source: null,
|
|
2047
2049
|
phase: deserializeOptionImportPhase(pos + 88),
|
|
@@ -2061,9 +2063,9 @@ function deserializeImportDeclaration(pos) {
|
|
|
2061
2063
|
function deserializeImportPhase(pos) {
|
|
2062
2064
|
switch (uint8[pos]) {
|
|
2063
2065
|
case 0:
|
|
2064
|
-
return
|
|
2066
|
+
return "source";
|
|
2065
2067
|
case 1:
|
|
2066
|
-
return
|
|
2068
|
+
return "defer";
|
|
2067
2069
|
default:
|
|
2068
2070
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ImportPhase`);
|
|
2069
2071
|
}
|
|
@@ -2084,7 +2086,7 @@ function deserializeImportDeclarationSpecifier(pos) {
|
|
|
2084
2086
|
|
|
2085
2087
|
function deserializeImportSpecifier(pos) {
|
|
2086
2088
|
let node = {
|
|
2087
|
-
type:
|
|
2089
|
+
type: "ImportSpecifier",
|
|
2088
2090
|
imported: null,
|
|
2089
2091
|
local: null,
|
|
2090
2092
|
start: deserializeU32(pos),
|
|
@@ -2097,7 +2099,7 @@ function deserializeImportSpecifier(pos) {
|
|
|
2097
2099
|
|
|
2098
2100
|
function deserializeImportDefaultSpecifier(pos) {
|
|
2099
2101
|
let node = {
|
|
2100
|
-
type:
|
|
2102
|
+
type: "ImportDefaultSpecifier",
|
|
2101
2103
|
local: null,
|
|
2102
2104
|
start: deserializeU32(pos),
|
|
2103
2105
|
end: deserializeU32(pos + 4),
|
|
@@ -2108,7 +2110,7 @@ function deserializeImportDefaultSpecifier(pos) {
|
|
|
2108
2110
|
|
|
2109
2111
|
function deserializeImportNamespaceSpecifier(pos) {
|
|
2110
2112
|
let node = {
|
|
2111
|
-
type:
|
|
2113
|
+
type: "ImportNamespaceSpecifier",
|
|
2112
2114
|
local: null,
|
|
2113
2115
|
start: deserializeU32(pos),
|
|
2114
2116
|
end: deserializeU32(pos + 4),
|
|
@@ -2123,7 +2125,7 @@ function deserializeWithClause(pos) {
|
|
|
2123
2125
|
|
|
2124
2126
|
function deserializeImportAttribute(pos) {
|
|
2125
2127
|
let node = {
|
|
2126
|
-
type:
|
|
2128
|
+
type: "ImportAttribute",
|
|
2127
2129
|
key: null,
|
|
2128
2130
|
value: null,
|
|
2129
2131
|
start: deserializeU32(pos),
|
|
@@ -2147,7 +2149,7 @@ function deserializeImportAttributeKey(pos) {
|
|
|
2147
2149
|
|
|
2148
2150
|
function deserializeExportNamedDeclaration(pos) {
|
|
2149
2151
|
let node = {
|
|
2150
|
-
type:
|
|
2152
|
+
type: "ExportNamedDeclaration",
|
|
2151
2153
|
declaration: null,
|
|
2152
2154
|
specifiers: null,
|
|
2153
2155
|
source: null,
|
|
@@ -2165,7 +2167,7 @@ function deserializeExportNamedDeclaration(pos) {
|
|
|
2165
2167
|
|
|
2166
2168
|
function deserializeExportDefaultDeclaration(pos) {
|
|
2167
2169
|
let node = {
|
|
2168
|
-
type:
|
|
2170
|
+
type: "ExportDefaultDeclaration",
|
|
2169
2171
|
declaration: null,
|
|
2170
2172
|
start: deserializeU32(pos),
|
|
2171
2173
|
end: deserializeU32(pos + 4),
|
|
@@ -2176,7 +2178,7 @@ function deserializeExportDefaultDeclaration(pos) {
|
|
|
2176
2178
|
|
|
2177
2179
|
function deserializeExportAllDeclaration(pos) {
|
|
2178
2180
|
let node = {
|
|
2179
|
-
type:
|
|
2181
|
+
type: "ExportAllDeclaration",
|
|
2180
2182
|
exported: null,
|
|
2181
2183
|
source: null,
|
|
2182
2184
|
attributes: null,
|
|
@@ -2192,7 +2194,7 @@ function deserializeExportAllDeclaration(pos) {
|
|
|
2192
2194
|
|
|
2193
2195
|
function deserializeExportSpecifier(pos) {
|
|
2194
2196
|
let node = {
|
|
2195
|
-
type:
|
|
2197
|
+
type: "ExportSpecifier",
|
|
2196
2198
|
local: null,
|
|
2197
2199
|
exported: null,
|
|
2198
2200
|
start: deserializeU32(pos),
|
|
@@ -2317,7 +2319,7 @@ function deserializeModuleExportName(pos) {
|
|
|
2317
2319
|
|
|
2318
2320
|
function deserializeV8IntrinsicExpression(pos) {
|
|
2319
2321
|
let node = {
|
|
2320
|
-
type:
|
|
2322
|
+
type: "V8IntrinsicExpression",
|
|
2321
2323
|
name: null,
|
|
2322
2324
|
arguments: null,
|
|
2323
2325
|
start: deserializeU32(pos),
|
|
@@ -2333,13 +2335,13 @@ function deserializeBooleanLiteral(pos) {
|
|
|
2333
2335
|
start = deserializeU32(pos),
|
|
2334
2336
|
end = deserializeU32(pos + 4),
|
|
2335
2337
|
node = {
|
|
2336
|
-
type:
|
|
2338
|
+
type: "Literal",
|
|
2337
2339
|
value,
|
|
2338
2340
|
raw: null,
|
|
2339
2341
|
start,
|
|
2340
2342
|
end,
|
|
2341
2343
|
};
|
|
2342
|
-
node.raw = start === 0 && end === 0 ? null : value +
|
|
2344
|
+
node.raw = start === 0 && end === 0 ? null : value + "";
|
|
2343
2345
|
return node;
|
|
2344
2346
|
}
|
|
2345
2347
|
|
|
@@ -2347,13 +2349,13 @@ function deserializeNullLiteral(pos) {
|
|
|
2347
2349
|
let start = deserializeU32(pos),
|
|
2348
2350
|
end = deserializeU32(pos + 4),
|
|
2349
2351
|
node = {
|
|
2350
|
-
type:
|
|
2352
|
+
type: "Literal",
|
|
2351
2353
|
value: null,
|
|
2352
2354
|
raw: null,
|
|
2353
2355
|
start,
|
|
2354
2356
|
end,
|
|
2355
2357
|
};
|
|
2356
|
-
node.raw = start === 0 && end === 0 ? null :
|
|
2358
|
+
node.raw = start === 0 && end === 0 ? null : "null";
|
|
2357
2359
|
return node;
|
|
2358
2360
|
}
|
|
2359
2361
|
|
|
@@ -2361,7 +2363,7 @@ function deserializeNumericLiteral(pos) {
|
|
|
2361
2363
|
let start = deserializeU32(pos),
|
|
2362
2364
|
end = deserializeU32(pos + 4);
|
|
2363
2365
|
return {
|
|
2364
|
-
type:
|
|
2366
|
+
type: "Literal",
|
|
2365
2367
|
value: deserializeF64(pos + 8),
|
|
2366
2368
|
raw: deserializeOptionStr(pos + 16),
|
|
2367
2369
|
start,
|
|
@@ -2373,7 +2375,7 @@ function deserializeStringLiteral(pos) {
|
|
|
2373
2375
|
let start = deserializeU32(pos),
|
|
2374
2376
|
end = deserializeU32(pos + 4),
|
|
2375
2377
|
node = {
|
|
2376
|
-
type:
|
|
2378
|
+
type: "Literal",
|
|
2377
2379
|
value: null,
|
|
2378
2380
|
raw: deserializeOptionStr(pos + 24),
|
|
2379
2381
|
start,
|
|
@@ -2390,7 +2392,7 @@ function deserializeBigIntLiteral(pos) {
|
|
|
2390
2392
|
let start = deserializeU32(pos),
|
|
2391
2393
|
end = deserializeU32(pos + 4),
|
|
2392
2394
|
node = {
|
|
2393
|
-
type:
|
|
2395
|
+
type: "Literal",
|
|
2394
2396
|
value: null,
|
|
2395
2397
|
raw: deserializeOptionStr(pos + 24),
|
|
2396
2398
|
bigint: null,
|
|
@@ -2407,7 +2409,7 @@ function deserializeRegExpLiteral(pos) {
|
|
|
2407
2409
|
let start = deserializeU32(pos),
|
|
2408
2410
|
end = deserializeU32(pos + 4),
|
|
2409
2411
|
node = {
|
|
2410
|
-
type:
|
|
2412
|
+
type: "Literal",
|
|
2411
2413
|
value: null,
|
|
2412
2414
|
raw: deserializeOptionStr(pos + 40),
|
|
2413
2415
|
regex: null,
|
|
@@ -2433,22 +2435,22 @@ function deserializeRegExp(pos) {
|
|
|
2433
2435
|
|
|
2434
2436
|
function deserializeRegExpFlags(pos) {
|
|
2435
2437
|
let flagBits = deserializeU8(pos),
|
|
2436
|
-
flags =
|
|
2438
|
+
flags = "";
|
|
2437
2439
|
// Alphabetical order
|
|
2438
|
-
flagBits & 64 && (flags +=
|
|
2439
|
-
flagBits & 1 && (flags +=
|
|
2440
|
-
flagBits & 2 && (flags +=
|
|
2441
|
-
flagBits & 4 && (flags +=
|
|
2442
|
-
flagBits & 8 && (flags +=
|
|
2443
|
-
flagBits & 16 && (flags +=
|
|
2444
|
-
flagBits & 128 && (flags +=
|
|
2445
|
-
flagBits & 32 && (flags +=
|
|
2440
|
+
flagBits & 64 && (flags += "d");
|
|
2441
|
+
flagBits & 1 && (flags += "g");
|
|
2442
|
+
flagBits & 2 && (flags += "i");
|
|
2443
|
+
flagBits & 4 && (flags += "m");
|
|
2444
|
+
flagBits & 8 && (flags += "s");
|
|
2445
|
+
flagBits & 16 && (flags += "u");
|
|
2446
|
+
flagBits & 128 && (flags += "v");
|
|
2447
|
+
flagBits & 32 && (flags += "y");
|
|
2446
2448
|
return flags;
|
|
2447
2449
|
}
|
|
2448
2450
|
|
|
2449
2451
|
function deserializeJSXElement(pos) {
|
|
2450
2452
|
let node = {
|
|
2451
|
-
type:
|
|
2453
|
+
type: "JSXElement",
|
|
2452
2454
|
openingElement: null,
|
|
2453
2455
|
children: null,
|
|
2454
2456
|
closingElement: null,
|
|
@@ -2466,7 +2468,7 @@ function deserializeJSXElement(pos) {
|
|
|
2466
2468
|
|
|
2467
2469
|
function deserializeJSXOpeningElement(pos) {
|
|
2468
2470
|
let node = {
|
|
2469
|
-
type:
|
|
2471
|
+
type: "JSXOpeningElement",
|
|
2470
2472
|
name: null,
|
|
2471
2473
|
attributes: null,
|
|
2472
2474
|
selfClosing: null,
|
|
@@ -2481,7 +2483,7 @@ function deserializeJSXOpeningElement(pos) {
|
|
|
2481
2483
|
|
|
2482
2484
|
function deserializeJSXClosingElement(pos) {
|
|
2483
2485
|
let node = {
|
|
2484
|
-
type:
|
|
2486
|
+
type: "JSXClosingElement",
|
|
2485
2487
|
name: null,
|
|
2486
2488
|
start: deserializeU32(pos),
|
|
2487
2489
|
end: deserializeU32(pos + 4),
|
|
@@ -2492,7 +2494,7 @@ function deserializeJSXClosingElement(pos) {
|
|
|
2492
2494
|
|
|
2493
2495
|
function deserializeJSXFragment(pos) {
|
|
2494
2496
|
let node = {
|
|
2495
|
-
type:
|
|
2497
|
+
type: "JSXFragment",
|
|
2496
2498
|
openingFragment: null,
|
|
2497
2499
|
children: null,
|
|
2498
2500
|
closingFragment: null,
|
|
@@ -2507,7 +2509,7 @@ function deserializeJSXFragment(pos) {
|
|
|
2507
2509
|
|
|
2508
2510
|
function deserializeJSXOpeningFragment(pos) {
|
|
2509
2511
|
let node = {
|
|
2510
|
-
type:
|
|
2512
|
+
type: "JSXOpeningFragment",
|
|
2511
2513
|
attributes: null,
|
|
2512
2514
|
selfClosing: null,
|
|
2513
2515
|
start: deserializeU32(pos),
|
|
@@ -2520,7 +2522,7 @@ function deserializeJSXOpeningFragment(pos) {
|
|
|
2520
2522
|
|
|
2521
2523
|
function deserializeJSXClosingFragment(pos) {
|
|
2522
2524
|
return {
|
|
2523
|
-
type:
|
|
2525
|
+
type: "JSXClosingFragment",
|
|
2524
2526
|
start: deserializeU32(pos),
|
|
2525
2527
|
end: deserializeU32(pos + 4),
|
|
2526
2528
|
};
|
|
@@ -2533,7 +2535,7 @@ function deserializeJSXElementName(pos) {
|
|
|
2533
2535
|
case 1:
|
|
2534
2536
|
let ident = deserializeBoxIdentifierReference(pos + 8);
|
|
2535
2537
|
return {
|
|
2536
|
-
type:
|
|
2538
|
+
type: "JSXIdentifier",
|
|
2537
2539
|
name: ident.name,
|
|
2538
2540
|
start: ident.start,
|
|
2539
2541
|
end: ident.end,
|
|
@@ -2545,8 +2547,8 @@ function deserializeJSXElementName(pos) {
|
|
|
2545
2547
|
case 4:
|
|
2546
2548
|
let thisExpr = deserializeBoxThisExpression(pos + 8);
|
|
2547
2549
|
return {
|
|
2548
|
-
type:
|
|
2549
|
-
name:
|
|
2550
|
+
type: "JSXIdentifier",
|
|
2551
|
+
name: "this",
|
|
2550
2552
|
start: thisExpr.start,
|
|
2551
2553
|
end: thisExpr.end,
|
|
2552
2554
|
};
|
|
@@ -2557,7 +2559,7 @@ function deserializeJSXElementName(pos) {
|
|
|
2557
2559
|
|
|
2558
2560
|
function deserializeJSXNamespacedName(pos) {
|
|
2559
2561
|
let node = {
|
|
2560
|
-
type:
|
|
2562
|
+
type: "JSXNamespacedName",
|
|
2561
2563
|
namespace: null,
|
|
2562
2564
|
name: null,
|
|
2563
2565
|
start: deserializeU32(pos),
|
|
@@ -2570,7 +2572,7 @@ function deserializeJSXNamespacedName(pos) {
|
|
|
2570
2572
|
|
|
2571
2573
|
function deserializeJSXMemberExpression(pos) {
|
|
2572
2574
|
let node = {
|
|
2573
|
-
type:
|
|
2575
|
+
type: "JSXMemberExpression",
|
|
2574
2576
|
object: null,
|
|
2575
2577
|
property: null,
|
|
2576
2578
|
start: deserializeU32(pos),
|
|
@@ -2586,7 +2588,7 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2586
2588
|
case 0:
|
|
2587
2589
|
let ident = deserializeBoxIdentifierReference(pos + 8);
|
|
2588
2590
|
return {
|
|
2589
|
-
type:
|
|
2591
|
+
type: "JSXIdentifier",
|
|
2590
2592
|
name: ident.name,
|
|
2591
2593
|
start: ident.start,
|
|
2592
2594
|
end: ident.end,
|
|
@@ -2596,8 +2598,8 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2596
2598
|
case 2:
|
|
2597
2599
|
let thisExpr = deserializeBoxThisExpression(pos + 8);
|
|
2598
2600
|
return {
|
|
2599
|
-
type:
|
|
2600
|
-
name:
|
|
2601
|
+
type: "JSXIdentifier",
|
|
2602
|
+
name: "this",
|
|
2601
2603
|
start: thisExpr.start,
|
|
2602
2604
|
end: thisExpr.end,
|
|
2603
2605
|
};
|
|
@@ -2608,7 +2610,7 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2608
2610
|
|
|
2609
2611
|
function deserializeJSXExpressionContainer(pos) {
|
|
2610
2612
|
let node = {
|
|
2611
|
-
type:
|
|
2613
|
+
type: "JSXExpressionContainer",
|
|
2612
2614
|
expression: null,
|
|
2613
2615
|
start: deserializeU32(pos),
|
|
2614
2616
|
end: deserializeU32(pos + 4),
|
|
@@ -2714,7 +2716,7 @@ function deserializeJSXExpression(pos) {
|
|
|
2714
2716
|
|
|
2715
2717
|
function deserializeJSXEmptyExpression(pos) {
|
|
2716
2718
|
return {
|
|
2717
|
-
type:
|
|
2719
|
+
type: "JSXEmptyExpression",
|
|
2718
2720
|
start: deserializeU32(pos),
|
|
2719
2721
|
end: deserializeU32(pos + 4),
|
|
2720
2722
|
};
|
|
@@ -2733,7 +2735,7 @@ function deserializeJSXAttributeItem(pos) {
|
|
|
2733
2735
|
|
|
2734
2736
|
function deserializeJSXAttribute(pos) {
|
|
2735
2737
|
let node = {
|
|
2736
|
-
type:
|
|
2738
|
+
type: "JSXAttribute",
|
|
2737
2739
|
name: null,
|
|
2738
2740
|
value: null,
|
|
2739
2741
|
start: deserializeU32(pos),
|
|
@@ -2746,7 +2748,7 @@ function deserializeJSXAttribute(pos) {
|
|
|
2746
2748
|
|
|
2747
2749
|
function deserializeJSXSpreadAttribute(pos) {
|
|
2748
2750
|
let node = {
|
|
2749
|
-
type:
|
|
2751
|
+
type: "JSXSpreadAttribute",
|
|
2750
2752
|
argument: null,
|
|
2751
2753
|
start: deserializeU32(pos),
|
|
2752
2754
|
end: deserializeU32(pos + 4),
|
|
@@ -2785,7 +2787,7 @@ function deserializeJSXIdentifier(pos) {
|
|
|
2785
2787
|
let start = deserializeU32(pos),
|
|
2786
2788
|
end = deserializeU32(pos + 4);
|
|
2787
2789
|
return {
|
|
2788
|
-
type:
|
|
2790
|
+
type: "JSXIdentifier",
|
|
2789
2791
|
name: deserializeStr(pos + 8),
|
|
2790
2792
|
start,
|
|
2791
2793
|
end,
|
|
@@ -2811,7 +2813,7 @@ function deserializeJSXChild(pos) {
|
|
|
2811
2813
|
|
|
2812
2814
|
function deserializeJSXSpreadChild(pos) {
|
|
2813
2815
|
let node = {
|
|
2814
|
-
type:
|
|
2816
|
+
type: "JSXSpreadChild",
|
|
2815
2817
|
expression: null,
|
|
2816
2818
|
start: deserializeU32(pos),
|
|
2817
2819
|
end: deserializeU32(pos + 4),
|
|
@@ -2824,7 +2826,7 @@ function deserializeJSXText(pos) {
|
|
|
2824
2826
|
let start = deserializeU32(pos),
|
|
2825
2827
|
end = deserializeU32(pos + 4);
|
|
2826
2828
|
return {
|
|
2827
|
-
type:
|
|
2829
|
+
type: "JSXText",
|
|
2828
2830
|
value: deserializeStr(pos + 8),
|
|
2829
2831
|
raw: deserializeOptionStr(pos + 24),
|
|
2830
2832
|
start,
|
|
@@ -2834,7 +2836,7 @@ function deserializeJSXText(pos) {
|
|
|
2834
2836
|
|
|
2835
2837
|
function deserializeTSThisParameter(pos) {
|
|
2836
2838
|
let node = {
|
|
2837
|
-
type:
|
|
2839
|
+
type: "Identifier",
|
|
2838
2840
|
decorators: null,
|
|
2839
2841
|
name: null,
|
|
2840
2842
|
optional: null,
|
|
@@ -2843,7 +2845,7 @@ function deserializeTSThisParameter(pos) {
|
|
|
2843
2845
|
end: deserializeU32(pos + 4),
|
|
2844
2846
|
};
|
|
2845
2847
|
node.decorators = [];
|
|
2846
|
-
node.name =
|
|
2848
|
+
node.name = "this";
|
|
2847
2849
|
node.optional = false;
|
|
2848
2850
|
node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 16);
|
|
2849
2851
|
return node;
|
|
@@ -2853,7 +2855,7 @@ function deserializeTSEnumDeclaration(pos) {
|
|
|
2853
2855
|
let start = deserializeU32(pos),
|
|
2854
2856
|
end = deserializeU32(pos + 4),
|
|
2855
2857
|
node = {
|
|
2856
|
-
type:
|
|
2858
|
+
type: "TSEnumDeclaration",
|
|
2857
2859
|
id: null,
|
|
2858
2860
|
body: null,
|
|
2859
2861
|
const: deserializeBool(pos + 76),
|
|
@@ -2868,7 +2870,7 @@ function deserializeTSEnumDeclaration(pos) {
|
|
|
2868
2870
|
|
|
2869
2871
|
function deserializeTSEnumBody(pos) {
|
|
2870
2872
|
let node = {
|
|
2871
|
-
type:
|
|
2873
|
+
type: "TSEnumBody",
|
|
2872
2874
|
members: null,
|
|
2873
2875
|
start: deserializeU32(pos),
|
|
2874
2876
|
end: deserializeU32(pos + 4),
|
|
@@ -2879,7 +2881,7 @@ function deserializeTSEnumBody(pos) {
|
|
|
2879
2881
|
|
|
2880
2882
|
function deserializeTSEnumMember(pos) {
|
|
2881
2883
|
let node = {
|
|
2882
|
-
type:
|
|
2884
|
+
type: "TSEnumMember",
|
|
2883
2885
|
id: null,
|
|
2884
2886
|
initializer: null,
|
|
2885
2887
|
computed: null,
|
|
@@ -2909,7 +2911,7 @@ function deserializeTSEnumMemberName(pos) {
|
|
|
2909
2911
|
|
|
2910
2912
|
function deserializeTSTypeAnnotation(pos) {
|
|
2911
2913
|
let node = {
|
|
2912
|
-
type:
|
|
2914
|
+
type: "TSTypeAnnotation",
|
|
2913
2915
|
typeAnnotation: null,
|
|
2914
2916
|
start: deserializeU32(pos),
|
|
2915
2917
|
end: deserializeU32(pos + 4),
|
|
@@ -2920,7 +2922,7 @@ function deserializeTSTypeAnnotation(pos) {
|
|
|
2920
2922
|
|
|
2921
2923
|
function deserializeTSLiteralType(pos) {
|
|
2922
2924
|
let node = {
|
|
2923
|
-
type:
|
|
2925
|
+
type: "TSLiteralType",
|
|
2924
2926
|
literal: null,
|
|
2925
2927
|
start: deserializeU32(pos),
|
|
2926
2928
|
end: deserializeU32(pos + 4),
|
|
@@ -3031,7 +3033,7 @@ function deserializeTSType(pos) {
|
|
|
3031
3033
|
|
|
3032
3034
|
function deserializeTSConditionalType(pos) {
|
|
3033
3035
|
let node = {
|
|
3034
|
-
type:
|
|
3036
|
+
type: "TSConditionalType",
|
|
3035
3037
|
checkType: null,
|
|
3036
3038
|
extendsType: null,
|
|
3037
3039
|
trueType: null,
|
|
@@ -3048,7 +3050,7 @@ function deserializeTSConditionalType(pos) {
|
|
|
3048
3050
|
|
|
3049
3051
|
function deserializeTSUnionType(pos) {
|
|
3050
3052
|
let node = {
|
|
3051
|
-
type:
|
|
3053
|
+
type: "TSUnionType",
|
|
3052
3054
|
types: null,
|
|
3053
3055
|
start: deserializeU32(pos),
|
|
3054
3056
|
end: deserializeU32(pos + 4),
|
|
@@ -3059,7 +3061,7 @@ function deserializeTSUnionType(pos) {
|
|
|
3059
3061
|
|
|
3060
3062
|
function deserializeTSIntersectionType(pos) {
|
|
3061
3063
|
let node = {
|
|
3062
|
-
type:
|
|
3064
|
+
type: "TSIntersectionType",
|
|
3063
3065
|
types: null,
|
|
3064
3066
|
start: deserializeU32(pos),
|
|
3065
3067
|
end: deserializeU32(pos + 4),
|
|
@@ -3071,7 +3073,7 @@ function deserializeTSIntersectionType(pos) {
|
|
|
3071
3073
|
function deserializeTSParenthesizedType(pos) {
|
|
3072
3074
|
let node;
|
|
3073
3075
|
node = {
|
|
3074
|
-
type:
|
|
3076
|
+
type: "TSParenthesizedType",
|
|
3075
3077
|
typeAnnotation: null,
|
|
3076
3078
|
start: deserializeU32(pos),
|
|
3077
3079
|
end: deserializeU32(pos + 4),
|
|
@@ -3084,7 +3086,7 @@ function deserializeTSTypeOperator(pos) {
|
|
|
3084
3086
|
let start = deserializeU32(pos),
|
|
3085
3087
|
end = deserializeU32(pos + 4),
|
|
3086
3088
|
node = {
|
|
3087
|
-
type:
|
|
3089
|
+
type: "TSTypeOperator",
|
|
3088
3090
|
operator: deserializeTSTypeOperatorOperator(pos + 24),
|
|
3089
3091
|
typeAnnotation: null,
|
|
3090
3092
|
start,
|
|
@@ -3097,11 +3099,11 @@ function deserializeTSTypeOperator(pos) {
|
|
|
3097
3099
|
function deserializeTSTypeOperatorOperator(pos) {
|
|
3098
3100
|
switch (uint8[pos]) {
|
|
3099
3101
|
case 0:
|
|
3100
|
-
return
|
|
3102
|
+
return "keyof";
|
|
3101
3103
|
case 1:
|
|
3102
|
-
return
|
|
3104
|
+
return "unique";
|
|
3103
3105
|
case 2:
|
|
3104
|
-
return
|
|
3106
|
+
return "readonly";
|
|
3105
3107
|
default:
|
|
3106
3108
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSTypeOperatorOperator`);
|
|
3107
3109
|
}
|
|
@@ -3109,7 +3111,7 @@ function deserializeTSTypeOperatorOperator(pos) {
|
|
|
3109
3111
|
|
|
3110
3112
|
function deserializeTSArrayType(pos) {
|
|
3111
3113
|
let node = {
|
|
3112
|
-
type:
|
|
3114
|
+
type: "TSArrayType",
|
|
3113
3115
|
elementType: null,
|
|
3114
3116
|
start: deserializeU32(pos),
|
|
3115
3117
|
end: deserializeU32(pos + 4),
|
|
@@ -3120,7 +3122,7 @@ function deserializeTSArrayType(pos) {
|
|
|
3120
3122
|
|
|
3121
3123
|
function deserializeTSIndexedAccessType(pos) {
|
|
3122
3124
|
let node = {
|
|
3123
|
-
type:
|
|
3125
|
+
type: "TSIndexedAccessType",
|
|
3124
3126
|
objectType: null,
|
|
3125
3127
|
indexType: null,
|
|
3126
3128
|
start: deserializeU32(pos),
|
|
@@ -3133,7 +3135,7 @@ function deserializeTSIndexedAccessType(pos) {
|
|
|
3133
3135
|
|
|
3134
3136
|
function deserializeTSTupleType(pos) {
|
|
3135
3137
|
let node = {
|
|
3136
|
-
type:
|
|
3138
|
+
type: "TSTupleType",
|
|
3137
3139
|
elementTypes: null,
|
|
3138
3140
|
start: deserializeU32(pos),
|
|
3139
3141
|
end: deserializeU32(pos + 4),
|
|
@@ -3146,7 +3148,7 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
3146
3148
|
let start = deserializeU32(pos),
|
|
3147
3149
|
end = deserializeU32(pos + 4),
|
|
3148
3150
|
node = {
|
|
3149
|
-
type:
|
|
3151
|
+
type: "TSNamedTupleMember",
|
|
3150
3152
|
label: null,
|
|
3151
3153
|
elementType: null,
|
|
3152
3154
|
optional: deserializeBool(pos + 48),
|
|
@@ -3160,7 +3162,7 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
3160
3162
|
|
|
3161
3163
|
function deserializeTSOptionalType(pos) {
|
|
3162
3164
|
let node = {
|
|
3163
|
-
type:
|
|
3165
|
+
type: "TSOptionalType",
|
|
3164
3166
|
typeAnnotation: null,
|
|
3165
3167
|
start: deserializeU32(pos),
|
|
3166
3168
|
end: deserializeU32(pos + 4),
|
|
@@ -3171,7 +3173,7 @@ function deserializeTSOptionalType(pos) {
|
|
|
3171
3173
|
|
|
3172
3174
|
function deserializeTSRestType(pos) {
|
|
3173
3175
|
let node = {
|
|
3174
|
-
type:
|
|
3176
|
+
type: "TSRestType",
|
|
3175
3177
|
typeAnnotation: null,
|
|
3176
3178
|
start: deserializeU32(pos),
|
|
3177
3179
|
end: deserializeU32(pos + 4),
|
|
@@ -3267,7 +3269,7 @@ function deserializeTSTupleElement(pos) {
|
|
|
3267
3269
|
|
|
3268
3270
|
function deserializeTSAnyKeyword(pos) {
|
|
3269
3271
|
return {
|
|
3270
|
-
type:
|
|
3272
|
+
type: "TSAnyKeyword",
|
|
3271
3273
|
start: deserializeU32(pos),
|
|
3272
3274
|
end: deserializeU32(pos + 4),
|
|
3273
3275
|
};
|
|
@@ -3275,7 +3277,7 @@ function deserializeTSAnyKeyword(pos) {
|
|
|
3275
3277
|
|
|
3276
3278
|
function deserializeTSStringKeyword(pos) {
|
|
3277
3279
|
return {
|
|
3278
|
-
type:
|
|
3280
|
+
type: "TSStringKeyword",
|
|
3279
3281
|
start: deserializeU32(pos),
|
|
3280
3282
|
end: deserializeU32(pos + 4),
|
|
3281
3283
|
};
|
|
@@ -3283,7 +3285,7 @@ function deserializeTSStringKeyword(pos) {
|
|
|
3283
3285
|
|
|
3284
3286
|
function deserializeTSBooleanKeyword(pos) {
|
|
3285
3287
|
return {
|
|
3286
|
-
type:
|
|
3288
|
+
type: "TSBooleanKeyword",
|
|
3287
3289
|
start: deserializeU32(pos),
|
|
3288
3290
|
end: deserializeU32(pos + 4),
|
|
3289
3291
|
};
|
|
@@ -3291,7 +3293,7 @@ function deserializeTSBooleanKeyword(pos) {
|
|
|
3291
3293
|
|
|
3292
3294
|
function deserializeTSNumberKeyword(pos) {
|
|
3293
3295
|
return {
|
|
3294
|
-
type:
|
|
3296
|
+
type: "TSNumberKeyword",
|
|
3295
3297
|
start: deserializeU32(pos),
|
|
3296
3298
|
end: deserializeU32(pos + 4),
|
|
3297
3299
|
};
|
|
@@ -3299,7 +3301,7 @@ function deserializeTSNumberKeyword(pos) {
|
|
|
3299
3301
|
|
|
3300
3302
|
function deserializeTSNeverKeyword(pos) {
|
|
3301
3303
|
return {
|
|
3302
|
-
type:
|
|
3304
|
+
type: "TSNeverKeyword",
|
|
3303
3305
|
start: deserializeU32(pos),
|
|
3304
3306
|
end: deserializeU32(pos + 4),
|
|
3305
3307
|
};
|
|
@@ -3307,7 +3309,7 @@ function deserializeTSNeverKeyword(pos) {
|
|
|
3307
3309
|
|
|
3308
3310
|
function deserializeTSIntrinsicKeyword(pos) {
|
|
3309
3311
|
return {
|
|
3310
|
-
type:
|
|
3312
|
+
type: "TSIntrinsicKeyword",
|
|
3311
3313
|
start: deserializeU32(pos),
|
|
3312
3314
|
end: deserializeU32(pos + 4),
|
|
3313
3315
|
};
|
|
@@ -3315,7 +3317,7 @@ function deserializeTSIntrinsicKeyword(pos) {
|
|
|
3315
3317
|
|
|
3316
3318
|
function deserializeTSUnknownKeyword(pos) {
|
|
3317
3319
|
return {
|
|
3318
|
-
type:
|
|
3320
|
+
type: "TSUnknownKeyword",
|
|
3319
3321
|
start: deserializeU32(pos),
|
|
3320
3322
|
end: deserializeU32(pos + 4),
|
|
3321
3323
|
};
|
|
@@ -3323,7 +3325,7 @@ function deserializeTSUnknownKeyword(pos) {
|
|
|
3323
3325
|
|
|
3324
3326
|
function deserializeTSNullKeyword(pos) {
|
|
3325
3327
|
return {
|
|
3326
|
-
type:
|
|
3328
|
+
type: "TSNullKeyword",
|
|
3327
3329
|
start: deserializeU32(pos),
|
|
3328
3330
|
end: deserializeU32(pos + 4),
|
|
3329
3331
|
};
|
|
@@ -3331,7 +3333,7 @@ function deserializeTSNullKeyword(pos) {
|
|
|
3331
3333
|
|
|
3332
3334
|
function deserializeTSUndefinedKeyword(pos) {
|
|
3333
3335
|
return {
|
|
3334
|
-
type:
|
|
3336
|
+
type: "TSUndefinedKeyword",
|
|
3335
3337
|
start: deserializeU32(pos),
|
|
3336
3338
|
end: deserializeU32(pos + 4),
|
|
3337
3339
|
};
|
|
@@ -3339,7 +3341,7 @@ function deserializeTSUndefinedKeyword(pos) {
|
|
|
3339
3341
|
|
|
3340
3342
|
function deserializeTSVoidKeyword(pos) {
|
|
3341
3343
|
return {
|
|
3342
|
-
type:
|
|
3344
|
+
type: "TSVoidKeyword",
|
|
3343
3345
|
start: deserializeU32(pos),
|
|
3344
3346
|
end: deserializeU32(pos + 4),
|
|
3345
3347
|
};
|
|
@@ -3347,7 +3349,7 @@ function deserializeTSVoidKeyword(pos) {
|
|
|
3347
3349
|
|
|
3348
3350
|
function deserializeTSSymbolKeyword(pos) {
|
|
3349
3351
|
return {
|
|
3350
|
-
type:
|
|
3352
|
+
type: "TSSymbolKeyword",
|
|
3351
3353
|
start: deserializeU32(pos),
|
|
3352
3354
|
end: deserializeU32(pos + 4),
|
|
3353
3355
|
};
|
|
@@ -3355,7 +3357,7 @@ function deserializeTSSymbolKeyword(pos) {
|
|
|
3355
3357
|
|
|
3356
3358
|
function deserializeTSThisType(pos) {
|
|
3357
3359
|
return {
|
|
3358
|
-
type:
|
|
3360
|
+
type: "TSThisType",
|
|
3359
3361
|
start: deserializeU32(pos),
|
|
3360
3362
|
end: deserializeU32(pos + 4),
|
|
3361
3363
|
};
|
|
@@ -3363,7 +3365,7 @@ function deserializeTSThisType(pos) {
|
|
|
3363
3365
|
|
|
3364
3366
|
function deserializeTSObjectKeyword(pos) {
|
|
3365
3367
|
return {
|
|
3366
|
-
type:
|
|
3368
|
+
type: "TSObjectKeyword",
|
|
3367
3369
|
start: deserializeU32(pos),
|
|
3368
3370
|
end: deserializeU32(pos + 4),
|
|
3369
3371
|
};
|
|
@@ -3371,7 +3373,7 @@ function deserializeTSObjectKeyword(pos) {
|
|
|
3371
3373
|
|
|
3372
3374
|
function deserializeTSBigIntKeyword(pos) {
|
|
3373
3375
|
return {
|
|
3374
|
-
type:
|
|
3376
|
+
type: "TSBigIntKeyword",
|
|
3375
3377
|
start: deserializeU32(pos),
|
|
3376
3378
|
end: deserializeU32(pos + 4),
|
|
3377
3379
|
};
|
|
@@ -3379,7 +3381,7 @@ function deserializeTSBigIntKeyword(pos) {
|
|
|
3379
3381
|
|
|
3380
3382
|
function deserializeTSTypeReference(pos) {
|
|
3381
3383
|
let node = {
|
|
3382
|
-
type:
|
|
3384
|
+
type: "TSTypeReference",
|
|
3383
3385
|
typeName: null,
|
|
3384
3386
|
typeArguments: null,
|
|
3385
3387
|
start: deserializeU32(pos),
|
|
@@ -3405,7 +3407,7 @@ function deserializeTSTypeName(pos) {
|
|
|
3405
3407
|
|
|
3406
3408
|
function deserializeTSQualifiedName(pos) {
|
|
3407
3409
|
let node = {
|
|
3408
|
-
type:
|
|
3410
|
+
type: "TSQualifiedName",
|
|
3409
3411
|
left: null,
|
|
3410
3412
|
right: null,
|
|
3411
3413
|
start: deserializeU32(pos),
|
|
@@ -3418,7 +3420,7 @@ function deserializeTSQualifiedName(pos) {
|
|
|
3418
3420
|
|
|
3419
3421
|
function deserializeTSTypeParameterInstantiation(pos) {
|
|
3420
3422
|
let node = {
|
|
3421
|
-
type:
|
|
3423
|
+
type: "TSTypeParameterInstantiation",
|
|
3422
3424
|
params: null,
|
|
3423
3425
|
start: deserializeU32(pos),
|
|
3424
3426
|
end: deserializeU32(pos + 4),
|
|
@@ -3431,7 +3433,7 @@ function deserializeTSTypeParameter(pos) {
|
|
|
3431
3433
|
let start = deserializeU32(pos),
|
|
3432
3434
|
end = deserializeU32(pos + 4),
|
|
3433
3435
|
node = {
|
|
3434
|
-
type:
|
|
3436
|
+
type: "TSTypeParameter",
|
|
3435
3437
|
name: null,
|
|
3436
3438
|
constraint: null,
|
|
3437
3439
|
default: null,
|
|
@@ -3449,7 +3451,7 @@ function deserializeTSTypeParameter(pos) {
|
|
|
3449
3451
|
|
|
3450
3452
|
function deserializeTSTypeParameterDeclaration(pos) {
|
|
3451
3453
|
let node = {
|
|
3452
|
-
type:
|
|
3454
|
+
type: "TSTypeParameterDeclaration",
|
|
3453
3455
|
params: null,
|
|
3454
3456
|
start: deserializeU32(pos),
|
|
3455
3457
|
end: deserializeU32(pos + 4),
|
|
@@ -3462,7 +3464,7 @@ function deserializeTSTypeAliasDeclaration(pos) {
|
|
|
3462
3464
|
let start = deserializeU32(pos),
|
|
3463
3465
|
end = deserializeU32(pos + 4),
|
|
3464
3466
|
node = {
|
|
3465
|
-
type:
|
|
3467
|
+
type: "TSTypeAliasDeclaration",
|
|
3466
3468
|
id: null,
|
|
3467
3469
|
typeParameters: null,
|
|
3468
3470
|
typeAnnotation: null,
|
|
@@ -3480,7 +3482,7 @@ function deserializeTSInterfaceDeclaration(pos) {
|
|
|
3480
3482
|
let start = deserializeU32(pos),
|
|
3481
3483
|
end = deserializeU32(pos + 4),
|
|
3482
3484
|
node = {
|
|
3483
|
-
type:
|
|
3485
|
+
type: "TSInterfaceDeclaration",
|
|
3484
3486
|
id: null,
|
|
3485
3487
|
typeParameters: null,
|
|
3486
3488
|
extends: null,
|
|
@@ -3498,7 +3500,7 @@ function deserializeTSInterfaceDeclaration(pos) {
|
|
|
3498
3500
|
|
|
3499
3501
|
function deserializeTSInterfaceBody(pos) {
|
|
3500
3502
|
let node = {
|
|
3501
|
-
type:
|
|
3503
|
+
type: "TSInterfaceBody",
|
|
3502
3504
|
body: null,
|
|
3503
3505
|
start: deserializeU32(pos),
|
|
3504
3506
|
end: deserializeU32(pos + 4),
|
|
@@ -3511,7 +3513,7 @@ function deserializeTSPropertySignature(pos) {
|
|
|
3511
3513
|
let start = deserializeU32(pos),
|
|
3512
3514
|
end = deserializeU32(pos + 4),
|
|
3513
3515
|
node = {
|
|
3514
|
-
type:
|
|
3516
|
+
type: "TSPropertySignature",
|
|
3515
3517
|
computed: deserializeBool(pos + 32),
|
|
3516
3518
|
optional: deserializeBool(pos + 33),
|
|
3517
3519
|
readonly: deserializeBool(pos + 34),
|
|
@@ -3549,7 +3551,7 @@ function deserializeTSIndexSignature(pos) {
|
|
|
3549
3551
|
let start = deserializeU32(pos),
|
|
3550
3552
|
end = deserializeU32(pos + 4),
|
|
3551
3553
|
node = {
|
|
3552
|
-
type:
|
|
3554
|
+
type: "TSIndexSignature",
|
|
3553
3555
|
parameters: null,
|
|
3554
3556
|
typeAnnotation: null,
|
|
3555
3557
|
readonly: deserializeBool(pos + 40),
|
|
@@ -3565,7 +3567,7 @@ function deserializeTSIndexSignature(pos) {
|
|
|
3565
3567
|
|
|
3566
3568
|
function deserializeTSCallSignatureDeclaration(pos) {
|
|
3567
3569
|
let node = {
|
|
3568
|
-
type:
|
|
3570
|
+
type: "TSCallSignatureDeclaration",
|
|
3569
3571
|
typeParameters: null,
|
|
3570
3572
|
params: null,
|
|
3571
3573
|
returnType: null,
|
|
@@ -3584,11 +3586,11 @@ function deserializeTSCallSignatureDeclaration(pos) {
|
|
|
3584
3586
|
function deserializeTSMethodSignatureKind(pos) {
|
|
3585
3587
|
switch (uint8[pos]) {
|
|
3586
3588
|
case 0:
|
|
3587
|
-
return
|
|
3589
|
+
return "method";
|
|
3588
3590
|
case 1:
|
|
3589
|
-
return
|
|
3591
|
+
return "get";
|
|
3590
3592
|
case 2:
|
|
3591
|
-
return
|
|
3593
|
+
return "set";
|
|
3592
3594
|
default:
|
|
3593
3595
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSMethodSignatureKind`);
|
|
3594
3596
|
}
|
|
@@ -3598,7 +3600,7 @@ function deserializeTSMethodSignature(pos) {
|
|
|
3598
3600
|
let start = deserializeU32(pos),
|
|
3599
3601
|
end = deserializeU32(pos + 4),
|
|
3600
3602
|
node = {
|
|
3601
|
-
type:
|
|
3603
|
+
type: "TSMethodSignature",
|
|
3602
3604
|
key: null,
|
|
3603
3605
|
computed: deserializeBool(pos + 60),
|
|
3604
3606
|
optional: deserializeBool(pos + 61),
|
|
@@ -3626,7 +3628,7 @@ function deserializeTSMethodSignature(pos) {
|
|
|
3626
3628
|
|
|
3627
3629
|
function deserializeTSConstructSignatureDeclaration(pos) {
|
|
3628
3630
|
let node = {
|
|
3629
|
-
type:
|
|
3631
|
+
type: "TSConstructSignatureDeclaration",
|
|
3630
3632
|
typeParameters: null,
|
|
3631
3633
|
params: null,
|
|
3632
3634
|
returnType: null,
|
|
@@ -3643,7 +3645,7 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
3643
3645
|
let start = deserializeU32(pos),
|
|
3644
3646
|
end = deserializeU32(pos + 4),
|
|
3645
3647
|
node = {
|
|
3646
|
-
type:
|
|
3648
|
+
type: "Identifier",
|
|
3647
3649
|
decorators: null,
|
|
3648
3650
|
name: deserializeStr(pos + 8),
|
|
3649
3651
|
optional: null,
|
|
@@ -3659,7 +3661,7 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
3659
3661
|
|
|
3660
3662
|
function deserializeTSInterfaceHeritage(pos) {
|
|
3661
3663
|
let node = {
|
|
3662
|
-
type:
|
|
3664
|
+
type: "TSInterfaceHeritage",
|
|
3663
3665
|
expression: null,
|
|
3664
3666
|
typeArguments: null,
|
|
3665
3667
|
start: deserializeU32(pos),
|
|
@@ -3674,7 +3676,7 @@ function deserializeTSTypePredicate(pos) {
|
|
|
3674
3676
|
let start = deserializeU32(pos),
|
|
3675
3677
|
end = deserializeU32(pos + 4),
|
|
3676
3678
|
node = {
|
|
3677
|
-
type:
|
|
3679
|
+
type: "TSTypePredicate",
|
|
3678
3680
|
parameterName: null,
|
|
3679
3681
|
asserts: deserializeBool(pos + 32),
|
|
3680
3682
|
typeAnnotation: null,
|
|
@@ -3706,7 +3708,7 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3706
3708
|
body = deserializeOptionTSModuleDeclarationBody(pos + 64);
|
|
3707
3709
|
if (body === null) {
|
|
3708
3710
|
node = {
|
|
3709
|
-
type:
|
|
3711
|
+
type: "TSModuleDeclaration",
|
|
3710
3712
|
id: null,
|
|
3711
3713
|
kind,
|
|
3712
3714
|
declare,
|
|
@@ -3717,7 +3719,7 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3717
3719
|
node.id = deserializeTSModuleDeclarationName(pos + 8);
|
|
3718
3720
|
} else {
|
|
3719
3721
|
node = {
|
|
3720
|
-
type:
|
|
3722
|
+
type: "TSModuleDeclaration",
|
|
3721
3723
|
id: null,
|
|
3722
3724
|
body,
|
|
3723
3725
|
kind,
|
|
@@ -3727,12 +3729,12 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3727
3729
|
end,
|
|
3728
3730
|
};
|
|
3729
3731
|
let id = deserializeTSModuleDeclarationName(pos + 8);
|
|
3730
|
-
if (body.type ===
|
|
3732
|
+
if (body.type === "TSModuleBlock") node.id = id;
|
|
3731
3733
|
else {
|
|
3732
3734
|
let innerId = body.id;
|
|
3733
|
-
if (innerId.type ===
|
|
3735
|
+
if (innerId.type === "Identifier")
|
|
3734
3736
|
node.id = {
|
|
3735
|
-
type:
|
|
3737
|
+
type: "TSQualifiedName",
|
|
3736
3738
|
left: id,
|
|
3737
3739
|
right: innerId,
|
|
3738
3740
|
start: id.start,
|
|
@@ -3745,19 +3747,19 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3745
3747
|
let { start } = id;
|
|
3746
3748
|
for (;;) {
|
|
3747
3749
|
innerId.start = start;
|
|
3748
|
-
if (innerId.left.type ===
|
|
3750
|
+
if (innerId.left.type === "Identifier") break;
|
|
3749
3751
|
innerId = innerId.left;
|
|
3750
3752
|
}
|
|
3751
3753
|
let right = innerId.left;
|
|
3752
3754
|
innerId.left = {
|
|
3753
|
-
type:
|
|
3755
|
+
type: "TSQualifiedName",
|
|
3754
3756
|
left: id,
|
|
3755
3757
|
right,
|
|
3756
3758
|
start,
|
|
3757
3759
|
end: right.end,
|
|
3758
3760
|
};
|
|
3759
3761
|
}
|
|
3760
|
-
if (Object.hasOwn(body,
|
|
3762
|
+
if (Object.hasOwn(body, "body")) {
|
|
3761
3763
|
body = body.body;
|
|
3762
3764
|
node.body = body;
|
|
3763
3765
|
} else body = null;
|
|
@@ -3769,9 +3771,9 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3769
3771
|
function deserializeTSModuleDeclarationKind(pos) {
|
|
3770
3772
|
switch (uint8[pos]) {
|
|
3771
3773
|
case 0:
|
|
3772
|
-
return
|
|
3774
|
+
return "module";
|
|
3773
3775
|
case 1:
|
|
3774
|
-
return
|
|
3776
|
+
return "namespace";
|
|
3775
3777
|
default:
|
|
3776
3778
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSModuleDeclarationKind`);
|
|
3777
3779
|
}
|
|
@@ -3803,7 +3805,7 @@ function deserializeTSGlobalDeclaration(pos) {
|
|
|
3803
3805
|
let start = deserializeU32(pos),
|
|
3804
3806
|
end = deserializeU32(pos + 4),
|
|
3805
3807
|
node = {
|
|
3806
|
-
type:
|
|
3808
|
+
type: "TSModuleDeclaration",
|
|
3807
3809
|
id: null,
|
|
3808
3810
|
body: null,
|
|
3809
3811
|
kind: null,
|
|
@@ -3813,20 +3815,20 @@ function deserializeTSGlobalDeclaration(pos) {
|
|
|
3813
3815
|
end,
|
|
3814
3816
|
};
|
|
3815
3817
|
node.id = {
|
|
3816
|
-
type:
|
|
3817
|
-
name:
|
|
3818
|
+
type: "Identifier",
|
|
3819
|
+
name: "global",
|
|
3818
3820
|
start: deserializeU32(pos + 8),
|
|
3819
3821
|
end: deserializeU32(pos + 12),
|
|
3820
3822
|
};
|
|
3821
3823
|
node.body = deserializeTSModuleBlock(pos + 16);
|
|
3822
|
-
node.kind =
|
|
3824
|
+
node.kind = "global";
|
|
3823
3825
|
node.global = true;
|
|
3824
3826
|
return node;
|
|
3825
3827
|
}
|
|
3826
3828
|
|
|
3827
3829
|
function deserializeTSModuleBlock(pos) {
|
|
3828
3830
|
let node = {
|
|
3829
|
-
type:
|
|
3831
|
+
type: "TSModuleBlock",
|
|
3830
3832
|
body: null,
|
|
3831
3833
|
start: deserializeU32(pos),
|
|
3832
3834
|
end: deserializeU32(pos + 4),
|
|
@@ -3839,7 +3841,7 @@ function deserializeTSModuleBlock(pos) {
|
|
|
3839
3841
|
|
|
3840
3842
|
function deserializeTSTypeLiteral(pos) {
|
|
3841
3843
|
let node = {
|
|
3842
|
-
type:
|
|
3844
|
+
type: "TSTypeLiteral",
|
|
3843
3845
|
members: null,
|
|
3844
3846
|
start: deserializeU32(pos),
|
|
3845
3847
|
end: deserializeU32(pos + 4),
|
|
@@ -3850,7 +3852,7 @@ function deserializeTSTypeLiteral(pos) {
|
|
|
3850
3852
|
|
|
3851
3853
|
function deserializeTSInferType(pos) {
|
|
3852
3854
|
let node = {
|
|
3853
|
-
type:
|
|
3855
|
+
type: "TSInferType",
|
|
3854
3856
|
typeParameter: null,
|
|
3855
3857
|
start: deserializeU32(pos),
|
|
3856
3858
|
end: deserializeU32(pos + 4),
|
|
@@ -3861,7 +3863,7 @@ function deserializeTSInferType(pos) {
|
|
|
3861
3863
|
|
|
3862
3864
|
function deserializeTSTypeQuery(pos) {
|
|
3863
3865
|
let node = {
|
|
3864
|
-
type:
|
|
3866
|
+
type: "TSTypeQuery",
|
|
3865
3867
|
exprName: null,
|
|
3866
3868
|
typeArguments: null,
|
|
3867
3869
|
start: deserializeU32(pos),
|
|
@@ -3889,18 +3891,18 @@ function deserializeTSTypeQueryExprName(pos) {
|
|
|
3889
3891
|
|
|
3890
3892
|
function deserializeTSImportType(pos) {
|
|
3891
3893
|
let node = {
|
|
3892
|
-
type:
|
|
3893
|
-
|
|
3894
|
+
type: "TSImportType",
|
|
3895
|
+
source: null,
|
|
3894
3896
|
options: null,
|
|
3895
3897
|
qualifier: null,
|
|
3896
3898
|
typeArguments: null,
|
|
3897
3899
|
start: deserializeU32(pos),
|
|
3898
3900
|
end: deserializeU32(pos + 4),
|
|
3899
3901
|
};
|
|
3900
|
-
node.
|
|
3901
|
-
node.options = deserializeOptionBoxObjectExpression(pos +
|
|
3902
|
-
node.qualifier = deserializeOptionTSImportTypeQualifier(pos +
|
|
3903
|
-
node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos +
|
|
3902
|
+
node.source = deserializeStringLiteral(pos + 8);
|
|
3903
|
+
node.options = deserializeOptionBoxObjectExpression(pos + 56);
|
|
3904
|
+
node.qualifier = deserializeOptionTSImportTypeQualifier(pos + 64);
|
|
3905
|
+
node.typeArguments = deserializeOptionBoxTSTypeParameterInstantiation(pos + 80);
|
|
3904
3906
|
return node;
|
|
3905
3907
|
}
|
|
3906
3908
|
|
|
@@ -3917,7 +3919,7 @@ function deserializeTSImportTypeQualifier(pos) {
|
|
|
3917
3919
|
|
|
3918
3920
|
function deserializeTSImportTypeQualifiedName(pos) {
|
|
3919
3921
|
let node = {
|
|
3920
|
-
type:
|
|
3922
|
+
type: "TSQualifiedName",
|
|
3921
3923
|
left: null,
|
|
3922
3924
|
right: null,
|
|
3923
3925
|
start: deserializeU32(pos),
|
|
@@ -3930,7 +3932,7 @@ function deserializeTSImportTypeQualifiedName(pos) {
|
|
|
3930
3932
|
|
|
3931
3933
|
function deserializeTSFunctionType(pos) {
|
|
3932
3934
|
let node = {
|
|
3933
|
-
type:
|
|
3935
|
+
type: "TSFunctionType",
|
|
3934
3936
|
typeParameters: null,
|
|
3935
3937
|
params: null,
|
|
3936
3938
|
returnType: null,
|
|
@@ -3950,7 +3952,7 @@ function deserializeTSConstructorType(pos) {
|
|
|
3950
3952
|
let start = deserializeU32(pos),
|
|
3951
3953
|
end = deserializeU32(pos + 4),
|
|
3952
3954
|
node = {
|
|
3953
|
-
type:
|
|
3955
|
+
type: "TSConstructorType",
|
|
3954
3956
|
abstract: deserializeBool(pos + 36),
|
|
3955
3957
|
typeParameters: null,
|
|
3956
3958
|
params: null,
|
|
@@ -3968,7 +3970,7 @@ function deserializeTSMappedType(pos) {
|
|
|
3968
3970
|
let start = deserializeU32(pos),
|
|
3969
3971
|
end = deserializeU32(pos + 4),
|
|
3970
3972
|
node = {
|
|
3971
|
-
type:
|
|
3973
|
+
type: "TSMappedType",
|
|
3972
3974
|
key: null,
|
|
3973
3975
|
constraint: null,
|
|
3974
3976
|
nameType: null,
|
|
@@ -3996,9 +3998,9 @@ function deserializeTSMappedTypeModifierOperator(pos) {
|
|
|
3996
3998
|
case 0:
|
|
3997
3999
|
return true;
|
|
3998
4000
|
case 1:
|
|
3999
|
-
return
|
|
4001
|
+
return "+";
|
|
4000
4002
|
case 2:
|
|
4001
|
-
return
|
|
4003
|
+
return "-";
|
|
4002
4004
|
default:
|
|
4003
4005
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSMappedTypeModifierOperator`);
|
|
4004
4006
|
}
|
|
@@ -4006,7 +4008,7 @@ function deserializeTSMappedTypeModifierOperator(pos) {
|
|
|
4006
4008
|
|
|
4007
4009
|
function deserializeTSTemplateLiteralType(pos) {
|
|
4008
4010
|
let node = {
|
|
4009
|
-
type:
|
|
4011
|
+
type: "TSTemplateLiteralType",
|
|
4010
4012
|
quasis: null,
|
|
4011
4013
|
types: null,
|
|
4012
4014
|
start: deserializeU32(pos),
|
|
@@ -4019,7 +4021,7 @@ function deserializeTSTemplateLiteralType(pos) {
|
|
|
4019
4021
|
|
|
4020
4022
|
function deserializeTSAsExpression(pos) {
|
|
4021
4023
|
let node = {
|
|
4022
|
-
type:
|
|
4024
|
+
type: "TSAsExpression",
|
|
4023
4025
|
expression: null,
|
|
4024
4026
|
typeAnnotation: null,
|
|
4025
4027
|
start: deserializeU32(pos),
|
|
@@ -4032,7 +4034,7 @@ function deserializeTSAsExpression(pos) {
|
|
|
4032
4034
|
|
|
4033
4035
|
function deserializeTSSatisfiesExpression(pos) {
|
|
4034
4036
|
let node = {
|
|
4035
|
-
type:
|
|
4037
|
+
type: "TSSatisfiesExpression",
|
|
4036
4038
|
expression: null,
|
|
4037
4039
|
typeAnnotation: null,
|
|
4038
4040
|
start: deserializeU32(pos),
|
|
@@ -4045,7 +4047,7 @@ function deserializeTSSatisfiesExpression(pos) {
|
|
|
4045
4047
|
|
|
4046
4048
|
function deserializeTSTypeAssertion(pos) {
|
|
4047
4049
|
let node = {
|
|
4048
|
-
type:
|
|
4050
|
+
type: "TSTypeAssertion",
|
|
4049
4051
|
typeAnnotation: null,
|
|
4050
4052
|
expression: null,
|
|
4051
4053
|
start: deserializeU32(pos),
|
|
@@ -4060,7 +4062,7 @@ function deserializeTSImportEqualsDeclaration(pos) {
|
|
|
4060
4062
|
let start = deserializeU32(pos),
|
|
4061
4063
|
end = deserializeU32(pos + 4),
|
|
4062
4064
|
node = {
|
|
4063
|
-
type:
|
|
4065
|
+
type: "TSImportEqualsDeclaration",
|
|
4064
4066
|
id: null,
|
|
4065
4067
|
moduleReference: null,
|
|
4066
4068
|
importKind: deserializeImportOrExportKind(pos + 56),
|
|
@@ -4089,7 +4091,7 @@ function deserializeTSModuleReference(pos) {
|
|
|
4089
4091
|
|
|
4090
4092
|
function deserializeTSExternalModuleReference(pos) {
|
|
4091
4093
|
let node = {
|
|
4092
|
-
type:
|
|
4094
|
+
type: "TSExternalModuleReference",
|
|
4093
4095
|
expression: null,
|
|
4094
4096
|
start: deserializeU32(pos),
|
|
4095
4097
|
end: deserializeU32(pos + 4),
|
|
@@ -4100,7 +4102,7 @@ function deserializeTSExternalModuleReference(pos) {
|
|
|
4100
4102
|
|
|
4101
4103
|
function deserializeTSNonNullExpression(pos) {
|
|
4102
4104
|
let node = {
|
|
4103
|
-
type:
|
|
4105
|
+
type: "TSNonNullExpression",
|
|
4104
4106
|
expression: null,
|
|
4105
4107
|
start: deserializeU32(pos),
|
|
4106
4108
|
end: deserializeU32(pos + 4),
|
|
@@ -4111,7 +4113,7 @@ function deserializeTSNonNullExpression(pos) {
|
|
|
4111
4113
|
|
|
4112
4114
|
function deserializeDecorator(pos) {
|
|
4113
4115
|
let node = {
|
|
4114
|
-
type:
|
|
4116
|
+
type: "Decorator",
|
|
4115
4117
|
expression: null,
|
|
4116
4118
|
start: deserializeU32(pos),
|
|
4117
4119
|
end: deserializeU32(pos + 4),
|
|
@@ -4122,7 +4124,7 @@ function deserializeDecorator(pos) {
|
|
|
4122
4124
|
|
|
4123
4125
|
function deserializeTSExportAssignment(pos) {
|
|
4124
4126
|
let node = {
|
|
4125
|
-
type:
|
|
4127
|
+
type: "TSExportAssignment",
|
|
4126
4128
|
expression: null,
|
|
4127
4129
|
start: deserializeU32(pos),
|
|
4128
4130
|
end: deserializeU32(pos + 4),
|
|
@@ -4133,7 +4135,7 @@ function deserializeTSExportAssignment(pos) {
|
|
|
4133
4135
|
|
|
4134
4136
|
function deserializeTSNamespaceExportDeclaration(pos) {
|
|
4135
4137
|
let node = {
|
|
4136
|
-
type:
|
|
4138
|
+
type: "TSNamespaceExportDeclaration",
|
|
4137
4139
|
id: null,
|
|
4138
4140
|
start: deserializeU32(pos),
|
|
4139
4141
|
end: deserializeU32(pos + 4),
|
|
@@ -4144,7 +4146,7 @@ function deserializeTSNamespaceExportDeclaration(pos) {
|
|
|
4144
4146
|
|
|
4145
4147
|
function deserializeTSInstantiationExpression(pos) {
|
|
4146
4148
|
let node = {
|
|
4147
|
-
type:
|
|
4149
|
+
type: "TSInstantiationExpression",
|
|
4148
4150
|
expression: null,
|
|
4149
4151
|
typeArguments: null,
|
|
4150
4152
|
start: deserializeU32(pos),
|
|
@@ -4158,9 +4160,9 @@ function deserializeTSInstantiationExpression(pos) {
|
|
|
4158
4160
|
function deserializeImportOrExportKind(pos) {
|
|
4159
4161
|
switch (uint8[pos]) {
|
|
4160
4162
|
case 0:
|
|
4161
|
-
return
|
|
4163
|
+
return "value";
|
|
4162
4164
|
case 1:
|
|
4163
|
-
return
|
|
4165
|
+
return "type";
|
|
4164
4166
|
default:
|
|
4165
4167
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ImportOrExportKind`);
|
|
4166
4168
|
}
|
|
@@ -4170,7 +4172,7 @@ function deserializeJSDocNullableType(pos) {
|
|
|
4170
4172
|
let start = deserializeU32(pos),
|
|
4171
4173
|
end = deserializeU32(pos + 4),
|
|
4172
4174
|
node = {
|
|
4173
|
-
type:
|
|
4175
|
+
type: "TSJSDocNullableType",
|
|
4174
4176
|
typeAnnotation: null,
|
|
4175
4177
|
postfix: deserializeBool(pos + 24),
|
|
4176
4178
|
start,
|
|
@@ -4184,7 +4186,7 @@ function deserializeJSDocNonNullableType(pos) {
|
|
|
4184
4186
|
let start = deserializeU32(pos),
|
|
4185
4187
|
end = deserializeU32(pos + 4),
|
|
4186
4188
|
node = {
|
|
4187
|
-
type:
|
|
4189
|
+
type: "TSJSDocNonNullableType",
|
|
4188
4190
|
typeAnnotation: null,
|
|
4189
4191
|
postfix: deserializeBool(pos + 24),
|
|
4190
4192
|
start,
|
|
@@ -4196,7 +4198,7 @@ function deserializeJSDocNonNullableType(pos) {
|
|
|
4196
4198
|
|
|
4197
4199
|
function deserializeJSDocUnknownType(pos) {
|
|
4198
4200
|
return {
|
|
4199
|
-
type:
|
|
4201
|
+
type: "TSJSDocUnknownType",
|
|
4200
4202
|
start: deserializeU32(pos),
|
|
4201
4203
|
end: deserializeU32(pos + 4),
|
|
4202
4204
|
};
|
|
@@ -4205,9 +4207,9 @@ function deserializeJSDocUnknownType(pos) {
|
|
|
4205
4207
|
function deserializeCommentKind(pos) {
|
|
4206
4208
|
switch (uint8[pos]) {
|
|
4207
4209
|
case 0:
|
|
4208
|
-
return
|
|
4210
|
+
return "Line";
|
|
4209
4211
|
case 1:
|
|
4210
|
-
return
|
|
4212
|
+
return "Block";
|
|
4211
4213
|
default:
|
|
4212
4214
|
throw Error(`Unexpected discriminant ${uint8[pos]} for CommentKind`);
|
|
4213
4215
|
}
|
|
@@ -4219,7 +4221,7 @@ function deserializeComment(pos) {
|
|
|
4219
4221
|
end = deserializeU32(pos + 4);
|
|
4220
4222
|
return {
|
|
4221
4223
|
type,
|
|
4222
|
-
value: sourceText.slice(start + 2, end - (type ===
|
|
4224
|
+
value: sourceText.slice(start + 2, end - (type === "Line" ? 0 : 2)),
|
|
4223
4225
|
start,
|
|
4224
4226
|
end,
|
|
4225
4227
|
};
|
|
@@ -4248,14 +4250,14 @@ function deserializeImportImportName(pos) {
|
|
|
4248
4250
|
case 0:
|
|
4249
4251
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4250
4252
|
return {
|
|
4251
|
-
kind:
|
|
4253
|
+
kind: "Name",
|
|
4252
4254
|
name: nameSpan.value,
|
|
4253
4255
|
start: nameSpan.start,
|
|
4254
4256
|
end: nameSpan.end,
|
|
4255
4257
|
};
|
|
4256
4258
|
case 1:
|
|
4257
4259
|
return {
|
|
4258
|
-
kind:
|
|
4260
|
+
kind: "NamespaceObject",
|
|
4259
4261
|
name: null,
|
|
4260
4262
|
start: null,
|
|
4261
4263
|
end: null,
|
|
@@ -4263,7 +4265,7 @@ function deserializeImportImportName(pos) {
|
|
|
4263
4265
|
case 2:
|
|
4264
4266
|
var { start, end } = deserializeSpan(pos + 8);
|
|
4265
4267
|
return {
|
|
4266
|
-
kind:
|
|
4268
|
+
kind: "Default",
|
|
4267
4269
|
name: null,
|
|
4268
4270
|
start,
|
|
4269
4271
|
end,
|
|
@@ -4292,28 +4294,28 @@ function deserializeExportImportName(pos) {
|
|
|
4292
4294
|
case 0:
|
|
4293
4295
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4294
4296
|
return {
|
|
4295
|
-
kind:
|
|
4297
|
+
kind: "Name",
|
|
4296
4298
|
name: nameSpan.value,
|
|
4297
4299
|
start: nameSpan.start,
|
|
4298
4300
|
end: nameSpan.end,
|
|
4299
4301
|
};
|
|
4300
4302
|
case 1:
|
|
4301
4303
|
return {
|
|
4302
|
-
kind:
|
|
4304
|
+
kind: "All",
|
|
4303
4305
|
name: null,
|
|
4304
4306
|
start: null,
|
|
4305
4307
|
end: null,
|
|
4306
4308
|
};
|
|
4307
4309
|
case 2:
|
|
4308
4310
|
return {
|
|
4309
|
-
kind:
|
|
4311
|
+
kind: "AllButDefault",
|
|
4310
4312
|
name: null,
|
|
4311
4313
|
start: null,
|
|
4312
4314
|
end: null,
|
|
4313
4315
|
};
|
|
4314
4316
|
case 3:
|
|
4315
4317
|
return {
|
|
4316
|
-
kind:
|
|
4318
|
+
kind: "None",
|
|
4317
4319
|
name: null,
|
|
4318
4320
|
start: null,
|
|
4319
4321
|
end: null,
|
|
@@ -4328,7 +4330,7 @@ function deserializeExportExportName(pos) {
|
|
|
4328
4330
|
case 0:
|
|
4329
4331
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4330
4332
|
return {
|
|
4331
|
-
kind:
|
|
4333
|
+
kind: "Name",
|
|
4332
4334
|
name: nameSpan.value,
|
|
4333
4335
|
start: nameSpan.start,
|
|
4334
4336
|
end: nameSpan.end,
|
|
@@ -4336,14 +4338,14 @@ function deserializeExportExportName(pos) {
|
|
|
4336
4338
|
case 1:
|
|
4337
4339
|
var { start, end } = deserializeSpan(pos + 8);
|
|
4338
4340
|
return {
|
|
4339
|
-
kind:
|
|
4341
|
+
kind: "Default",
|
|
4340
4342
|
name: null,
|
|
4341
4343
|
start,
|
|
4342
4344
|
end,
|
|
4343
4345
|
};
|
|
4344
4346
|
case 2:
|
|
4345
4347
|
return {
|
|
4346
|
-
kind:
|
|
4348
|
+
kind: "None",
|
|
4347
4349
|
name: null,
|
|
4348
4350
|
start: null,
|
|
4349
4351
|
end: null,
|
|
@@ -4358,7 +4360,7 @@ function deserializeExportLocalName(pos) {
|
|
|
4358
4360
|
case 0:
|
|
4359
4361
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4360
4362
|
return {
|
|
4361
|
-
kind:
|
|
4363
|
+
kind: "Name",
|
|
4362
4364
|
name: nameSpan.value,
|
|
4363
4365
|
start: nameSpan.start,
|
|
4364
4366
|
end: nameSpan.end,
|
|
@@ -4366,14 +4368,14 @@ function deserializeExportLocalName(pos) {
|
|
|
4366
4368
|
case 1:
|
|
4367
4369
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4368
4370
|
return {
|
|
4369
|
-
kind:
|
|
4371
|
+
kind: "Default",
|
|
4370
4372
|
name: nameSpan.value,
|
|
4371
4373
|
start: nameSpan.start,
|
|
4372
4374
|
end: nameSpan.end,
|
|
4373
4375
|
};
|
|
4374
4376
|
case 2:
|
|
4375
4377
|
return {
|
|
4376
|
-
kind:
|
|
4378
|
+
kind: "None",
|
|
4377
4379
|
name: null,
|
|
4378
4380
|
start: null,
|
|
4379
4381
|
end: null,
|
|
@@ -4396,37 +4398,37 @@ function deserializeDynamicImport(pos) {
|
|
|
4396
4398
|
function deserializeAssignmentOperator(pos) {
|
|
4397
4399
|
switch (uint8[pos]) {
|
|
4398
4400
|
case 0:
|
|
4399
|
-
return
|
|
4401
|
+
return "=";
|
|
4400
4402
|
case 1:
|
|
4401
|
-
return
|
|
4403
|
+
return "+=";
|
|
4402
4404
|
case 2:
|
|
4403
|
-
return
|
|
4405
|
+
return "-=";
|
|
4404
4406
|
case 3:
|
|
4405
|
-
return
|
|
4407
|
+
return "*=";
|
|
4406
4408
|
case 4:
|
|
4407
|
-
return
|
|
4409
|
+
return "/=";
|
|
4408
4410
|
case 5:
|
|
4409
|
-
return
|
|
4411
|
+
return "%=";
|
|
4410
4412
|
case 6:
|
|
4411
|
-
return
|
|
4413
|
+
return "**=";
|
|
4412
4414
|
case 7:
|
|
4413
|
-
return
|
|
4415
|
+
return "<<=";
|
|
4414
4416
|
case 8:
|
|
4415
|
-
return
|
|
4417
|
+
return ">>=";
|
|
4416
4418
|
case 9:
|
|
4417
|
-
return
|
|
4419
|
+
return ">>>=";
|
|
4418
4420
|
case 10:
|
|
4419
|
-
return
|
|
4421
|
+
return "|=";
|
|
4420
4422
|
case 11:
|
|
4421
|
-
return
|
|
4423
|
+
return "^=";
|
|
4422
4424
|
case 12:
|
|
4423
|
-
return
|
|
4425
|
+
return "&=";
|
|
4424
4426
|
case 13:
|
|
4425
|
-
return
|
|
4427
|
+
return "||=";
|
|
4426
4428
|
case 14:
|
|
4427
|
-
return
|
|
4429
|
+
return "&&=";
|
|
4428
4430
|
case 15:
|
|
4429
|
-
return
|
|
4431
|
+
return "??=";
|
|
4430
4432
|
default:
|
|
4431
4433
|
throw Error(`Unexpected discriminant ${uint8[pos]} for AssignmentOperator`);
|
|
4432
4434
|
}
|
|
@@ -4435,49 +4437,49 @@ function deserializeAssignmentOperator(pos) {
|
|
|
4435
4437
|
function deserializeBinaryOperator(pos) {
|
|
4436
4438
|
switch (uint8[pos]) {
|
|
4437
4439
|
case 0:
|
|
4438
|
-
return
|
|
4440
|
+
return "==";
|
|
4439
4441
|
case 1:
|
|
4440
|
-
return
|
|
4442
|
+
return "!=";
|
|
4441
4443
|
case 2:
|
|
4442
|
-
return
|
|
4444
|
+
return "===";
|
|
4443
4445
|
case 3:
|
|
4444
|
-
return
|
|
4446
|
+
return "!==";
|
|
4445
4447
|
case 4:
|
|
4446
|
-
return
|
|
4448
|
+
return "<";
|
|
4447
4449
|
case 5:
|
|
4448
|
-
return
|
|
4450
|
+
return "<=";
|
|
4449
4451
|
case 6:
|
|
4450
|
-
return
|
|
4452
|
+
return ">";
|
|
4451
4453
|
case 7:
|
|
4452
|
-
return
|
|
4454
|
+
return ">=";
|
|
4453
4455
|
case 8:
|
|
4454
|
-
return
|
|
4456
|
+
return "+";
|
|
4455
4457
|
case 9:
|
|
4456
|
-
return
|
|
4458
|
+
return "-";
|
|
4457
4459
|
case 10:
|
|
4458
|
-
return
|
|
4460
|
+
return "*";
|
|
4459
4461
|
case 11:
|
|
4460
|
-
return
|
|
4462
|
+
return "/";
|
|
4461
4463
|
case 12:
|
|
4462
|
-
return
|
|
4464
|
+
return "%";
|
|
4463
4465
|
case 13:
|
|
4464
|
-
return
|
|
4466
|
+
return "**";
|
|
4465
4467
|
case 14:
|
|
4466
|
-
return
|
|
4468
|
+
return "<<";
|
|
4467
4469
|
case 15:
|
|
4468
|
-
return
|
|
4470
|
+
return ">>";
|
|
4469
4471
|
case 16:
|
|
4470
|
-
return
|
|
4472
|
+
return ">>>";
|
|
4471
4473
|
case 17:
|
|
4472
|
-
return
|
|
4474
|
+
return "|";
|
|
4473
4475
|
case 18:
|
|
4474
|
-
return
|
|
4476
|
+
return "^";
|
|
4475
4477
|
case 19:
|
|
4476
|
-
return
|
|
4478
|
+
return "&";
|
|
4477
4479
|
case 20:
|
|
4478
|
-
return
|
|
4480
|
+
return "in";
|
|
4479
4481
|
case 21:
|
|
4480
|
-
return
|
|
4482
|
+
return "instanceof";
|
|
4481
4483
|
default:
|
|
4482
4484
|
throw Error(`Unexpected discriminant ${uint8[pos]} for BinaryOperator`);
|
|
4483
4485
|
}
|
|
@@ -4486,11 +4488,11 @@ function deserializeBinaryOperator(pos) {
|
|
|
4486
4488
|
function deserializeLogicalOperator(pos) {
|
|
4487
4489
|
switch (uint8[pos]) {
|
|
4488
4490
|
case 0:
|
|
4489
|
-
return
|
|
4491
|
+
return "||";
|
|
4490
4492
|
case 1:
|
|
4491
|
-
return
|
|
4493
|
+
return "&&";
|
|
4492
4494
|
case 2:
|
|
4493
|
-
return
|
|
4495
|
+
return "??";
|
|
4494
4496
|
default:
|
|
4495
4497
|
throw Error(`Unexpected discriminant ${uint8[pos]} for LogicalOperator`);
|
|
4496
4498
|
}
|
|
@@ -4499,19 +4501,19 @@ function deserializeLogicalOperator(pos) {
|
|
|
4499
4501
|
function deserializeUnaryOperator(pos) {
|
|
4500
4502
|
switch (uint8[pos]) {
|
|
4501
4503
|
case 0:
|
|
4502
|
-
return
|
|
4504
|
+
return "+";
|
|
4503
4505
|
case 1:
|
|
4504
|
-
return
|
|
4506
|
+
return "-";
|
|
4505
4507
|
case 2:
|
|
4506
|
-
return
|
|
4508
|
+
return "!";
|
|
4507
4509
|
case 3:
|
|
4508
|
-
return
|
|
4510
|
+
return "~";
|
|
4509
4511
|
case 4:
|
|
4510
|
-
return
|
|
4512
|
+
return "typeof";
|
|
4511
4513
|
case 5:
|
|
4512
|
-
return
|
|
4514
|
+
return "void";
|
|
4513
4515
|
case 6:
|
|
4514
|
-
return
|
|
4516
|
+
return "delete";
|
|
4515
4517
|
default:
|
|
4516
4518
|
throw Error(`Unexpected discriminant ${uint8[pos]} for UnaryOperator`);
|
|
4517
4519
|
}
|
|
@@ -4520,9 +4522,9 @@ function deserializeUnaryOperator(pos) {
|
|
|
4520
4522
|
function deserializeUpdateOperator(pos) {
|
|
4521
4523
|
switch (uint8[pos]) {
|
|
4522
4524
|
case 0:
|
|
4523
|
-
return
|
|
4525
|
+
return "++";
|
|
4524
4526
|
case 1:
|
|
4525
|
-
return
|
|
4527
|
+
return "--";
|
|
4526
4528
|
default:
|
|
4527
4529
|
throw Error(`Unexpected discriminant ${uint8[pos]} for UpdateOperator`);
|
|
4528
4530
|
}
|
|
@@ -4538,9 +4540,9 @@ function deserializeSpan(pos) {
|
|
|
4538
4540
|
function deserializeModuleKind(pos) {
|
|
4539
4541
|
switch (uint8[pos]) {
|
|
4540
4542
|
case 0:
|
|
4541
|
-
return
|
|
4543
|
+
return "script";
|
|
4542
4544
|
case 1:
|
|
4543
|
-
return
|
|
4545
|
+
return "module";
|
|
4544
4546
|
default:
|
|
4545
4547
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ModuleKind`);
|
|
4546
4548
|
}
|
|
@@ -4568,11 +4570,11 @@ function deserializeError(pos) {
|
|
|
4568
4570
|
function deserializeErrorSeverity(pos) {
|
|
4569
4571
|
switch (uint8[pos]) {
|
|
4570
4572
|
case 0:
|
|
4571
|
-
return
|
|
4573
|
+
return "Error";
|
|
4572
4574
|
case 1:
|
|
4573
|
-
return
|
|
4575
|
+
return "Warning";
|
|
4574
4576
|
case 2:
|
|
4575
|
-
return
|
|
4577
|
+
return "Advice";
|
|
4576
4578
|
default:
|
|
4577
4579
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ErrorSeverity`);
|
|
4578
4580
|
}
|
|
@@ -4630,7 +4632,7 @@ function deserializeU8(pos) {
|
|
|
4630
4632
|
function deserializeStr(pos) {
|
|
4631
4633
|
let pos32 = pos >> 2,
|
|
4632
4634
|
len = uint32[pos32 + 2];
|
|
4633
|
-
if (len === 0) return
|
|
4635
|
+
if (len === 0) return "";
|
|
4634
4636
|
pos = uint32[pos32];
|
|
4635
4637
|
if (sourceIsAscii && pos < sourceByteLen) return sourceText.substr(pos, len);
|
|
4636
4638
|
// Longer strings use `TextDecoder`
|
|
@@ -4638,7 +4640,7 @@ function deserializeStr(pos) {
|
|
|
4638
4640
|
let end = pos + len;
|
|
4639
4641
|
if (len > 50) return decodeStr(uint8.subarray(pos, end));
|
|
4640
4642
|
// Shorter strings decode by hand to avoid native call
|
|
4641
|
-
let out =
|
|
4643
|
+
let out = "",
|
|
4642
4644
|
c;
|
|
4643
4645
|
do {
|
|
4644
4646
|
c = uint8[pos++];
|