oxc-parser 0.98.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 +362 -330
- package/generated/deserialize/js_range.js +366 -330
- package/generated/deserialize/ts.js +381 -342
- package/generated/deserialize/ts_range.js +385 -342
- package/generated/lazy/constructors.js +607 -496
- package/generated/lazy/type_ids.js +181 -180
- package/generated/lazy/walk.js +60 -29
- package/generated/visit/keys.js +214 -166
- package/generated/visit/type_ids.js +165 -165
- package/generated/visit/visitor.d.ts +172 -168
- package/generated/visit/walk.js +165 -165
- package/package.json +27 -27
- 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,
|
|
@@ -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),
|
|
@@ -1139,6 +1141,8 @@ function deserializeStatement(pos) {
|
|
|
1139
1141
|
case 38:
|
|
1140
1142
|
return deserializeBoxTSModuleDeclaration(pos + 8);
|
|
1141
1143
|
case 39:
|
|
1144
|
+
return deserializeBoxTSGlobalDeclaration(pos + 8);
|
|
1145
|
+
case 40:
|
|
1142
1146
|
return deserializeBoxTSImportEqualsDeclaration(pos + 8);
|
|
1143
1147
|
case 64:
|
|
1144
1148
|
return deserializeBoxImportDeclaration(pos + 8);
|
|
@@ -1161,7 +1165,7 @@ function deserializeDirective(pos) {
|
|
|
1161
1165
|
let start = deserializeU32(pos),
|
|
1162
1166
|
end = deserializeU32(pos + 4),
|
|
1163
1167
|
node = {
|
|
1164
|
-
type:
|
|
1168
|
+
type: "ExpressionStatement",
|
|
1165
1169
|
expression: null,
|
|
1166
1170
|
directive: deserializeStr(pos + 56),
|
|
1167
1171
|
start,
|
|
@@ -1175,7 +1179,7 @@ function deserializeHashbang(pos) {
|
|
|
1175
1179
|
let start = deserializeU32(pos),
|
|
1176
1180
|
end = deserializeU32(pos + 4);
|
|
1177
1181
|
return {
|
|
1178
|
-
type:
|
|
1182
|
+
type: "Hashbang",
|
|
1179
1183
|
value: deserializeStr(pos + 8),
|
|
1180
1184
|
start,
|
|
1181
1185
|
end,
|
|
@@ -1184,7 +1188,7 @@ function deserializeHashbang(pos) {
|
|
|
1184
1188
|
|
|
1185
1189
|
function deserializeBlockStatement(pos) {
|
|
1186
1190
|
let node = {
|
|
1187
|
-
type:
|
|
1191
|
+
type: "BlockStatement",
|
|
1188
1192
|
body: null,
|
|
1189
1193
|
start: deserializeU32(pos),
|
|
1190
1194
|
end: deserializeU32(pos + 4),
|
|
@@ -1210,6 +1214,8 @@ function deserializeDeclaration(pos) {
|
|
|
1210
1214
|
case 38:
|
|
1211
1215
|
return deserializeBoxTSModuleDeclaration(pos + 8);
|
|
1212
1216
|
case 39:
|
|
1217
|
+
return deserializeBoxTSGlobalDeclaration(pos + 8);
|
|
1218
|
+
case 40:
|
|
1213
1219
|
return deserializeBoxTSImportEqualsDeclaration(pos + 8);
|
|
1214
1220
|
default:
|
|
1215
1221
|
throw Error(`Unexpected discriminant ${uint8[pos]} for Declaration`);
|
|
@@ -1220,7 +1226,7 @@ function deserializeVariableDeclaration(pos) {
|
|
|
1220
1226
|
let start = deserializeU32(pos),
|
|
1221
1227
|
end = deserializeU32(pos + 4),
|
|
1222
1228
|
node = {
|
|
1223
|
-
type:
|
|
1229
|
+
type: "VariableDeclaration",
|
|
1224
1230
|
kind: deserializeVariableDeclarationKind(pos + 32),
|
|
1225
1231
|
declarations: null,
|
|
1226
1232
|
start,
|
|
@@ -1233,15 +1239,15 @@ function deserializeVariableDeclaration(pos) {
|
|
|
1233
1239
|
function deserializeVariableDeclarationKind(pos) {
|
|
1234
1240
|
switch (uint8[pos]) {
|
|
1235
1241
|
case 0:
|
|
1236
|
-
return
|
|
1242
|
+
return "var";
|
|
1237
1243
|
case 1:
|
|
1238
|
-
return
|
|
1244
|
+
return "let";
|
|
1239
1245
|
case 2:
|
|
1240
|
-
return
|
|
1246
|
+
return "const";
|
|
1241
1247
|
case 3:
|
|
1242
|
-
return
|
|
1248
|
+
return "using";
|
|
1243
1249
|
case 4:
|
|
1244
|
-
return
|
|
1250
|
+
return "await using";
|
|
1245
1251
|
default:
|
|
1246
1252
|
throw Error(`Unexpected discriminant ${uint8[pos]} for VariableDeclarationKind`);
|
|
1247
1253
|
}
|
|
@@ -1249,7 +1255,7 @@ function deserializeVariableDeclarationKind(pos) {
|
|
|
1249
1255
|
|
|
1250
1256
|
function deserializeVariableDeclarator(pos) {
|
|
1251
1257
|
let node = {
|
|
1252
|
-
type:
|
|
1258
|
+
type: "VariableDeclarator",
|
|
1253
1259
|
id: null,
|
|
1254
1260
|
init: null,
|
|
1255
1261
|
start: deserializeU32(pos),
|
|
@@ -1262,7 +1268,7 @@ function deserializeVariableDeclarator(pos) {
|
|
|
1262
1268
|
|
|
1263
1269
|
function deserializeEmptyStatement(pos) {
|
|
1264
1270
|
return {
|
|
1265
|
-
type:
|
|
1271
|
+
type: "EmptyStatement",
|
|
1266
1272
|
start: deserializeU32(pos),
|
|
1267
1273
|
end: deserializeU32(pos + 4),
|
|
1268
1274
|
};
|
|
@@ -1270,7 +1276,7 @@ function deserializeEmptyStatement(pos) {
|
|
|
1270
1276
|
|
|
1271
1277
|
function deserializeExpressionStatement(pos) {
|
|
1272
1278
|
let node = {
|
|
1273
|
-
type:
|
|
1279
|
+
type: "ExpressionStatement",
|
|
1274
1280
|
expression: null,
|
|
1275
1281
|
start: deserializeU32(pos),
|
|
1276
1282
|
end: deserializeU32(pos + 4),
|
|
@@ -1281,7 +1287,7 @@ function deserializeExpressionStatement(pos) {
|
|
|
1281
1287
|
|
|
1282
1288
|
function deserializeIfStatement(pos) {
|
|
1283
1289
|
let node = {
|
|
1284
|
-
type:
|
|
1290
|
+
type: "IfStatement",
|
|
1285
1291
|
test: null,
|
|
1286
1292
|
consequent: null,
|
|
1287
1293
|
alternate: null,
|
|
@@ -1296,7 +1302,7 @@ function deserializeIfStatement(pos) {
|
|
|
1296
1302
|
|
|
1297
1303
|
function deserializeDoWhileStatement(pos) {
|
|
1298
1304
|
let node = {
|
|
1299
|
-
type:
|
|
1305
|
+
type: "DoWhileStatement",
|
|
1300
1306
|
body: null,
|
|
1301
1307
|
test: null,
|
|
1302
1308
|
start: deserializeU32(pos),
|
|
@@ -1309,7 +1315,7 @@ function deserializeDoWhileStatement(pos) {
|
|
|
1309
1315
|
|
|
1310
1316
|
function deserializeWhileStatement(pos) {
|
|
1311
1317
|
let node = {
|
|
1312
|
-
type:
|
|
1318
|
+
type: "WhileStatement",
|
|
1313
1319
|
test: null,
|
|
1314
1320
|
body: null,
|
|
1315
1321
|
start: deserializeU32(pos),
|
|
@@ -1322,7 +1328,7 @@ function deserializeWhileStatement(pos) {
|
|
|
1322
1328
|
|
|
1323
1329
|
function deserializeForStatement(pos) {
|
|
1324
1330
|
let node = {
|
|
1325
|
-
type:
|
|
1331
|
+
type: "ForStatement",
|
|
1326
1332
|
init: null,
|
|
1327
1333
|
test: null,
|
|
1328
1334
|
update: null,
|
|
@@ -1434,7 +1440,7 @@ function deserializeForStatementInit(pos) {
|
|
|
1434
1440
|
|
|
1435
1441
|
function deserializeForInStatement(pos) {
|
|
1436
1442
|
let node = {
|
|
1437
|
-
type:
|
|
1443
|
+
type: "ForInStatement",
|
|
1438
1444
|
left: null,
|
|
1439
1445
|
right: null,
|
|
1440
1446
|
body: null,
|
|
@@ -1480,7 +1486,7 @@ function deserializeForOfStatement(pos) {
|
|
|
1480
1486
|
let start = deserializeU32(pos),
|
|
1481
1487
|
end = deserializeU32(pos + 4),
|
|
1482
1488
|
node = {
|
|
1483
|
-
type:
|
|
1489
|
+
type: "ForOfStatement",
|
|
1484
1490
|
await: deserializeBool(pos + 60),
|
|
1485
1491
|
left: null,
|
|
1486
1492
|
right: null,
|
|
@@ -1496,7 +1502,7 @@ function deserializeForOfStatement(pos) {
|
|
|
1496
1502
|
|
|
1497
1503
|
function deserializeContinueStatement(pos) {
|
|
1498
1504
|
let node = {
|
|
1499
|
-
type:
|
|
1505
|
+
type: "ContinueStatement",
|
|
1500
1506
|
label: null,
|
|
1501
1507
|
start: deserializeU32(pos),
|
|
1502
1508
|
end: deserializeU32(pos + 4),
|
|
@@ -1507,7 +1513,7 @@ function deserializeContinueStatement(pos) {
|
|
|
1507
1513
|
|
|
1508
1514
|
function deserializeBreakStatement(pos) {
|
|
1509
1515
|
let node = {
|
|
1510
|
-
type:
|
|
1516
|
+
type: "BreakStatement",
|
|
1511
1517
|
label: null,
|
|
1512
1518
|
start: deserializeU32(pos),
|
|
1513
1519
|
end: deserializeU32(pos + 4),
|
|
@@ -1518,7 +1524,7 @@ function deserializeBreakStatement(pos) {
|
|
|
1518
1524
|
|
|
1519
1525
|
function deserializeReturnStatement(pos) {
|
|
1520
1526
|
let node = {
|
|
1521
|
-
type:
|
|
1527
|
+
type: "ReturnStatement",
|
|
1522
1528
|
argument: null,
|
|
1523
1529
|
start: deserializeU32(pos),
|
|
1524
1530
|
end: deserializeU32(pos + 4),
|
|
@@ -1529,7 +1535,7 @@ function deserializeReturnStatement(pos) {
|
|
|
1529
1535
|
|
|
1530
1536
|
function deserializeWithStatement(pos) {
|
|
1531
1537
|
let node = {
|
|
1532
|
-
type:
|
|
1538
|
+
type: "WithStatement",
|
|
1533
1539
|
object: null,
|
|
1534
1540
|
body: null,
|
|
1535
1541
|
start: deserializeU32(pos),
|
|
@@ -1542,7 +1548,7 @@ function deserializeWithStatement(pos) {
|
|
|
1542
1548
|
|
|
1543
1549
|
function deserializeSwitchStatement(pos) {
|
|
1544
1550
|
let node = {
|
|
1545
|
-
type:
|
|
1551
|
+
type: "SwitchStatement",
|
|
1546
1552
|
discriminant: null,
|
|
1547
1553
|
cases: null,
|
|
1548
1554
|
start: deserializeU32(pos),
|
|
@@ -1555,7 +1561,7 @@ function deserializeSwitchStatement(pos) {
|
|
|
1555
1561
|
|
|
1556
1562
|
function deserializeSwitchCase(pos) {
|
|
1557
1563
|
let node = {
|
|
1558
|
-
type:
|
|
1564
|
+
type: "SwitchCase",
|
|
1559
1565
|
test: null,
|
|
1560
1566
|
consequent: null,
|
|
1561
1567
|
start: deserializeU32(pos),
|
|
@@ -1568,7 +1574,7 @@ function deserializeSwitchCase(pos) {
|
|
|
1568
1574
|
|
|
1569
1575
|
function deserializeLabeledStatement(pos) {
|
|
1570
1576
|
let node = {
|
|
1571
|
-
type:
|
|
1577
|
+
type: "LabeledStatement",
|
|
1572
1578
|
label: null,
|
|
1573
1579
|
body: null,
|
|
1574
1580
|
start: deserializeU32(pos),
|
|
@@ -1581,7 +1587,7 @@ function deserializeLabeledStatement(pos) {
|
|
|
1581
1587
|
|
|
1582
1588
|
function deserializeThrowStatement(pos) {
|
|
1583
1589
|
let node = {
|
|
1584
|
-
type:
|
|
1590
|
+
type: "ThrowStatement",
|
|
1585
1591
|
argument: null,
|
|
1586
1592
|
start: deserializeU32(pos),
|
|
1587
1593
|
end: deserializeU32(pos + 4),
|
|
@@ -1592,7 +1598,7 @@ function deserializeThrowStatement(pos) {
|
|
|
1592
1598
|
|
|
1593
1599
|
function deserializeTryStatement(pos) {
|
|
1594
1600
|
let node = {
|
|
1595
|
-
type:
|
|
1601
|
+
type: "TryStatement",
|
|
1596
1602
|
block: null,
|
|
1597
1603
|
handler: null,
|
|
1598
1604
|
finalizer: null,
|
|
@@ -1607,7 +1613,7 @@ function deserializeTryStatement(pos) {
|
|
|
1607
1613
|
|
|
1608
1614
|
function deserializeCatchClause(pos) {
|
|
1609
1615
|
let node = {
|
|
1610
|
-
type:
|
|
1616
|
+
type: "CatchClause",
|
|
1611
1617
|
param: null,
|
|
1612
1618
|
body: null,
|
|
1613
1619
|
start: deserializeU32(pos),
|
|
@@ -1624,7 +1630,7 @@ function deserializeCatchParameter(pos) {
|
|
|
1624
1630
|
|
|
1625
1631
|
function deserializeDebuggerStatement(pos) {
|
|
1626
1632
|
return {
|
|
1627
|
-
type:
|
|
1633
|
+
type: "DebuggerStatement",
|
|
1628
1634
|
start: deserializeU32(pos),
|
|
1629
1635
|
end: deserializeU32(pos + 4),
|
|
1630
1636
|
};
|
|
@@ -1651,7 +1657,7 @@ function deserializeBindingPatternKind(pos) {
|
|
|
1651
1657
|
|
|
1652
1658
|
function deserializeAssignmentPattern(pos) {
|
|
1653
1659
|
let node = {
|
|
1654
|
-
type:
|
|
1660
|
+
type: "AssignmentPattern",
|
|
1655
1661
|
left: null,
|
|
1656
1662
|
right: null,
|
|
1657
1663
|
start: deserializeU32(pos),
|
|
@@ -1664,7 +1670,7 @@ function deserializeAssignmentPattern(pos) {
|
|
|
1664
1670
|
|
|
1665
1671
|
function deserializeObjectPattern(pos) {
|
|
1666
1672
|
let node = {
|
|
1667
|
-
type:
|
|
1673
|
+
type: "ObjectPattern",
|
|
1668
1674
|
properties: null,
|
|
1669
1675
|
start: deserializeU32(pos),
|
|
1670
1676
|
end: deserializeU32(pos + 4),
|
|
@@ -1680,7 +1686,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1680
1686
|
let start = deserializeU32(pos),
|
|
1681
1687
|
end = deserializeU32(pos + 4),
|
|
1682
1688
|
node = {
|
|
1683
|
-
type:
|
|
1689
|
+
type: "Property",
|
|
1684
1690
|
kind: null,
|
|
1685
1691
|
key: null,
|
|
1686
1692
|
value: null,
|
|
@@ -1690,7 +1696,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1690
1696
|
start,
|
|
1691
1697
|
end,
|
|
1692
1698
|
};
|
|
1693
|
-
node.kind =
|
|
1699
|
+
node.kind = "init";
|
|
1694
1700
|
node.key = deserializePropertyKey(pos + 8);
|
|
1695
1701
|
node.value = deserializeBindingPattern(pos + 24);
|
|
1696
1702
|
node.method = false;
|
|
@@ -1699,7 +1705,7 @@ function deserializeBindingProperty(pos) {
|
|
|
1699
1705
|
|
|
1700
1706
|
function deserializeArrayPattern(pos) {
|
|
1701
1707
|
let node = {
|
|
1702
|
-
type:
|
|
1708
|
+
type: "ArrayPattern",
|
|
1703
1709
|
elements: null,
|
|
1704
1710
|
start: deserializeU32(pos),
|
|
1705
1711
|
end: deserializeU32(pos + 4),
|
|
@@ -1713,7 +1719,7 @@ function deserializeArrayPattern(pos) {
|
|
|
1713
1719
|
|
|
1714
1720
|
function deserializeBindingRestElement(pos) {
|
|
1715
1721
|
let node = {
|
|
1716
|
-
type:
|
|
1722
|
+
type: "RestElement",
|
|
1717
1723
|
argument: null,
|
|
1718
1724
|
start: deserializeU32(pos),
|
|
1719
1725
|
end: deserializeU32(pos + 4),
|
|
@@ -1747,13 +1753,13 @@ function deserializeFunction(pos) {
|
|
|
1747
1753
|
function deserializeFunctionType(pos) {
|
|
1748
1754
|
switch (uint8[pos]) {
|
|
1749
1755
|
case 0:
|
|
1750
|
-
return
|
|
1756
|
+
return "FunctionDeclaration";
|
|
1751
1757
|
case 1:
|
|
1752
|
-
return
|
|
1758
|
+
return "FunctionExpression";
|
|
1753
1759
|
case 2:
|
|
1754
|
-
return
|
|
1760
|
+
return "TSDeclareFunction";
|
|
1755
1761
|
case 3:
|
|
1756
|
-
return
|
|
1762
|
+
return "TSEmptyBodyFunctionExpression";
|
|
1757
1763
|
default:
|
|
1758
1764
|
throw Error(`Unexpected discriminant ${uint8[pos]} for FunctionType`);
|
|
1759
1765
|
}
|
|
@@ -1764,7 +1770,7 @@ function deserializeFormalParameters(pos) {
|
|
|
1764
1770
|
if (uint32[(pos + 32) >> 2] !== 0 && uint32[(pos + 36) >> 2] !== 0) {
|
|
1765
1771
|
pos = uint32[(pos + 32) >> 2];
|
|
1766
1772
|
let rest = {
|
|
1767
|
-
type:
|
|
1773
|
+
type: "RestElement",
|
|
1768
1774
|
argument: null,
|
|
1769
1775
|
start: deserializeU32(pos),
|
|
1770
1776
|
end: deserializeU32(pos + 4),
|
|
@@ -1783,7 +1789,7 @@ function deserializeFormalParameter(pos) {
|
|
|
1783
1789
|
|
|
1784
1790
|
function deserializeFunctionBody(pos) {
|
|
1785
1791
|
let node = {
|
|
1786
|
-
type:
|
|
1792
|
+
type: "BlockStatement",
|
|
1787
1793
|
body: null,
|
|
1788
1794
|
start: deserializeU32(pos),
|
|
1789
1795
|
end: deserializeU32(pos + 4),
|
|
@@ -1799,7 +1805,7 @@ function deserializeArrowFunctionExpression(pos) {
|
|
|
1799
1805
|
start = deserializeU32(pos),
|
|
1800
1806
|
end = deserializeU32(pos + 4),
|
|
1801
1807
|
node = {
|
|
1802
|
-
type:
|
|
1808
|
+
type: "ArrowFunctionExpression",
|
|
1803
1809
|
expression,
|
|
1804
1810
|
async: deserializeBool(pos + 45),
|
|
1805
1811
|
params: null,
|
|
@@ -1821,7 +1827,7 @@ function deserializeYieldExpression(pos) {
|
|
|
1821
1827
|
let start = deserializeU32(pos),
|
|
1822
1828
|
end = deserializeU32(pos + 4),
|
|
1823
1829
|
node = {
|
|
1824
|
-
type:
|
|
1830
|
+
type: "YieldExpression",
|
|
1825
1831
|
delegate: deserializeBool(pos + 24),
|
|
1826
1832
|
argument: null,
|
|
1827
1833
|
start,
|
|
@@ -1853,9 +1859,9 @@ function deserializeClass(pos) {
|
|
|
1853
1859
|
function deserializeClassType(pos) {
|
|
1854
1860
|
switch (uint8[pos]) {
|
|
1855
1861
|
case 0:
|
|
1856
|
-
return
|
|
1862
|
+
return "ClassDeclaration";
|
|
1857
1863
|
case 1:
|
|
1858
|
-
return
|
|
1864
|
+
return "ClassExpression";
|
|
1859
1865
|
default:
|
|
1860
1866
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ClassType`);
|
|
1861
1867
|
}
|
|
@@ -1863,7 +1869,7 @@ function deserializeClassType(pos) {
|
|
|
1863
1869
|
|
|
1864
1870
|
function deserializeClassBody(pos) {
|
|
1865
1871
|
let node = {
|
|
1866
|
-
type:
|
|
1872
|
+
type: "ClassBody",
|
|
1867
1873
|
body: null,
|
|
1868
1874
|
start: deserializeU32(pos),
|
|
1869
1875
|
end: deserializeU32(pos + 4),
|
|
@@ -1912,9 +1918,9 @@ function deserializeMethodDefinition(pos) {
|
|
|
1912
1918
|
function deserializeMethodDefinitionType(pos) {
|
|
1913
1919
|
switch (uint8[pos]) {
|
|
1914
1920
|
case 0:
|
|
1915
|
-
return
|
|
1921
|
+
return "MethodDefinition";
|
|
1916
1922
|
case 1:
|
|
1917
|
-
return
|
|
1923
|
+
return "TSAbstractMethodDefinition";
|
|
1918
1924
|
default:
|
|
1919
1925
|
throw Error(`Unexpected discriminant ${uint8[pos]} for MethodDefinitionType`);
|
|
1920
1926
|
}
|
|
@@ -1942,9 +1948,9 @@ function deserializePropertyDefinition(pos) {
|
|
|
1942
1948
|
function deserializePropertyDefinitionType(pos) {
|
|
1943
1949
|
switch (uint8[pos]) {
|
|
1944
1950
|
case 0:
|
|
1945
|
-
return
|
|
1951
|
+
return "PropertyDefinition";
|
|
1946
1952
|
case 1:
|
|
1947
|
-
return
|
|
1953
|
+
return "TSAbstractPropertyDefinition";
|
|
1948
1954
|
default:
|
|
1949
1955
|
throw Error(`Unexpected discriminant ${uint8[pos]} for PropertyDefinitionType`);
|
|
1950
1956
|
}
|
|
@@ -1953,13 +1959,13 @@ function deserializePropertyDefinitionType(pos) {
|
|
|
1953
1959
|
function deserializeMethodDefinitionKind(pos) {
|
|
1954
1960
|
switch (uint8[pos]) {
|
|
1955
1961
|
case 0:
|
|
1956
|
-
return
|
|
1962
|
+
return "constructor";
|
|
1957
1963
|
case 1:
|
|
1958
|
-
return
|
|
1964
|
+
return "method";
|
|
1959
1965
|
case 2:
|
|
1960
|
-
return
|
|
1966
|
+
return "get";
|
|
1961
1967
|
case 3:
|
|
1962
|
-
return
|
|
1968
|
+
return "set";
|
|
1963
1969
|
default:
|
|
1964
1970
|
throw Error(`Unexpected discriminant ${uint8[pos]} for MethodDefinitionKind`);
|
|
1965
1971
|
}
|
|
@@ -1969,7 +1975,7 @@ function deserializePrivateIdentifier(pos) {
|
|
|
1969
1975
|
let start = deserializeU32(pos),
|
|
1970
1976
|
end = deserializeU32(pos + 4);
|
|
1971
1977
|
return {
|
|
1972
|
-
type:
|
|
1978
|
+
type: "PrivateIdentifier",
|
|
1973
1979
|
name: deserializeStr(pos + 8),
|
|
1974
1980
|
start,
|
|
1975
1981
|
end,
|
|
@@ -1978,7 +1984,7 @@ function deserializePrivateIdentifier(pos) {
|
|
|
1978
1984
|
|
|
1979
1985
|
function deserializeStaticBlock(pos) {
|
|
1980
1986
|
let node = {
|
|
1981
|
-
type:
|
|
1987
|
+
type: "StaticBlock",
|
|
1982
1988
|
body: null,
|
|
1983
1989
|
start: deserializeU32(pos),
|
|
1984
1990
|
end: deserializeU32(pos + 4),
|
|
@@ -1990,9 +1996,9 @@ function deserializeStaticBlock(pos) {
|
|
|
1990
1996
|
function deserializeAccessorPropertyType(pos) {
|
|
1991
1997
|
switch (uint8[pos]) {
|
|
1992
1998
|
case 0:
|
|
1993
|
-
return
|
|
1999
|
+
return "AccessorProperty";
|
|
1994
2000
|
case 1:
|
|
1995
|
-
return
|
|
2001
|
+
return "TSAbstractAccessorProperty";
|
|
1996
2002
|
default:
|
|
1997
2003
|
throw Error(`Unexpected discriminant ${uint8[pos]} for AccessorPropertyType`);
|
|
1998
2004
|
}
|
|
@@ -2021,7 +2027,7 @@ function deserializeImportExpression(pos) {
|
|
|
2021
2027
|
let start = deserializeU32(pos),
|
|
2022
2028
|
end = deserializeU32(pos + 4),
|
|
2023
2029
|
node = {
|
|
2024
|
-
type:
|
|
2030
|
+
type: "ImportExpression",
|
|
2025
2031
|
source: null,
|
|
2026
2032
|
options: null,
|
|
2027
2033
|
phase: deserializeOptionImportPhase(pos + 40),
|
|
@@ -2037,7 +2043,7 @@ function deserializeImportDeclaration(pos) {
|
|
|
2037
2043
|
let start = deserializeU32(pos),
|
|
2038
2044
|
end = deserializeU32(pos + 4),
|
|
2039
2045
|
node = {
|
|
2040
|
-
type:
|
|
2046
|
+
type: "ImportDeclaration",
|
|
2041
2047
|
specifiers: null,
|
|
2042
2048
|
source: null,
|
|
2043
2049
|
phase: deserializeOptionImportPhase(pos + 88),
|
|
@@ -2057,9 +2063,9 @@ function deserializeImportDeclaration(pos) {
|
|
|
2057
2063
|
function deserializeImportPhase(pos) {
|
|
2058
2064
|
switch (uint8[pos]) {
|
|
2059
2065
|
case 0:
|
|
2060
|
-
return
|
|
2066
|
+
return "source";
|
|
2061
2067
|
case 1:
|
|
2062
|
-
return
|
|
2068
|
+
return "defer";
|
|
2063
2069
|
default:
|
|
2064
2070
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ImportPhase`);
|
|
2065
2071
|
}
|
|
@@ -2080,7 +2086,7 @@ function deserializeImportDeclarationSpecifier(pos) {
|
|
|
2080
2086
|
|
|
2081
2087
|
function deserializeImportSpecifier(pos) {
|
|
2082
2088
|
let node = {
|
|
2083
|
-
type:
|
|
2089
|
+
type: "ImportSpecifier",
|
|
2084
2090
|
imported: null,
|
|
2085
2091
|
local: null,
|
|
2086
2092
|
start: deserializeU32(pos),
|
|
@@ -2093,7 +2099,7 @@ function deserializeImportSpecifier(pos) {
|
|
|
2093
2099
|
|
|
2094
2100
|
function deserializeImportDefaultSpecifier(pos) {
|
|
2095
2101
|
let node = {
|
|
2096
|
-
type:
|
|
2102
|
+
type: "ImportDefaultSpecifier",
|
|
2097
2103
|
local: null,
|
|
2098
2104
|
start: deserializeU32(pos),
|
|
2099
2105
|
end: deserializeU32(pos + 4),
|
|
@@ -2104,7 +2110,7 @@ function deserializeImportDefaultSpecifier(pos) {
|
|
|
2104
2110
|
|
|
2105
2111
|
function deserializeImportNamespaceSpecifier(pos) {
|
|
2106
2112
|
let node = {
|
|
2107
|
-
type:
|
|
2113
|
+
type: "ImportNamespaceSpecifier",
|
|
2108
2114
|
local: null,
|
|
2109
2115
|
start: deserializeU32(pos),
|
|
2110
2116
|
end: deserializeU32(pos + 4),
|
|
@@ -2119,7 +2125,7 @@ function deserializeWithClause(pos) {
|
|
|
2119
2125
|
|
|
2120
2126
|
function deserializeImportAttribute(pos) {
|
|
2121
2127
|
let node = {
|
|
2122
|
-
type:
|
|
2128
|
+
type: "ImportAttribute",
|
|
2123
2129
|
key: null,
|
|
2124
2130
|
value: null,
|
|
2125
2131
|
start: deserializeU32(pos),
|
|
@@ -2143,7 +2149,7 @@ function deserializeImportAttributeKey(pos) {
|
|
|
2143
2149
|
|
|
2144
2150
|
function deserializeExportNamedDeclaration(pos) {
|
|
2145
2151
|
let node = {
|
|
2146
|
-
type:
|
|
2152
|
+
type: "ExportNamedDeclaration",
|
|
2147
2153
|
declaration: null,
|
|
2148
2154
|
specifiers: null,
|
|
2149
2155
|
source: null,
|
|
@@ -2161,7 +2167,7 @@ function deserializeExportNamedDeclaration(pos) {
|
|
|
2161
2167
|
|
|
2162
2168
|
function deserializeExportDefaultDeclaration(pos) {
|
|
2163
2169
|
let node = {
|
|
2164
|
-
type:
|
|
2170
|
+
type: "ExportDefaultDeclaration",
|
|
2165
2171
|
declaration: null,
|
|
2166
2172
|
start: deserializeU32(pos),
|
|
2167
2173
|
end: deserializeU32(pos + 4),
|
|
@@ -2172,7 +2178,7 @@ function deserializeExportDefaultDeclaration(pos) {
|
|
|
2172
2178
|
|
|
2173
2179
|
function deserializeExportAllDeclaration(pos) {
|
|
2174
2180
|
let node = {
|
|
2175
|
-
type:
|
|
2181
|
+
type: "ExportAllDeclaration",
|
|
2176
2182
|
exported: null,
|
|
2177
2183
|
source: null,
|
|
2178
2184
|
attributes: null,
|
|
@@ -2188,7 +2194,7 @@ function deserializeExportAllDeclaration(pos) {
|
|
|
2188
2194
|
|
|
2189
2195
|
function deserializeExportSpecifier(pos) {
|
|
2190
2196
|
let node = {
|
|
2191
|
-
type:
|
|
2197
|
+
type: "ExportSpecifier",
|
|
2192
2198
|
local: null,
|
|
2193
2199
|
exported: null,
|
|
2194
2200
|
start: deserializeU32(pos),
|
|
@@ -2313,7 +2319,7 @@ function deserializeModuleExportName(pos) {
|
|
|
2313
2319
|
|
|
2314
2320
|
function deserializeV8IntrinsicExpression(pos) {
|
|
2315
2321
|
let node = {
|
|
2316
|
-
type:
|
|
2322
|
+
type: "V8IntrinsicExpression",
|
|
2317
2323
|
name: null,
|
|
2318
2324
|
arguments: null,
|
|
2319
2325
|
start: deserializeU32(pos),
|
|
@@ -2329,13 +2335,13 @@ function deserializeBooleanLiteral(pos) {
|
|
|
2329
2335
|
start = deserializeU32(pos),
|
|
2330
2336
|
end = deserializeU32(pos + 4),
|
|
2331
2337
|
node = {
|
|
2332
|
-
type:
|
|
2338
|
+
type: "Literal",
|
|
2333
2339
|
value,
|
|
2334
2340
|
raw: null,
|
|
2335
2341
|
start,
|
|
2336
2342
|
end,
|
|
2337
2343
|
};
|
|
2338
|
-
node.raw = start === 0 && end === 0 ? null : value +
|
|
2344
|
+
node.raw = start === 0 && end === 0 ? null : value + "";
|
|
2339
2345
|
return node;
|
|
2340
2346
|
}
|
|
2341
2347
|
|
|
@@ -2343,13 +2349,13 @@ function deserializeNullLiteral(pos) {
|
|
|
2343
2349
|
let start = deserializeU32(pos),
|
|
2344
2350
|
end = deserializeU32(pos + 4),
|
|
2345
2351
|
node = {
|
|
2346
|
-
type:
|
|
2352
|
+
type: "Literal",
|
|
2347
2353
|
value: null,
|
|
2348
2354
|
raw: null,
|
|
2349
2355
|
start,
|
|
2350
2356
|
end,
|
|
2351
2357
|
};
|
|
2352
|
-
node.raw = start === 0 && end === 0 ? null :
|
|
2358
|
+
node.raw = start === 0 && end === 0 ? null : "null";
|
|
2353
2359
|
return node;
|
|
2354
2360
|
}
|
|
2355
2361
|
|
|
@@ -2357,7 +2363,7 @@ function deserializeNumericLiteral(pos) {
|
|
|
2357
2363
|
let start = deserializeU32(pos),
|
|
2358
2364
|
end = deserializeU32(pos + 4);
|
|
2359
2365
|
return {
|
|
2360
|
-
type:
|
|
2366
|
+
type: "Literal",
|
|
2361
2367
|
value: deserializeF64(pos + 8),
|
|
2362
2368
|
raw: deserializeOptionStr(pos + 16),
|
|
2363
2369
|
start,
|
|
@@ -2369,7 +2375,7 @@ function deserializeStringLiteral(pos) {
|
|
|
2369
2375
|
let start = deserializeU32(pos),
|
|
2370
2376
|
end = deserializeU32(pos + 4),
|
|
2371
2377
|
node = {
|
|
2372
|
-
type:
|
|
2378
|
+
type: "Literal",
|
|
2373
2379
|
value: null,
|
|
2374
2380
|
raw: deserializeOptionStr(pos + 24),
|
|
2375
2381
|
start,
|
|
@@ -2386,7 +2392,7 @@ function deserializeBigIntLiteral(pos) {
|
|
|
2386
2392
|
let start = deserializeU32(pos),
|
|
2387
2393
|
end = deserializeU32(pos + 4),
|
|
2388
2394
|
node = {
|
|
2389
|
-
type:
|
|
2395
|
+
type: "Literal",
|
|
2390
2396
|
value: null,
|
|
2391
2397
|
raw: deserializeOptionStr(pos + 24),
|
|
2392
2398
|
bigint: null,
|
|
@@ -2403,7 +2409,7 @@ function deserializeRegExpLiteral(pos) {
|
|
|
2403
2409
|
let start = deserializeU32(pos),
|
|
2404
2410
|
end = deserializeU32(pos + 4),
|
|
2405
2411
|
node = {
|
|
2406
|
-
type:
|
|
2412
|
+
type: "Literal",
|
|
2407
2413
|
value: null,
|
|
2408
2414
|
raw: deserializeOptionStr(pos + 40),
|
|
2409
2415
|
regex: null,
|
|
@@ -2429,22 +2435,22 @@ function deserializeRegExp(pos) {
|
|
|
2429
2435
|
|
|
2430
2436
|
function deserializeRegExpFlags(pos) {
|
|
2431
2437
|
let flagBits = deserializeU8(pos),
|
|
2432
|
-
flags =
|
|
2438
|
+
flags = "";
|
|
2433
2439
|
// Alphabetical order
|
|
2434
|
-
flagBits & 64 && (flags +=
|
|
2435
|
-
flagBits & 1 && (flags +=
|
|
2436
|
-
flagBits & 2 && (flags +=
|
|
2437
|
-
flagBits & 4 && (flags +=
|
|
2438
|
-
flagBits & 8 && (flags +=
|
|
2439
|
-
flagBits & 16 && (flags +=
|
|
2440
|
-
flagBits & 128 && (flags +=
|
|
2441
|
-
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");
|
|
2442
2448
|
return flags;
|
|
2443
2449
|
}
|
|
2444
2450
|
|
|
2445
2451
|
function deserializeJSXElement(pos) {
|
|
2446
2452
|
let node = {
|
|
2447
|
-
type:
|
|
2453
|
+
type: "JSXElement",
|
|
2448
2454
|
openingElement: null,
|
|
2449
2455
|
children: null,
|
|
2450
2456
|
closingElement: null,
|
|
@@ -2462,7 +2468,7 @@ function deserializeJSXElement(pos) {
|
|
|
2462
2468
|
|
|
2463
2469
|
function deserializeJSXOpeningElement(pos) {
|
|
2464
2470
|
let node = {
|
|
2465
|
-
type:
|
|
2471
|
+
type: "JSXOpeningElement",
|
|
2466
2472
|
name: null,
|
|
2467
2473
|
attributes: null,
|
|
2468
2474
|
selfClosing: null,
|
|
@@ -2477,7 +2483,7 @@ function deserializeJSXOpeningElement(pos) {
|
|
|
2477
2483
|
|
|
2478
2484
|
function deserializeJSXClosingElement(pos) {
|
|
2479
2485
|
let node = {
|
|
2480
|
-
type:
|
|
2486
|
+
type: "JSXClosingElement",
|
|
2481
2487
|
name: null,
|
|
2482
2488
|
start: deserializeU32(pos),
|
|
2483
2489
|
end: deserializeU32(pos + 4),
|
|
@@ -2488,7 +2494,7 @@ function deserializeJSXClosingElement(pos) {
|
|
|
2488
2494
|
|
|
2489
2495
|
function deserializeJSXFragment(pos) {
|
|
2490
2496
|
let node = {
|
|
2491
|
-
type:
|
|
2497
|
+
type: "JSXFragment",
|
|
2492
2498
|
openingFragment: null,
|
|
2493
2499
|
children: null,
|
|
2494
2500
|
closingFragment: null,
|
|
@@ -2503,7 +2509,7 @@ function deserializeJSXFragment(pos) {
|
|
|
2503
2509
|
|
|
2504
2510
|
function deserializeJSXOpeningFragment(pos) {
|
|
2505
2511
|
let node = {
|
|
2506
|
-
type:
|
|
2512
|
+
type: "JSXOpeningFragment",
|
|
2507
2513
|
attributes: null,
|
|
2508
2514
|
selfClosing: null,
|
|
2509
2515
|
start: deserializeU32(pos),
|
|
@@ -2516,7 +2522,7 @@ function deserializeJSXOpeningFragment(pos) {
|
|
|
2516
2522
|
|
|
2517
2523
|
function deserializeJSXClosingFragment(pos) {
|
|
2518
2524
|
return {
|
|
2519
|
-
type:
|
|
2525
|
+
type: "JSXClosingFragment",
|
|
2520
2526
|
start: deserializeU32(pos),
|
|
2521
2527
|
end: deserializeU32(pos + 4),
|
|
2522
2528
|
};
|
|
@@ -2529,7 +2535,7 @@ function deserializeJSXElementName(pos) {
|
|
|
2529
2535
|
case 1:
|
|
2530
2536
|
let ident = deserializeBoxIdentifierReference(pos + 8);
|
|
2531
2537
|
return {
|
|
2532
|
-
type:
|
|
2538
|
+
type: "JSXIdentifier",
|
|
2533
2539
|
name: ident.name,
|
|
2534
2540
|
start: ident.start,
|
|
2535
2541
|
end: ident.end,
|
|
@@ -2541,8 +2547,8 @@ function deserializeJSXElementName(pos) {
|
|
|
2541
2547
|
case 4:
|
|
2542
2548
|
let thisExpr = deserializeBoxThisExpression(pos + 8);
|
|
2543
2549
|
return {
|
|
2544
|
-
type:
|
|
2545
|
-
name:
|
|
2550
|
+
type: "JSXIdentifier",
|
|
2551
|
+
name: "this",
|
|
2546
2552
|
start: thisExpr.start,
|
|
2547
2553
|
end: thisExpr.end,
|
|
2548
2554
|
};
|
|
@@ -2553,7 +2559,7 @@ function deserializeJSXElementName(pos) {
|
|
|
2553
2559
|
|
|
2554
2560
|
function deserializeJSXNamespacedName(pos) {
|
|
2555
2561
|
let node = {
|
|
2556
|
-
type:
|
|
2562
|
+
type: "JSXNamespacedName",
|
|
2557
2563
|
namespace: null,
|
|
2558
2564
|
name: null,
|
|
2559
2565
|
start: deserializeU32(pos),
|
|
@@ -2566,7 +2572,7 @@ function deserializeJSXNamespacedName(pos) {
|
|
|
2566
2572
|
|
|
2567
2573
|
function deserializeJSXMemberExpression(pos) {
|
|
2568
2574
|
let node = {
|
|
2569
|
-
type:
|
|
2575
|
+
type: "JSXMemberExpression",
|
|
2570
2576
|
object: null,
|
|
2571
2577
|
property: null,
|
|
2572
2578
|
start: deserializeU32(pos),
|
|
@@ -2582,7 +2588,7 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2582
2588
|
case 0:
|
|
2583
2589
|
let ident = deserializeBoxIdentifierReference(pos + 8);
|
|
2584
2590
|
return {
|
|
2585
|
-
type:
|
|
2591
|
+
type: "JSXIdentifier",
|
|
2586
2592
|
name: ident.name,
|
|
2587
2593
|
start: ident.start,
|
|
2588
2594
|
end: ident.end,
|
|
@@ -2592,8 +2598,8 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2592
2598
|
case 2:
|
|
2593
2599
|
let thisExpr = deserializeBoxThisExpression(pos + 8);
|
|
2594
2600
|
return {
|
|
2595
|
-
type:
|
|
2596
|
-
name:
|
|
2601
|
+
type: "JSXIdentifier",
|
|
2602
|
+
name: "this",
|
|
2597
2603
|
start: thisExpr.start,
|
|
2598
2604
|
end: thisExpr.end,
|
|
2599
2605
|
};
|
|
@@ -2604,7 +2610,7 @@ function deserializeJSXMemberExpressionObject(pos) {
|
|
|
2604
2610
|
|
|
2605
2611
|
function deserializeJSXExpressionContainer(pos) {
|
|
2606
2612
|
let node = {
|
|
2607
|
-
type:
|
|
2613
|
+
type: "JSXExpressionContainer",
|
|
2608
2614
|
expression: null,
|
|
2609
2615
|
start: deserializeU32(pos),
|
|
2610
2616
|
end: deserializeU32(pos + 4),
|
|
@@ -2710,7 +2716,7 @@ function deserializeJSXExpression(pos) {
|
|
|
2710
2716
|
|
|
2711
2717
|
function deserializeJSXEmptyExpression(pos) {
|
|
2712
2718
|
return {
|
|
2713
|
-
type:
|
|
2719
|
+
type: "JSXEmptyExpression",
|
|
2714
2720
|
start: deserializeU32(pos),
|
|
2715
2721
|
end: deserializeU32(pos + 4),
|
|
2716
2722
|
};
|
|
@@ -2729,7 +2735,7 @@ function deserializeJSXAttributeItem(pos) {
|
|
|
2729
2735
|
|
|
2730
2736
|
function deserializeJSXAttribute(pos) {
|
|
2731
2737
|
let node = {
|
|
2732
|
-
type:
|
|
2738
|
+
type: "JSXAttribute",
|
|
2733
2739
|
name: null,
|
|
2734
2740
|
value: null,
|
|
2735
2741
|
start: deserializeU32(pos),
|
|
@@ -2742,7 +2748,7 @@ function deserializeJSXAttribute(pos) {
|
|
|
2742
2748
|
|
|
2743
2749
|
function deserializeJSXSpreadAttribute(pos) {
|
|
2744
2750
|
let node = {
|
|
2745
|
-
type:
|
|
2751
|
+
type: "JSXSpreadAttribute",
|
|
2746
2752
|
argument: null,
|
|
2747
2753
|
start: deserializeU32(pos),
|
|
2748
2754
|
end: deserializeU32(pos + 4),
|
|
@@ -2781,7 +2787,7 @@ function deserializeJSXIdentifier(pos) {
|
|
|
2781
2787
|
let start = deserializeU32(pos),
|
|
2782
2788
|
end = deserializeU32(pos + 4);
|
|
2783
2789
|
return {
|
|
2784
|
-
type:
|
|
2790
|
+
type: "JSXIdentifier",
|
|
2785
2791
|
name: deserializeStr(pos + 8),
|
|
2786
2792
|
start,
|
|
2787
2793
|
end,
|
|
@@ -2807,7 +2813,7 @@ function deserializeJSXChild(pos) {
|
|
|
2807
2813
|
|
|
2808
2814
|
function deserializeJSXSpreadChild(pos) {
|
|
2809
2815
|
let node = {
|
|
2810
|
-
type:
|
|
2816
|
+
type: "JSXSpreadChild",
|
|
2811
2817
|
expression: null,
|
|
2812
2818
|
start: deserializeU32(pos),
|
|
2813
2819
|
end: deserializeU32(pos + 4),
|
|
@@ -2820,7 +2826,7 @@ function deserializeJSXText(pos) {
|
|
|
2820
2826
|
let start = deserializeU32(pos),
|
|
2821
2827
|
end = deserializeU32(pos + 4);
|
|
2822
2828
|
return {
|
|
2823
|
-
type:
|
|
2829
|
+
type: "JSXText",
|
|
2824
2830
|
value: deserializeStr(pos + 8),
|
|
2825
2831
|
raw: deserializeOptionStr(pos + 24),
|
|
2826
2832
|
start,
|
|
@@ -2830,7 +2836,7 @@ function deserializeJSXText(pos) {
|
|
|
2830
2836
|
|
|
2831
2837
|
function deserializeTSThisParameter(pos) {
|
|
2832
2838
|
let node = {
|
|
2833
|
-
type:
|
|
2839
|
+
type: "Identifier",
|
|
2834
2840
|
decorators: null,
|
|
2835
2841
|
name: null,
|
|
2836
2842
|
optional: null,
|
|
@@ -2839,7 +2845,7 @@ function deserializeTSThisParameter(pos) {
|
|
|
2839
2845
|
end: deserializeU32(pos + 4),
|
|
2840
2846
|
};
|
|
2841
2847
|
node.decorators = [];
|
|
2842
|
-
node.name =
|
|
2848
|
+
node.name = "this";
|
|
2843
2849
|
node.optional = false;
|
|
2844
2850
|
node.typeAnnotation = deserializeOptionBoxTSTypeAnnotation(pos + 16);
|
|
2845
2851
|
return node;
|
|
@@ -2849,7 +2855,7 @@ function deserializeTSEnumDeclaration(pos) {
|
|
|
2849
2855
|
let start = deserializeU32(pos),
|
|
2850
2856
|
end = deserializeU32(pos + 4),
|
|
2851
2857
|
node = {
|
|
2852
|
-
type:
|
|
2858
|
+
type: "TSEnumDeclaration",
|
|
2853
2859
|
id: null,
|
|
2854
2860
|
body: null,
|
|
2855
2861
|
const: deserializeBool(pos + 76),
|
|
@@ -2864,7 +2870,7 @@ function deserializeTSEnumDeclaration(pos) {
|
|
|
2864
2870
|
|
|
2865
2871
|
function deserializeTSEnumBody(pos) {
|
|
2866
2872
|
let node = {
|
|
2867
|
-
type:
|
|
2873
|
+
type: "TSEnumBody",
|
|
2868
2874
|
members: null,
|
|
2869
2875
|
start: deserializeU32(pos),
|
|
2870
2876
|
end: deserializeU32(pos + 4),
|
|
@@ -2875,7 +2881,7 @@ function deserializeTSEnumBody(pos) {
|
|
|
2875
2881
|
|
|
2876
2882
|
function deserializeTSEnumMember(pos) {
|
|
2877
2883
|
let node = {
|
|
2878
|
-
type:
|
|
2884
|
+
type: "TSEnumMember",
|
|
2879
2885
|
id: null,
|
|
2880
2886
|
initializer: null,
|
|
2881
2887
|
computed: null,
|
|
@@ -2905,7 +2911,7 @@ function deserializeTSEnumMemberName(pos) {
|
|
|
2905
2911
|
|
|
2906
2912
|
function deserializeTSTypeAnnotation(pos) {
|
|
2907
2913
|
let node = {
|
|
2908
|
-
type:
|
|
2914
|
+
type: "TSTypeAnnotation",
|
|
2909
2915
|
typeAnnotation: null,
|
|
2910
2916
|
start: deserializeU32(pos),
|
|
2911
2917
|
end: deserializeU32(pos + 4),
|
|
@@ -2916,7 +2922,7 @@ function deserializeTSTypeAnnotation(pos) {
|
|
|
2916
2922
|
|
|
2917
2923
|
function deserializeTSLiteralType(pos) {
|
|
2918
2924
|
let node = {
|
|
2919
|
-
type:
|
|
2925
|
+
type: "TSLiteralType",
|
|
2920
2926
|
literal: null,
|
|
2921
2927
|
start: deserializeU32(pos),
|
|
2922
2928
|
end: deserializeU32(pos + 4),
|
|
@@ -3027,7 +3033,7 @@ function deserializeTSType(pos) {
|
|
|
3027
3033
|
|
|
3028
3034
|
function deserializeTSConditionalType(pos) {
|
|
3029
3035
|
let node = {
|
|
3030
|
-
type:
|
|
3036
|
+
type: "TSConditionalType",
|
|
3031
3037
|
checkType: null,
|
|
3032
3038
|
extendsType: null,
|
|
3033
3039
|
trueType: null,
|
|
@@ -3044,7 +3050,7 @@ function deserializeTSConditionalType(pos) {
|
|
|
3044
3050
|
|
|
3045
3051
|
function deserializeTSUnionType(pos) {
|
|
3046
3052
|
let node = {
|
|
3047
|
-
type:
|
|
3053
|
+
type: "TSUnionType",
|
|
3048
3054
|
types: null,
|
|
3049
3055
|
start: deserializeU32(pos),
|
|
3050
3056
|
end: deserializeU32(pos + 4),
|
|
@@ -3055,7 +3061,7 @@ function deserializeTSUnionType(pos) {
|
|
|
3055
3061
|
|
|
3056
3062
|
function deserializeTSIntersectionType(pos) {
|
|
3057
3063
|
let node = {
|
|
3058
|
-
type:
|
|
3064
|
+
type: "TSIntersectionType",
|
|
3059
3065
|
types: null,
|
|
3060
3066
|
start: deserializeU32(pos),
|
|
3061
3067
|
end: deserializeU32(pos + 4),
|
|
@@ -3067,7 +3073,7 @@ function deserializeTSIntersectionType(pos) {
|
|
|
3067
3073
|
function deserializeTSParenthesizedType(pos) {
|
|
3068
3074
|
let node;
|
|
3069
3075
|
node = {
|
|
3070
|
-
type:
|
|
3076
|
+
type: "TSParenthesizedType",
|
|
3071
3077
|
typeAnnotation: null,
|
|
3072
3078
|
start: deserializeU32(pos),
|
|
3073
3079
|
end: deserializeU32(pos + 4),
|
|
@@ -3080,7 +3086,7 @@ function deserializeTSTypeOperator(pos) {
|
|
|
3080
3086
|
let start = deserializeU32(pos),
|
|
3081
3087
|
end = deserializeU32(pos + 4),
|
|
3082
3088
|
node = {
|
|
3083
|
-
type:
|
|
3089
|
+
type: "TSTypeOperator",
|
|
3084
3090
|
operator: deserializeTSTypeOperatorOperator(pos + 24),
|
|
3085
3091
|
typeAnnotation: null,
|
|
3086
3092
|
start,
|
|
@@ -3093,11 +3099,11 @@ function deserializeTSTypeOperator(pos) {
|
|
|
3093
3099
|
function deserializeTSTypeOperatorOperator(pos) {
|
|
3094
3100
|
switch (uint8[pos]) {
|
|
3095
3101
|
case 0:
|
|
3096
|
-
return
|
|
3102
|
+
return "keyof";
|
|
3097
3103
|
case 1:
|
|
3098
|
-
return
|
|
3104
|
+
return "unique";
|
|
3099
3105
|
case 2:
|
|
3100
|
-
return
|
|
3106
|
+
return "readonly";
|
|
3101
3107
|
default:
|
|
3102
3108
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSTypeOperatorOperator`);
|
|
3103
3109
|
}
|
|
@@ -3105,7 +3111,7 @@ function deserializeTSTypeOperatorOperator(pos) {
|
|
|
3105
3111
|
|
|
3106
3112
|
function deserializeTSArrayType(pos) {
|
|
3107
3113
|
let node = {
|
|
3108
|
-
type:
|
|
3114
|
+
type: "TSArrayType",
|
|
3109
3115
|
elementType: null,
|
|
3110
3116
|
start: deserializeU32(pos),
|
|
3111
3117
|
end: deserializeU32(pos + 4),
|
|
@@ -3116,7 +3122,7 @@ function deserializeTSArrayType(pos) {
|
|
|
3116
3122
|
|
|
3117
3123
|
function deserializeTSIndexedAccessType(pos) {
|
|
3118
3124
|
let node = {
|
|
3119
|
-
type:
|
|
3125
|
+
type: "TSIndexedAccessType",
|
|
3120
3126
|
objectType: null,
|
|
3121
3127
|
indexType: null,
|
|
3122
3128
|
start: deserializeU32(pos),
|
|
@@ -3129,7 +3135,7 @@ function deserializeTSIndexedAccessType(pos) {
|
|
|
3129
3135
|
|
|
3130
3136
|
function deserializeTSTupleType(pos) {
|
|
3131
3137
|
let node = {
|
|
3132
|
-
type:
|
|
3138
|
+
type: "TSTupleType",
|
|
3133
3139
|
elementTypes: null,
|
|
3134
3140
|
start: deserializeU32(pos),
|
|
3135
3141
|
end: deserializeU32(pos + 4),
|
|
@@ -3142,7 +3148,7 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
3142
3148
|
let start = deserializeU32(pos),
|
|
3143
3149
|
end = deserializeU32(pos + 4),
|
|
3144
3150
|
node = {
|
|
3145
|
-
type:
|
|
3151
|
+
type: "TSNamedTupleMember",
|
|
3146
3152
|
label: null,
|
|
3147
3153
|
elementType: null,
|
|
3148
3154
|
optional: deserializeBool(pos + 48),
|
|
@@ -3156,7 +3162,7 @@ function deserializeTSNamedTupleMember(pos) {
|
|
|
3156
3162
|
|
|
3157
3163
|
function deserializeTSOptionalType(pos) {
|
|
3158
3164
|
let node = {
|
|
3159
|
-
type:
|
|
3165
|
+
type: "TSOptionalType",
|
|
3160
3166
|
typeAnnotation: null,
|
|
3161
3167
|
start: deserializeU32(pos),
|
|
3162
3168
|
end: deserializeU32(pos + 4),
|
|
@@ -3167,7 +3173,7 @@ function deserializeTSOptionalType(pos) {
|
|
|
3167
3173
|
|
|
3168
3174
|
function deserializeTSRestType(pos) {
|
|
3169
3175
|
let node = {
|
|
3170
|
-
type:
|
|
3176
|
+
type: "TSRestType",
|
|
3171
3177
|
typeAnnotation: null,
|
|
3172
3178
|
start: deserializeU32(pos),
|
|
3173
3179
|
end: deserializeU32(pos + 4),
|
|
@@ -3263,7 +3269,7 @@ function deserializeTSTupleElement(pos) {
|
|
|
3263
3269
|
|
|
3264
3270
|
function deserializeTSAnyKeyword(pos) {
|
|
3265
3271
|
return {
|
|
3266
|
-
type:
|
|
3272
|
+
type: "TSAnyKeyword",
|
|
3267
3273
|
start: deserializeU32(pos),
|
|
3268
3274
|
end: deserializeU32(pos + 4),
|
|
3269
3275
|
};
|
|
@@ -3271,7 +3277,7 @@ function deserializeTSAnyKeyword(pos) {
|
|
|
3271
3277
|
|
|
3272
3278
|
function deserializeTSStringKeyword(pos) {
|
|
3273
3279
|
return {
|
|
3274
|
-
type:
|
|
3280
|
+
type: "TSStringKeyword",
|
|
3275
3281
|
start: deserializeU32(pos),
|
|
3276
3282
|
end: deserializeU32(pos + 4),
|
|
3277
3283
|
};
|
|
@@ -3279,7 +3285,7 @@ function deserializeTSStringKeyword(pos) {
|
|
|
3279
3285
|
|
|
3280
3286
|
function deserializeTSBooleanKeyword(pos) {
|
|
3281
3287
|
return {
|
|
3282
|
-
type:
|
|
3288
|
+
type: "TSBooleanKeyword",
|
|
3283
3289
|
start: deserializeU32(pos),
|
|
3284
3290
|
end: deserializeU32(pos + 4),
|
|
3285
3291
|
};
|
|
@@ -3287,7 +3293,7 @@ function deserializeTSBooleanKeyword(pos) {
|
|
|
3287
3293
|
|
|
3288
3294
|
function deserializeTSNumberKeyword(pos) {
|
|
3289
3295
|
return {
|
|
3290
|
-
type:
|
|
3296
|
+
type: "TSNumberKeyword",
|
|
3291
3297
|
start: deserializeU32(pos),
|
|
3292
3298
|
end: deserializeU32(pos + 4),
|
|
3293
3299
|
};
|
|
@@ -3295,7 +3301,7 @@ function deserializeTSNumberKeyword(pos) {
|
|
|
3295
3301
|
|
|
3296
3302
|
function deserializeTSNeverKeyword(pos) {
|
|
3297
3303
|
return {
|
|
3298
|
-
type:
|
|
3304
|
+
type: "TSNeverKeyword",
|
|
3299
3305
|
start: deserializeU32(pos),
|
|
3300
3306
|
end: deserializeU32(pos + 4),
|
|
3301
3307
|
};
|
|
@@ -3303,7 +3309,7 @@ function deserializeTSNeverKeyword(pos) {
|
|
|
3303
3309
|
|
|
3304
3310
|
function deserializeTSIntrinsicKeyword(pos) {
|
|
3305
3311
|
return {
|
|
3306
|
-
type:
|
|
3312
|
+
type: "TSIntrinsicKeyword",
|
|
3307
3313
|
start: deserializeU32(pos),
|
|
3308
3314
|
end: deserializeU32(pos + 4),
|
|
3309
3315
|
};
|
|
@@ -3311,7 +3317,7 @@ function deserializeTSIntrinsicKeyword(pos) {
|
|
|
3311
3317
|
|
|
3312
3318
|
function deserializeTSUnknownKeyword(pos) {
|
|
3313
3319
|
return {
|
|
3314
|
-
type:
|
|
3320
|
+
type: "TSUnknownKeyword",
|
|
3315
3321
|
start: deserializeU32(pos),
|
|
3316
3322
|
end: deserializeU32(pos + 4),
|
|
3317
3323
|
};
|
|
@@ -3319,7 +3325,7 @@ function deserializeTSUnknownKeyword(pos) {
|
|
|
3319
3325
|
|
|
3320
3326
|
function deserializeTSNullKeyword(pos) {
|
|
3321
3327
|
return {
|
|
3322
|
-
type:
|
|
3328
|
+
type: "TSNullKeyword",
|
|
3323
3329
|
start: deserializeU32(pos),
|
|
3324
3330
|
end: deserializeU32(pos + 4),
|
|
3325
3331
|
};
|
|
@@ -3327,7 +3333,7 @@ function deserializeTSNullKeyword(pos) {
|
|
|
3327
3333
|
|
|
3328
3334
|
function deserializeTSUndefinedKeyword(pos) {
|
|
3329
3335
|
return {
|
|
3330
|
-
type:
|
|
3336
|
+
type: "TSUndefinedKeyword",
|
|
3331
3337
|
start: deserializeU32(pos),
|
|
3332
3338
|
end: deserializeU32(pos + 4),
|
|
3333
3339
|
};
|
|
@@ -3335,7 +3341,7 @@ function deserializeTSUndefinedKeyword(pos) {
|
|
|
3335
3341
|
|
|
3336
3342
|
function deserializeTSVoidKeyword(pos) {
|
|
3337
3343
|
return {
|
|
3338
|
-
type:
|
|
3344
|
+
type: "TSVoidKeyword",
|
|
3339
3345
|
start: deserializeU32(pos),
|
|
3340
3346
|
end: deserializeU32(pos + 4),
|
|
3341
3347
|
};
|
|
@@ -3343,7 +3349,7 @@ function deserializeTSVoidKeyword(pos) {
|
|
|
3343
3349
|
|
|
3344
3350
|
function deserializeTSSymbolKeyword(pos) {
|
|
3345
3351
|
return {
|
|
3346
|
-
type:
|
|
3352
|
+
type: "TSSymbolKeyword",
|
|
3347
3353
|
start: deserializeU32(pos),
|
|
3348
3354
|
end: deserializeU32(pos + 4),
|
|
3349
3355
|
};
|
|
@@ -3351,7 +3357,7 @@ function deserializeTSSymbolKeyword(pos) {
|
|
|
3351
3357
|
|
|
3352
3358
|
function deserializeTSThisType(pos) {
|
|
3353
3359
|
return {
|
|
3354
|
-
type:
|
|
3360
|
+
type: "TSThisType",
|
|
3355
3361
|
start: deserializeU32(pos),
|
|
3356
3362
|
end: deserializeU32(pos + 4),
|
|
3357
3363
|
};
|
|
@@ -3359,7 +3365,7 @@ function deserializeTSThisType(pos) {
|
|
|
3359
3365
|
|
|
3360
3366
|
function deserializeTSObjectKeyword(pos) {
|
|
3361
3367
|
return {
|
|
3362
|
-
type:
|
|
3368
|
+
type: "TSObjectKeyword",
|
|
3363
3369
|
start: deserializeU32(pos),
|
|
3364
3370
|
end: deserializeU32(pos + 4),
|
|
3365
3371
|
};
|
|
@@ -3367,7 +3373,7 @@ function deserializeTSObjectKeyword(pos) {
|
|
|
3367
3373
|
|
|
3368
3374
|
function deserializeTSBigIntKeyword(pos) {
|
|
3369
3375
|
return {
|
|
3370
|
-
type:
|
|
3376
|
+
type: "TSBigIntKeyword",
|
|
3371
3377
|
start: deserializeU32(pos),
|
|
3372
3378
|
end: deserializeU32(pos + 4),
|
|
3373
3379
|
};
|
|
@@ -3375,7 +3381,7 @@ function deserializeTSBigIntKeyword(pos) {
|
|
|
3375
3381
|
|
|
3376
3382
|
function deserializeTSTypeReference(pos) {
|
|
3377
3383
|
let node = {
|
|
3378
|
-
type:
|
|
3384
|
+
type: "TSTypeReference",
|
|
3379
3385
|
typeName: null,
|
|
3380
3386
|
typeArguments: null,
|
|
3381
3387
|
start: deserializeU32(pos),
|
|
@@ -3401,7 +3407,7 @@ function deserializeTSTypeName(pos) {
|
|
|
3401
3407
|
|
|
3402
3408
|
function deserializeTSQualifiedName(pos) {
|
|
3403
3409
|
let node = {
|
|
3404
|
-
type:
|
|
3410
|
+
type: "TSQualifiedName",
|
|
3405
3411
|
left: null,
|
|
3406
3412
|
right: null,
|
|
3407
3413
|
start: deserializeU32(pos),
|
|
@@ -3414,7 +3420,7 @@ function deserializeTSQualifiedName(pos) {
|
|
|
3414
3420
|
|
|
3415
3421
|
function deserializeTSTypeParameterInstantiation(pos) {
|
|
3416
3422
|
let node = {
|
|
3417
|
-
type:
|
|
3423
|
+
type: "TSTypeParameterInstantiation",
|
|
3418
3424
|
params: null,
|
|
3419
3425
|
start: deserializeU32(pos),
|
|
3420
3426
|
end: deserializeU32(pos + 4),
|
|
@@ -3427,7 +3433,7 @@ function deserializeTSTypeParameter(pos) {
|
|
|
3427
3433
|
let start = deserializeU32(pos),
|
|
3428
3434
|
end = deserializeU32(pos + 4),
|
|
3429
3435
|
node = {
|
|
3430
|
-
type:
|
|
3436
|
+
type: "TSTypeParameter",
|
|
3431
3437
|
name: null,
|
|
3432
3438
|
constraint: null,
|
|
3433
3439
|
default: null,
|
|
@@ -3445,7 +3451,7 @@ function deserializeTSTypeParameter(pos) {
|
|
|
3445
3451
|
|
|
3446
3452
|
function deserializeTSTypeParameterDeclaration(pos) {
|
|
3447
3453
|
let node = {
|
|
3448
|
-
type:
|
|
3454
|
+
type: "TSTypeParameterDeclaration",
|
|
3449
3455
|
params: null,
|
|
3450
3456
|
start: deserializeU32(pos),
|
|
3451
3457
|
end: deserializeU32(pos + 4),
|
|
@@ -3458,7 +3464,7 @@ function deserializeTSTypeAliasDeclaration(pos) {
|
|
|
3458
3464
|
let start = deserializeU32(pos),
|
|
3459
3465
|
end = deserializeU32(pos + 4),
|
|
3460
3466
|
node = {
|
|
3461
|
-
type:
|
|
3467
|
+
type: "TSTypeAliasDeclaration",
|
|
3462
3468
|
id: null,
|
|
3463
3469
|
typeParameters: null,
|
|
3464
3470
|
typeAnnotation: null,
|
|
@@ -3476,7 +3482,7 @@ function deserializeTSInterfaceDeclaration(pos) {
|
|
|
3476
3482
|
let start = deserializeU32(pos),
|
|
3477
3483
|
end = deserializeU32(pos + 4),
|
|
3478
3484
|
node = {
|
|
3479
|
-
type:
|
|
3485
|
+
type: "TSInterfaceDeclaration",
|
|
3480
3486
|
id: null,
|
|
3481
3487
|
typeParameters: null,
|
|
3482
3488
|
extends: null,
|
|
@@ -3494,7 +3500,7 @@ function deserializeTSInterfaceDeclaration(pos) {
|
|
|
3494
3500
|
|
|
3495
3501
|
function deserializeTSInterfaceBody(pos) {
|
|
3496
3502
|
let node = {
|
|
3497
|
-
type:
|
|
3503
|
+
type: "TSInterfaceBody",
|
|
3498
3504
|
body: null,
|
|
3499
3505
|
start: deserializeU32(pos),
|
|
3500
3506
|
end: deserializeU32(pos + 4),
|
|
@@ -3507,7 +3513,7 @@ function deserializeTSPropertySignature(pos) {
|
|
|
3507
3513
|
let start = deserializeU32(pos),
|
|
3508
3514
|
end = deserializeU32(pos + 4),
|
|
3509
3515
|
node = {
|
|
3510
|
-
type:
|
|
3516
|
+
type: "TSPropertySignature",
|
|
3511
3517
|
computed: deserializeBool(pos + 32),
|
|
3512
3518
|
optional: deserializeBool(pos + 33),
|
|
3513
3519
|
readonly: deserializeBool(pos + 34),
|
|
@@ -3545,7 +3551,7 @@ function deserializeTSIndexSignature(pos) {
|
|
|
3545
3551
|
let start = deserializeU32(pos),
|
|
3546
3552
|
end = deserializeU32(pos + 4),
|
|
3547
3553
|
node = {
|
|
3548
|
-
type:
|
|
3554
|
+
type: "TSIndexSignature",
|
|
3549
3555
|
parameters: null,
|
|
3550
3556
|
typeAnnotation: null,
|
|
3551
3557
|
readonly: deserializeBool(pos + 40),
|
|
@@ -3561,7 +3567,7 @@ function deserializeTSIndexSignature(pos) {
|
|
|
3561
3567
|
|
|
3562
3568
|
function deserializeTSCallSignatureDeclaration(pos) {
|
|
3563
3569
|
let node = {
|
|
3564
|
-
type:
|
|
3570
|
+
type: "TSCallSignatureDeclaration",
|
|
3565
3571
|
typeParameters: null,
|
|
3566
3572
|
params: null,
|
|
3567
3573
|
returnType: null,
|
|
@@ -3580,11 +3586,11 @@ function deserializeTSCallSignatureDeclaration(pos) {
|
|
|
3580
3586
|
function deserializeTSMethodSignatureKind(pos) {
|
|
3581
3587
|
switch (uint8[pos]) {
|
|
3582
3588
|
case 0:
|
|
3583
|
-
return
|
|
3589
|
+
return "method";
|
|
3584
3590
|
case 1:
|
|
3585
|
-
return
|
|
3591
|
+
return "get";
|
|
3586
3592
|
case 2:
|
|
3587
|
-
return
|
|
3593
|
+
return "set";
|
|
3588
3594
|
default:
|
|
3589
3595
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSMethodSignatureKind`);
|
|
3590
3596
|
}
|
|
@@ -3594,7 +3600,7 @@ function deserializeTSMethodSignature(pos) {
|
|
|
3594
3600
|
let start = deserializeU32(pos),
|
|
3595
3601
|
end = deserializeU32(pos + 4),
|
|
3596
3602
|
node = {
|
|
3597
|
-
type:
|
|
3603
|
+
type: "TSMethodSignature",
|
|
3598
3604
|
key: null,
|
|
3599
3605
|
computed: deserializeBool(pos + 60),
|
|
3600
3606
|
optional: deserializeBool(pos + 61),
|
|
@@ -3622,7 +3628,7 @@ function deserializeTSMethodSignature(pos) {
|
|
|
3622
3628
|
|
|
3623
3629
|
function deserializeTSConstructSignatureDeclaration(pos) {
|
|
3624
3630
|
let node = {
|
|
3625
|
-
type:
|
|
3631
|
+
type: "TSConstructSignatureDeclaration",
|
|
3626
3632
|
typeParameters: null,
|
|
3627
3633
|
params: null,
|
|
3628
3634
|
returnType: null,
|
|
@@ -3639,7 +3645,7 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
3639
3645
|
let start = deserializeU32(pos),
|
|
3640
3646
|
end = deserializeU32(pos + 4),
|
|
3641
3647
|
node = {
|
|
3642
|
-
type:
|
|
3648
|
+
type: "Identifier",
|
|
3643
3649
|
decorators: null,
|
|
3644
3650
|
name: deserializeStr(pos + 8),
|
|
3645
3651
|
optional: null,
|
|
@@ -3655,7 +3661,7 @@ function deserializeTSIndexSignatureName(pos) {
|
|
|
3655
3661
|
|
|
3656
3662
|
function deserializeTSInterfaceHeritage(pos) {
|
|
3657
3663
|
let node = {
|
|
3658
|
-
type:
|
|
3664
|
+
type: "TSInterfaceHeritage",
|
|
3659
3665
|
expression: null,
|
|
3660
3666
|
typeArguments: null,
|
|
3661
3667
|
start: deserializeU32(pos),
|
|
@@ -3670,7 +3676,7 @@ function deserializeTSTypePredicate(pos) {
|
|
|
3670
3676
|
let start = deserializeU32(pos),
|
|
3671
3677
|
end = deserializeU32(pos + 4),
|
|
3672
3678
|
node = {
|
|
3673
|
-
type:
|
|
3679
|
+
type: "TSTypePredicate",
|
|
3674
3680
|
parameterName: null,
|
|
3675
3681
|
asserts: deserializeBool(pos + 32),
|
|
3676
3682
|
typeAnnotation: null,
|
|
@@ -3695,7 +3701,6 @@ function deserializeTSTypePredicateName(pos) {
|
|
|
3695
3701
|
|
|
3696
3702
|
function deserializeTSModuleDeclaration(pos) {
|
|
3697
3703
|
let kind = deserializeTSModuleDeclarationKind(pos + 84),
|
|
3698
|
-
global = kind === 'global',
|
|
3699
3704
|
start = deserializeU32(pos),
|
|
3700
3705
|
end = deserializeU32(pos + 4),
|
|
3701
3706
|
declare = deserializeBool(pos + 85),
|
|
@@ -3703,33 +3708,33 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3703
3708
|
body = deserializeOptionTSModuleDeclarationBody(pos + 64);
|
|
3704
3709
|
if (body === null) {
|
|
3705
3710
|
node = {
|
|
3706
|
-
type:
|
|
3711
|
+
type: "TSModuleDeclaration",
|
|
3707
3712
|
id: null,
|
|
3708
3713
|
kind,
|
|
3709
3714
|
declare,
|
|
3710
|
-
global,
|
|
3715
|
+
global: false,
|
|
3711
3716
|
start,
|
|
3712
3717
|
end,
|
|
3713
3718
|
};
|
|
3714
3719
|
node.id = deserializeTSModuleDeclarationName(pos + 8);
|
|
3715
3720
|
} else {
|
|
3716
3721
|
node = {
|
|
3717
|
-
type:
|
|
3722
|
+
type: "TSModuleDeclaration",
|
|
3718
3723
|
id: null,
|
|
3719
3724
|
body,
|
|
3720
3725
|
kind,
|
|
3721
3726
|
declare,
|
|
3722
|
-
global,
|
|
3727
|
+
global: false,
|
|
3723
3728
|
start,
|
|
3724
3729
|
end,
|
|
3725
3730
|
};
|
|
3726
3731
|
let id = deserializeTSModuleDeclarationName(pos + 8);
|
|
3727
|
-
if (body.type ===
|
|
3732
|
+
if (body.type === "TSModuleBlock") node.id = id;
|
|
3728
3733
|
else {
|
|
3729
3734
|
let innerId = body.id;
|
|
3730
|
-
if (innerId.type ===
|
|
3735
|
+
if (innerId.type === "Identifier")
|
|
3731
3736
|
node.id = {
|
|
3732
|
-
type:
|
|
3737
|
+
type: "TSQualifiedName",
|
|
3733
3738
|
left: id,
|
|
3734
3739
|
right: innerId,
|
|
3735
3740
|
start: id.start,
|
|
@@ -3742,19 +3747,19 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3742
3747
|
let { start } = id;
|
|
3743
3748
|
for (;;) {
|
|
3744
3749
|
innerId.start = start;
|
|
3745
|
-
if (innerId.left.type ===
|
|
3750
|
+
if (innerId.left.type === "Identifier") break;
|
|
3746
3751
|
innerId = innerId.left;
|
|
3747
3752
|
}
|
|
3748
3753
|
let right = innerId.left;
|
|
3749
3754
|
innerId.left = {
|
|
3750
|
-
type:
|
|
3755
|
+
type: "TSQualifiedName",
|
|
3751
3756
|
left: id,
|
|
3752
3757
|
right,
|
|
3753
3758
|
start,
|
|
3754
3759
|
end: right.end,
|
|
3755
3760
|
};
|
|
3756
3761
|
}
|
|
3757
|
-
if (Object.hasOwn(body,
|
|
3762
|
+
if (Object.hasOwn(body, "body")) {
|
|
3758
3763
|
body = body.body;
|
|
3759
3764
|
node.body = body;
|
|
3760
3765
|
} else body = null;
|
|
@@ -3766,11 +3771,9 @@ function deserializeTSModuleDeclaration(pos) {
|
|
|
3766
3771
|
function deserializeTSModuleDeclarationKind(pos) {
|
|
3767
3772
|
switch (uint8[pos]) {
|
|
3768
3773
|
case 0:
|
|
3769
|
-
return
|
|
3774
|
+
return "module";
|
|
3770
3775
|
case 1:
|
|
3771
|
-
return
|
|
3772
|
-
case 2:
|
|
3773
|
-
return 'namespace';
|
|
3776
|
+
return "namespace";
|
|
3774
3777
|
default:
|
|
3775
3778
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSModuleDeclarationKind`);
|
|
3776
3779
|
}
|
|
@@ -3798,9 +3801,34 @@ function deserializeTSModuleDeclarationBody(pos) {
|
|
|
3798
3801
|
}
|
|
3799
3802
|
}
|
|
3800
3803
|
|
|
3804
|
+
function deserializeTSGlobalDeclaration(pos) {
|
|
3805
|
+
let start = deserializeU32(pos),
|
|
3806
|
+
end = deserializeU32(pos + 4),
|
|
3807
|
+
node = {
|
|
3808
|
+
type: "TSModuleDeclaration",
|
|
3809
|
+
id: null,
|
|
3810
|
+
body: null,
|
|
3811
|
+
kind: null,
|
|
3812
|
+
declare: deserializeBool(pos + 76),
|
|
3813
|
+
global: null,
|
|
3814
|
+
start,
|
|
3815
|
+
end,
|
|
3816
|
+
};
|
|
3817
|
+
node.id = {
|
|
3818
|
+
type: "Identifier",
|
|
3819
|
+
name: "global",
|
|
3820
|
+
start: deserializeU32(pos + 8),
|
|
3821
|
+
end: deserializeU32(pos + 12),
|
|
3822
|
+
};
|
|
3823
|
+
node.body = deserializeTSModuleBlock(pos + 16);
|
|
3824
|
+
node.kind = "global";
|
|
3825
|
+
node.global = true;
|
|
3826
|
+
return node;
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3801
3829
|
function deserializeTSModuleBlock(pos) {
|
|
3802
3830
|
let node = {
|
|
3803
|
-
type:
|
|
3831
|
+
type: "TSModuleBlock",
|
|
3804
3832
|
body: null,
|
|
3805
3833
|
start: deserializeU32(pos),
|
|
3806
3834
|
end: deserializeU32(pos + 4),
|
|
@@ -3813,7 +3841,7 @@ function deserializeTSModuleBlock(pos) {
|
|
|
3813
3841
|
|
|
3814
3842
|
function deserializeTSTypeLiteral(pos) {
|
|
3815
3843
|
let node = {
|
|
3816
|
-
type:
|
|
3844
|
+
type: "TSTypeLiteral",
|
|
3817
3845
|
members: null,
|
|
3818
3846
|
start: deserializeU32(pos),
|
|
3819
3847
|
end: deserializeU32(pos + 4),
|
|
@@ -3824,7 +3852,7 @@ function deserializeTSTypeLiteral(pos) {
|
|
|
3824
3852
|
|
|
3825
3853
|
function deserializeTSInferType(pos) {
|
|
3826
3854
|
let node = {
|
|
3827
|
-
type:
|
|
3855
|
+
type: "TSInferType",
|
|
3828
3856
|
typeParameter: null,
|
|
3829
3857
|
start: deserializeU32(pos),
|
|
3830
3858
|
end: deserializeU32(pos + 4),
|
|
@@ -3835,7 +3863,7 @@ function deserializeTSInferType(pos) {
|
|
|
3835
3863
|
|
|
3836
3864
|
function deserializeTSTypeQuery(pos) {
|
|
3837
3865
|
let node = {
|
|
3838
|
-
type:
|
|
3866
|
+
type: "TSTypeQuery",
|
|
3839
3867
|
exprName: null,
|
|
3840
3868
|
typeArguments: null,
|
|
3841
3869
|
start: deserializeU32(pos),
|
|
@@ -3863,18 +3891,18 @@ function deserializeTSTypeQueryExprName(pos) {
|
|
|
3863
3891
|
|
|
3864
3892
|
function deserializeTSImportType(pos) {
|
|
3865
3893
|
let node = {
|
|
3866
|
-
type:
|
|
3867
|
-
|
|
3894
|
+
type: "TSImportType",
|
|
3895
|
+
source: null,
|
|
3868
3896
|
options: null,
|
|
3869
3897
|
qualifier: null,
|
|
3870
3898
|
typeArguments: null,
|
|
3871
3899
|
start: deserializeU32(pos),
|
|
3872
3900
|
end: deserializeU32(pos + 4),
|
|
3873
3901
|
};
|
|
3874
|
-
node.
|
|
3875
|
-
node.options = deserializeOptionBoxObjectExpression(pos +
|
|
3876
|
-
node.qualifier = deserializeOptionTSImportTypeQualifier(pos +
|
|
3877
|
-
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);
|
|
3878
3906
|
return node;
|
|
3879
3907
|
}
|
|
3880
3908
|
|
|
@@ -3891,7 +3919,7 @@ function deserializeTSImportTypeQualifier(pos) {
|
|
|
3891
3919
|
|
|
3892
3920
|
function deserializeTSImportTypeQualifiedName(pos) {
|
|
3893
3921
|
let node = {
|
|
3894
|
-
type:
|
|
3922
|
+
type: "TSQualifiedName",
|
|
3895
3923
|
left: null,
|
|
3896
3924
|
right: null,
|
|
3897
3925
|
start: deserializeU32(pos),
|
|
@@ -3904,7 +3932,7 @@ function deserializeTSImportTypeQualifiedName(pos) {
|
|
|
3904
3932
|
|
|
3905
3933
|
function deserializeTSFunctionType(pos) {
|
|
3906
3934
|
let node = {
|
|
3907
|
-
type:
|
|
3935
|
+
type: "TSFunctionType",
|
|
3908
3936
|
typeParameters: null,
|
|
3909
3937
|
params: null,
|
|
3910
3938
|
returnType: null,
|
|
@@ -3924,7 +3952,7 @@ function deserializeTSConstructorType(pos) {
|
|
|
3924
3952
|
let start = deserializeU32(pos),
|
|
3925
3953
|
end = deserializeU32(pos + 4),
|
|
3926
3954
|
node = {
|
|
3927
|
-
type:
|
|
3955
|
+
type: "TSConstructorType",
|
|
3928
3956
|
abstract: deserializeBool(pos + 36),
|
|
3929
3957
|
typeParameters: null,
|
|
3930
3958
|
params: null,
|
|
@@ -3942,7 +3970,7 @@ function deserializeTSMappedType(pos) {
|
|
|
3942
3970
|
let start = deserializeU32(pos),
|
|
3943
3971
|
end = deserializeU32(pos + 4),
|
|
3944
3972
|
node = {
|
|
3945
|
-
type:
|
|
3973
|
+
type: "TSMappedType",
|
|
3946
3974
|
key: null,
|
|
3947
3975
|
constraint: null,
|
|
3948
3976
|
nameType: null,
|
|
@@ -3970,9 +3998,9 @@ function deserializeTSMappedTypeModifierOperator(pos) {
|
|
|
3970
3998
|
case 0:
|
|
3971
3999
|
return true;
|
|
3972
4000
|
case 1:
|
|
3973
|
-
return
|
|
4001
|
+
return "+";
|
|
3974
4002
|
case 2:
|
|
3975
|
-
return
|
|
4003
|
+
return "-";
|
|
3976
4004
|
default:
|
|
3977
4005
|
throw Error(`Unexpected discriminant ${uint8[pos]} for TSMappedTypeModifierOperator`);
|
|
3978
4006
|
}
|
|
@@ -3980,7 +4008,7 @@ function deserializeTSMappedTypeModifierOperator(pos) {
|
|
|
3980
4008
|
|
|
3981
4009
|
function deserializeTSTemplateLiteralType(pos) {
|
|
3982
4010
|
let node = {
|
|
3983
|
-
type:
|
|
4011
|
+
type: "TSTemplateLiteralType",
|
|
3984
4012
|
quasis: null,
|
|
3985
4013
|
types: null,
|
|
3986
4014
|
start: deserializeU32(pos),
|
|
@@ -3993,7 +4021,7 @@ function deserializeTSTemplateLiteralType(pos) {
|
|
|
3993
4021
|
|
|
3994
4022
|
function deserializeTSAsExpression(pos) {
|
|
3995
4023
|
let node = {
|
|
3996
|
-
type:
|
|
4024
|
+
type: "TSAsExpression",
|
|
3997
4025
|
expression: null,
|
|
3998
4026
|
typeAnnotation: null,
|
|
3999
4027
|
start: deserializeU32(pos),
|
|
@@ -4006,7 +4034,7 @@ function deserializeTSAsExpression(pos) {
|
|
|
4006
4034
|
|
|
4007
4035
|
function deserializeTSSatisfiesExpression(pos) {
|
|
4008
4036
|
let node = {
|
|
4009
|
-
type:
|
|
4037
|
+
type: "TSSatisfiesExpression",
|
|
4010
4038
|
expression: null,
|
|
4011
4039
|
typeAnnotation: null,
|
|
4012
4040
|
start: deserializeU32(pos),
|
|
@@ -4019,7 +4047,7 @@ function deserializeTSSatisfiesExpression(pos) {
|
|
|
4019
4047
|
|
|
4020
4048
|
function deserializeTSTypeAssertion(pos) {
|
|
4021
4049
|
let node = {
|
|
4022
|
-
type:
|
|
4050
|
+
type: "TSTypeAssertion",
|
|
4023
4051
|
typeAnnotation: null,
|
|
4024
4052
|
expression: null,
|
|
4025
4053
|
start: deserializeU32(pos),
|
|
@@ -4034,7 +4062,7 @@ function deserializeTSImportEqualsDeclaration(pos) {
|
|
|
4034
4062
|
let start = deserializeU32(pos),
|
|
4035
4063
|
end = deserializeU32(pos + 4),
|
|
4036
4064
|
node = {
|
|
4037
|
-
type:
|
|
4065
|
+
type: "TSImportEqualsDeclaration",
|
|
4038
4066
|
id: null,
|
|
4039
4067
|
moduleReference: null,
|
|
4040
4068
|
importKind: deserializeImportOrExportKind(pos + 56),
|
|
@@ -4063,7 +4091,7 @@ function deserializeTSModuleReference(pos) {
|
|
|
4063
4091
|
|
|
4064
4092
|
function deserializeTSExternalModuleReference(pos) {
|
|
4065
4093
|
let node = {
|
|
4066
|
-
type:
|
|
4094
|
+
type: "TSExternalModuleReference",
|
|
4067
4095
|
expression: null,
|
|
4068
4096
|
start: deserializeU32(pos),
|
|
4069
4097
|
end: deserializeU32(pos + 4),
|
|
@@ -4074,7 +4102,7 @@ function deserializeTSExternalModuleReference(pos) {
|
|
|
4074
4102
|
|
|
4075
4103
|
function deserializeTSNonNullExpression(pos) {
|
|
4076
4104
|
let node = {
|
|
4077
|
-
type:
|
|
4105
|
+
type: "TSNonNullExpression",
|
|
4078
4106
|
expression: null,
|
|
4079
4107
|
start: deserializeU32(pos),
|
|
4080
4108
|
end: deserializeU32(pos + 4),
|
|
@@ -4085,7 +4113,7 @@ function deserializeTSNonNullExpression(pos) {
|
|
|
4085
4113
|
|
|
4086
4114
|
function deserializeDecorator(pos) {
|
|
4087
4115
|
let node = {
|
|
4088
|
-
type:
|
|
4116
|
+
type: "Decorator",
|
|
4089
4117
|
expression: null,
|
|
4090
4118
|
start: deserializeU32(pos),
|
|
4091
4119
|
end: deserializeU32(pos + 4),
|
|
@@ -4096,7 +4124,7 @@ function deserializeDecorator(pos) {
|
|
|
4096
4124
|
|
|
4097
4125
|
function deserializeTSExportAssignment(pos) {
|
|
4098
4126
|
let node = {
|
|
4099
|
-
type:
|
|
4127
|
+
type: "TSExportAssignment",
|
|
4100
4128
|
expression: null,
|
|
4101
4129
|
start: deserializeU32(pos),
|
|
4102
4130
|
end: deserializeU32(pos + 4),
|
|
@@ -4107,7 +4135,7 @@ function deserializeTSExportAssignment(pos) {
|
|
|
4107
4135
|
|
|
4108
4136
|
function deserializeTSNamespaceExportDeclaration(pos) {
|
|
4109
4137
|
let node = {
|
|
4110
|
-
type:
|
|
4138
|
+
type: "TSNamespaceExportDeclaration",
|
|
4111
4139
|
id: null,
|
|
4112
4140
|
start: deserializeU32(pos),
|
|
4113
4141
|
end: deserializeU32(pos + 4),
|
|
@@ -4118,7 +4146,7 @@ function deserializeTSNamespaceExportDeclaration(pos) {
|
|
|
4118
4146
|
|
|
4119
4147
|
function deserializeTSInstantiationExpression(pos) {
|
|
4120
4148
|
let node = {
|
|
4121
|
-
type:
|
|
4149
|
+
type: "TSInstantiationExpression",
|
|
4122
4150
|
expression: null,
|
|
4123
4151
|
typeArguments: null,
|
|
4124
4152
|
start: deserializeU32(pos),
|
|
@@ -4132,9 +4160,9 @@ function deserializeTSInstantiationExpression(pos) {
|
|
|
4132
4160
|
function deserializeImportOrExportKind(pos) {
|
|
4133
4161
|
switch (uint8[pos]) {
|
|
4134
4162
|
case 0:
|
|
4135
|
-
return
|
|
4163
|
+
return "value";
|
|
4136
4164
|
case 1:
|
|
4137
|
-
return
|
|
4165
|
+
return "type";
|
|
4138
4166
|
default:
|
|
4139
4167
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ImportOrExportKind`);
|
|
4140
4168
|
}
|
|
@@ -4144,7 +4172,7 @@ function deserializeJSDocNullableType(pos) {
|
|
|
4144
4172
|
let start = deserializeU32(pos),
|
|
4145
4173
|
end = deserializeU32(pos + 4),
|
|
4146
4174
|
node = {
|
|
4147
|
-
type:
|
|
4175
|
+
type: "TSJSDocNullableType",
|
|
4148
4176
|
typeAnnotation: null,
|
|
4149
4177
|
postfix: deserializeBool(pos + 24),
|
|
4150
4178
|
start,
|
|
@@ -4158,7 +4186,7 @@ function deserializeJSDocNonNullableType(pos) {
|
|
|
4158
4186
|
let start = deserializeU32(pos),
|
|
4159
4187
|
end = deserializeU32(pos + 4),
|
|
4160
4188
|
node = {
|
|
4161
|
-
type:
|
|
4189
|
+
type: "TSJSDocNonNullableType",
|
|
4162
4190
|
typeAnnotation: null,
|
|
4163
4191
|
postfix: deserializeBool(pos + 24),
|
|
4164
4192
|
start,
|
|
@@ -4170,7 +4198,7 @@ function deserializeJSDocNonNullableType(pos) {
|
|
|
4170
4198
|
|
|
4171
4199
|
function deserializeJSDocUnknownType(pos) {
|
|
4172
4200
|
return {
|
|
4173
|
-
type:
|
|
4201
|
+
type: "TSJSDocUnknownType",
|
|
4174
4202
|
start: deserializeU32(pos),
|
|
4175
4203
|
end: deserializeU32(pos + 4),
|
|
4176
4204
|
};
|
|
@@ -4179,9 +4207,9 @@ function deserializeJSDocUnknownType(pos) {
|
|
|
4179
4207
|
function deserializeCommentKind(pos) {
|
|
4180
4208
|
switch (uint8[pos]) {
|
|
4181
4209
|
case 0:
|
|
4182
|
-
return
|
|
4210
|
+
return "Line";
|
|
4183
4211
|
case 1:
|
|
4184
|
-
return
|
|
4212
|
+
return "Block";
|
|
4185
4213
|
default:
|
|
4186
4214
|
throw Error(`Unexpected discriminant ${uint8[pos]} for CommentKind`);
|
|
4187
4215
|
}
|
|
@@ -4193,7 +4221,7 @@ function deserializeComment(pos) {
|
|
|
4193
4221
|
end = deserializeU32(pos + 4);
|
|
4194
4222
|
return {
|
|
4195
4223
|
type,
|
|
4196
|
-
value: sourceText.slice(start + 2, end - (type ===
|
|
4224
|
+
value: sourceText.slice(start + 2, end - (type === "Line" ? 0 : 2)),
|
|
4197
4225
|
start,
|
|
4198
4226
|
end,
|
|
4199
4227
|
};
|
|
@@ -4222,14 +4250,14 @@ function deserializeImportImportName(pos) {
|
|
|
4222
4250
|
case 0:
|
|
4223
4251
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4224
4252
|
return {
|
|
4225
|
-
kind:
|
|
4253
|
+
kind: "Name",
|
|
4226
4254
|
name: nameSpan.value,
|
|
4227
4255
|
start: nameSpan.start,
|
|
4228
4256
|
end: nameSpan.end,
|
|
4229
4257
|
};
|
|
4230
4258
|
case 1:
|
|
4231
4259
|
return {
|
|
4232
|
-
kind:
|
|
4260
|
+
kind: "NamespaceObject",
|
|
4233
4261
|
name: null,
|
|
4234
4262
|
start: null,
|
|
4235
4263
|
end: null,
|
|
@@ -4237,7 +4265,7 @@ function deserializeImportImportName(pos) {
|
|
|
4237
4265
|
case 2:
|
|
4238
4266
|
var { start, end } = deserializeSpan(pos + 8);
|
|
4239
4267
|
return {
|
|
4240
|
-
kind:
|
|
4268
|
+
kind: "Default",
|
|
4241
4269
|
name: null,
|
|
4242
4270
|
start,
|
|
4243
4271
|
end,
|
|
@@ -4266,28 +4294,28 @@ function deserializeExportImportName(pos) {
|
|
|
4266
4294
|
case 0:
|
|
4267
4295
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4268
4296
|
return {
|
|
4269
|
-
kind:
|
|
4297
|
+
kind: "Name",
|
|
4270
4298
|
name: nameSpan.value,
|
|
4271
4299
|
start: nameSpan.start,
|
|
4272
4300
|
end: nameSpan.end,
|
|
4273
4301
|
};
|
|
4274
4302
|
case 1:
|
|
4275
4303
|
return {
|
|
4276
|
-
kind:
|
|
4304
|
+
kind: "All",
|
|
4277
4305
|
name: null,
|
|
4278
4306
|
start: null,
|
|
4279
4307
|
end: null,
|
|
4280
4308
|
};
|
|
4281
4309
|
case 2:
|
|
4282
4310
|
return {
|
|
4283
|
-
kind:
|
|
4311
|
+
kind: "AllButDefault",
|
|
4284
4312
|
name: null,
|
|
4285
4313
|
start: null,
|
|
4286
4314
|
end: null,
|
|
4287
4315
|
};
|
|
4288
4316
|
case 3:
|
|
4289
4317
|
return {
|
|
4290
|
-
kind:
|
|
4318
|
+
kind: "None",
|
|
4291
4319
|
name: null,
|
|
4292
4320
|
start: null,
|
|
4293
4321
|
end: null,
|
|
@@ -4302,7 +4330,7 @@ function deserializeExportExportName(pos) {
|
|
|
4302
4330
|
case 0:
|
|
4303
4331
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4304
4332
|
return {
|
|
4305
|
-
kind:
|
|
4333
|
+
kind: "Name",
|
|
4306
4334
|
name: nameSpan.value,
|
|
4307
4335
|
start: nameSpan.start,
|
|
4308
4336
|
end: nameSpan.end,
|
|
@@ -4310,14 +4338,14 @@ function deserializeExportExportName(pos) {
|
|
|
4310
4338
|
case 1:
|
|
4311
4339
|
var { start, end } = deserializeSpan(pos + 8);
|
|
4312
4340
|
return {
|
|
4313
|
-
kind:
|
|
4341
|
+
kind: "Default",
|
|
4314
4342
|
name: null,
|
|
4315
4343
|
start,
|
|
4316
4344
|
end,
|
|
4317
4345
|
};
|
|
4318
4346
|
case 2:
|
|
4319
4347
|
return {
|
|
4320
|
-
kind:
|
|
4348
|
+
kind: "None",
|
|
4321
4349
|
name: null,
|
|
4322
4350
|
start: null,
|
|
4323
4351
|
end: null,
|
|
@@ -4332,7 +4360,7 @@ function deserializeExportLocalName(pos) {
|
|
|
4332
4360
|
case 0:
|
|
4333
4361
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4334
4362
|
return {
|
|
4335
|
-
kind:
|
|
4363
|
+
kind: "Name",
|
|
4336
4364
|
name: nameSpan.value,
|
|
4337
4365
|
start: nameSpan.start,
|
|
4338
4366
|
end: nameSpan.end,
|
|
@@ -4340,14 +4368,14 @@ function deserializeExportLocalName(pos) {
|
|
|
4340
4368
|
case 1:
|
|
4341
4369
|
var nameSpan = deserializeNameSpan(pos + 8);
|
|
4342
4370
|
return {
|
|
4343
|
-
kind:
|
|
4371
|
+
kind: "Default",
|
|
4344
4372
|
name: nameSpan.value,
|
|
4345
4373
|
start: nameSpan.start,
|
|
4346
4374
|
end: nameSpan.end,
|
|
4347
4375
|
};
|
|
4348
4376
|
case 2:
|
|
4349
4377
|
return {
|
|
4350
|
-
kind:
|
|
4378
|
+
kind: "None",
|
|
4351
4379
|
name: null,
|
|
4352
4380
|
start: null,
|
|
4353
4381
|
end: null,
|
|
@@ -4370,37 +4398,37 @@ function deserializeDynamicImport(pos) {
|
|
|
4370
4398
|
function deserializeAssignmentOperator(pos) {
|
|
4371
4399
|
switch (uint8[pos]) {
|
|
4372
4400
|
case 0:
|
|
4373
|
-
return
|
|
4401
|
+
return "=";
|
|
4374
4402
|
case 1:
|
|
4375
|
-
return
|
|
4403
|
+
return "+=";
|
|
4376
4404
|
case 2:
|
|
4377
|
-
return
|
|
4405
|
+
return "-=";
|
|
4378
4406
|
case 3:
|
|
4379
|
-
return
|
|
4407
|
+
return "*=";
|
|
4380
4408
|
case 4:
|
|
4381
|
-
return
|
|
4409
|
+
return "/=";
|
|
4382
4410
|
case 5:
|
|
4383
|
-
return
|
|
4411
|
+
return "%=";
|
|
4384
4412
|
case 6:
|
|
4385
|
-
return
|
|
4413
|
+
return "**=";
|
|
4386
4414
|
case 7:
|
|
4387
|
-
return
|
|
4415
|
+
return "<<=";
|
|
4388
4416
|
case 8:
|
|
4389
|
-
return
|
|
4417
|
+
return ">>=";
|
|
4390
4418
|
case 9:
|
|
4391
|
-
return
|
|
4419
|
+
return ">>>=";
|
|
4392
4420
|
case 10:
|
|
4393
|
-
return
|
|
4421
|
+
return "|=";
|
|
4394
4422
|
case 11:
|
|
4395
|
-
return
|
|
4423
|
+
return "^=";
|
|
4396
4424
|
case 12:
|
|
4397
|
-
return
|
|
4425
|
+
return "&=";
|
|
4398
4426
|
case 13:
|
|
4399
|
-
return
|
|
4427
|
+
return "||=";
|
|
4400
4428
|
case 14:
|
|
4401
|
-
return
|
|
4429
|
+
return "&&=";
|
|
4402
4430
|
case 15:
|
|
4403
|
-
return
|
|
4431
|
+
return "??=";
|
|
4404
4432
|
default:
|
|
4405
4433
|
throw Error(`Unexpected discriminant ${uint8[pos]} for AssignmentOperator`);
|
|
4406
4434
|
}
|
|
@@ -4409,49 +4437,49 @@ function deserializeAssignmentOperator(pos) {
|
|
|
4409
4437
|
function deserializeBinaryOperator(pos) {
|
|
4410
4438
|
switch (uint8[pos]) {
|
|
4411
4439
|
case 0:
|
|
4412
|
-
return
|
|
4440
|
+
return "==";
|
|
4413
4441
|
case 1:
|
|
4414
|
-
return
|
|
4442
|
+
return "!=";
|
|
4415
4443
|
case 2:
|
|
4416
|
-
return
|
|
4444
|
+
return "===";
|
|
4417
4445
|
case 3:
|
|
4418
|
-
return
|
|
4446
|
+
return "!==";
|
|
4419
4447
|
case 4:
|
|
4420
|
-
return
|
|
4448
|
+
return "<";
|
|
4421
4449
|
case 5:
|
|
4422
|
-
return
|
|
4450
|
+
return "<=";
|
|
4423
4451
|
case 6:
|
|
4424
|
-
return
|
|
4452
|
+
return ">";
|
|
4425
4453
|
case 7:
|
|
4426
|
-
return
|
|
4454
|
+
return ">=";
|
|
4427
4455
|
case 8:
|
|
4428
|
-
return
|
|
4456
|
+
return "+";
|
|
4429
4457
|
case 9:
|
|
4430
|
-
return
|
|
4458
|
+
return "-";
|
|
4431
4459
|
case 10:
|
|
4432
|
-
return
|
|
4460
|
+
return "*";
|
|
4433
4461
|
case 11:
|
|
4434
|
-
return
|
|
4462
|
+
return "/";
|
|
4435
4463
|
case 12:
|
|
4436
|
-
return
|
|
4464
|
+
return "%";
|
|
4437
4465
|
case 13:
|
|
4438
|
-
return
|
|
4466
|
+
return "**";
|
|
4439
4467
|
case 14:
|
|
4440
|
-
return
|
|
4468
|
+
return "<<";
|
|
4441
4469
|
case 15:
|
|
4442
|
-
return
|
|
4470
|
+
return ">>";
|
|
4443
4471
|
case 16:
|
|
4444
|
-
return
|
|
4472
|
+
return ">>>";
|
|
4445
4473
|
case 17:
|
|
4446
|
-
return
|
|
4474
|
+
return "|";
|
|
4447
4475
|
case 18:
|
|
4448
|
-
return
|
|
4476
|
+
return "^";
|
|
4449
4477
|
case 19:
|
|
4450
|
-
return
|
|
4478
|
+
return "&";
|
|
4451
4479
|
case 20:
|
|
4452
|
-
return
|
|
4480
|
+
return "in";
|
|
4453
4481
|
case 21:
|
|
4454
|
-
return
|
|
4482
|
+
return "instanceof";
|
|
4455
4483
|
default:
|
|
4456
4484
|
throw Error(`Unexpected discriminant ${uint8[pos]} for BinaryOperator`);
|
|
4457
4485
|
}
|
|
@@ -4460,11 +4488,11 @@ function deserializeBinaryOperator(pos) {
|
|
|
4460
4488
|
function deserializeLogicalOperator(pos) {
|
|
4461
4489
|
switch (uint8[pos]) {
|
|
4462
4490
|
case 0:
|
|
4463
|
-
return
|
|
4491
|
+
return "||";
|
|
4464
4492
|
case 1:
|
|
4465
|
-
return
|
|
4493
|
+
return "&&";
|
|
4466
4494
|
case 2:
|
|
4467
|
-
return
|
|
4495
|
+
return "??";
|
|
4468
4496
|
default:
|
|
4469
4497
|
throw Error(`Unexpected discriminant ${uint8[pos]} for LogicalOperator`);
|
|
4470
4498
|
}
|
|
@@ -4473,19 +4501,19 @@ function deserializeLogicalOperator(pos) {
|
|
|
4473
4501
|
function deserializeUnaryOperator(pos) {
|
|
4474
4502
|
switch (uint8[pos]) {
|
|
4475
4503
|
case 0:
|
|
4476
|
-
return
|
|
4504
|
+
return "+";
|
|
4477
4505
|
case 1:
|
|
4478
|
-
return
|
|
4506
|
+
return "-";
|
|
4479
4507
|
case 2:
|
|
4480
|
-
return
|
|
4508
|
+
return "!";
|
|
4481
4509
|
case 3:
|
|
4482
|
-
return
|
|
4510
|
+
return "~";
|
|
4483
4511
|
case 4:
|
|
4484
|
-
return
|
|
4512
|
+
return "typeof";
|
|
4485
4513
|
case 5:
|
|
4486
|
-
return
|
|
4514
|
+
return "void";
|
|
4487
4515
|
case 6:
|
|
4488
|
-
return
|
|
4516
|
+
return "delete";
|
|
4489
4517
|
default:
|
|
4490
4518
|
throw Error(`Unexpected discriminant ${uint8[pos]} for UnaryOperator`);
|
|
4491
4519
|
}
|
|
@@ -4494,9 +4522,9 @@ function deserializeUnaryOperator(pos) {
|
|
|
4494
4522
|
function deserializeUpdateOperator(pos) {
|
|
4495
4523
|
switch (uint8[pos]) {
|
|
4496
4524
|
case 0:
|
|
4497
|
-
return
|
|
4525
|
+
return "++";
|
|
4498
4526
|
case 1:
|
|
4499
|
-
return
|
|
4527
|
+
return "--";
|
|
4500
4528
|
default:
|
|
4501
4529
|
throw Error(`Unexpected discriminant ${uint8[pos]} for UpdateOperator`);
|
|
4502
4530
|
}
|
|
@@ -4512,9 +4540,9 @@ function deserializeSpan(pos) {
|
|
|
4512
4540
|
function deserializeModuleKind(pos) {
|
|
4513
4541
|
switch (uint8[pos]) {
|
|
4514
4542
|
case 0:
|
|
4515
|
-
return
|
|
4543
|
+
return "script";
|
|
4516
4544
|
case 1:
|
|
4517
|
-
return
|
|
4545
|
+
return "module";
|
|
4518
4546
|
default:
|
|
4519
4547
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ModuleKind`);
|
|
4520
4548
|
}
|
|
@@ -4542,11 +4570,11 @@ function deserializeError(pos) {
|
|
|
4542
4570
|
function deserializeErrorSeverity(pos) {
|
|
4543
4571
|
switch (uint8[pos]) {
|
|
4544
4572
|
case 0:
|
|
4545
|
-
return
|
|
4573
|
+
return "Error";
|
|
4546
4574
|
case 1:
|
|
4547
|
-
return
|
|
4575
|
+
return "Warning";
|
|
4548
4576
|
case 2:
|
|
4549
|
-
return
|
|
4577
|
+
return "Advice";
|
|
4550
4578
|
default:
|
|
4551
4579
|
throw Error(`Unexpected discriminant ${uint8[pos]} for ErrorSeverity`);
|
|
4552
4580
|
}
|
|
@@ -4604,7 +4632,7 @@ function deserializeU8(pos) {
|
|
|
4604
4632
|
function deserializeStr(pos) {
|
|
4605
4633
|
let pos32 = pos >> 2,
|
|
4606
4634
|
len = uint32[pos32 + 2];
|
|
4607
|
-
if (len === 0) return
|
|
4635
|
+
if (len === 0) return "";
|
|
4608
4636
|
pos = uint32[pos32];
|
|
4609
4637
|
if (sourceIsAscii && pos < sourceByteLen) return sourceText.substr(pos, len);
|
|
4610
4638
|
// Longer strings use `TextDecoder`
|
|
@@ -4612,7 +4640,7 @@ function deserializeStr(pos) {
|
|
|
4612
4640
|
let end = pos + len;
|
|
4613
4641
|
if (len > 50) return decodeStr(uint8.subarray(pos, end));
|
|
4614
4642
|
// Shorter strings decode by hand to avoid native call
|
|
4615
|
-
let out =
|
|
4643
|
+
let out = "",
|
|
4616
4644
|
c;
|
|
4617
4645
|
do {
|
|
4618
4646
|
c = uint8[pos++];
|
|
@@ -5087,6 +5115,10 @@ function deserializeBoxTSModuleDeclaration(pos) {
|
|
|
5087
5115
|
return deserializeTSModuleDeclaration(uint32[pos >> 2]);
|
|
5088
5116
|
}
|
|
5089
5117
|
|
|
5118
|
+
function deserializeBoxTSGlobalDeclaration(pos) {
|
|
5119
|
+
return deserializeTSGlobalDeclaration(uint32[pos >> 2]);
|
|
5120
|
+
}
|
|
5121
|
+
|
|
5090
5122
|
function deserializeBoxTSImportEqualsDeclaration(pos) {
|
|
5091
5123
|
return deserializeTSImportEqualsDeclaration(uint32[pos >> 2]);
|
|
5092
5124
|
}
|