@putout/babel 2.10.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bundle/index.d.ts +35 -25
- package/bundle/index.js +545 -289
- package/package.json +8 -8
package/bundle/index.js
CHANGED
|
@@ -5068,6 +5068,24 @@ var require_globals = __commonJS({
|
|
|
5068
5068
|
uniq: false,
|
|
5069
5069
|
which: false
|
|
5070
5070
|
},
|
|
5071
|
+
vitest: {
|
|
5072
|
+
afterAll: false,
|
|
5073
|
+
afterEach: false,
|
|
5074
|
+
assert: false,
|
|
5075
|
+
assertType: false,
|
|
5076
|
+
beforeAll: false,
|
|
5077
|
+
beforeEach: false,
|
|
5078
|
+
describe: false,
|
|
5079
|
+
expect: false,
|
|
5080
|
+
expectTypeOf: false,
|
|
5081
|
+
it: false,
|
|
5082
|
+
onTestFailed: false,
|
|
5083
|
+
onTestFinished: false,
|
|
5084
|
+
suite: false,
|
|
5085
|
+
test: false,
|
|
5086
|
+
vi: false,
|
|
5087
|
+
vitest: false
|
|
5088
|
+
},
|
|
5071
5089
|
webextensions: {
|
|
5072
5090
|
browser: false,
|
|
5073
5091
|
chrome: false,
|
|
@@ -5400,8 +5418,8 @@ var require_globals2 = __commonJS({
|
|
|
5400
5418
|
}
|
|
5401
5419
|
});
|
|
5402
5420
|
// lib/index.mjs
|
|
5403
|
-
var
|
|
5404
|
-
__export(
|
|
5421
|
+
var index_exports = {};
|
|
5422
|
+
__export(index_exports, {
|
|
5405
5423
|
codeFrameColumns: function() {
|
|
5406
5424
|
return codeFrameColumns;
|
|
5407
5425
|
},
|
|
@@ -5427,7 +5445,7 @@ __export(lib_exports2, {
|
|
|
5427
5445
|
return lib_exports;
|
|
5428
5446
|
}
|
|
5429
5447
|
});
|
|
5430
|
-
module.exports = __toCommonJS(
|
|
5448
|
+
module.exports = __toCommonJS(index_exports);
|
|
5431
5449
|
// node_modules/@babel/types/lib/index.js
|
|
5432
5450
|
var lib_exports = {};
|
|
5433
5451
|
__export(lib_exports, {
|
|
@@ -6160,6 +6178,9 @@ __export(lib_exports, {
|
|
|
6160
6178
|
TSENTITYNAME_TYPES: function() {
|
|
6161
6179
|
return TSENTITYNAME_TYPES;
|
|
6162
6180
|
},
|
|
6181
|
+
TSEnumBody: function() {
|
|
6182
|
+
return tsEnumBody;
|
|
6183
|
+
},
|
|
6163
6184
|
TSEnumDeclaration: function() {
|
|
6164
6185
|
return tsEnumDeclaration;
|
|
6165
6186
|
},
|
|
@@ -7111,6 +7132,9 @@ __export(lib_exports, {
|
|
|
7111
7132
|
assertTSEntityName: function() {
|
|
7112
7133
|
return assertTSEntityName;
|
|
7113
7134
|
},
|
|
7135
|
+
assertTSEnumBody: function() {
|
|
7136
|
+
return assertTSEnumBody;
|
|
7137
|
+
},
|
|
7114
7138
|
assertTSEnumDeclaration: function() {
|
|
7115
7139
|
return assertTSEnumDeclaration;
|
|
7116
7140
|
},
|
|
@@ -8368,6 +8392,9 @@ __export(lib_exports, {
|
|
|
8368
8392
|
isTSEntityName: function() {
|
|
8369
8393
|
return isTSEntityName;
|
|
8370
8394
|
},
|
|
8395
|
+
isTSEnumBody: function() {
|
|
8396
|
+
return isTSEnumBody;
|
|
8397
|
+
},
|
|
8371
8398
|
isTSEnumDeclaration: function() {
|
|
8372
8399
|
return isTSEnumDeclaration;
|
|
8373
8400
|
},
|
|
@@ -8962,6 +8989,9 @@ __export(lib_exports, {
|
|
|
8962
8989
|
tsDeclareMethod: function() {
|
|
8963
8990
|
return tsDeclareMethod;
|
|
8964
8991
|
},
|
|
8992
|
+
tsEnumBody: function() {
|
|
8993
|
+
return tsEnumBody;
|
|
8994
|
+
},
|
|
8965
8995
|
tsEnumDeclaration: function() {
|
|
8966
8996
|
return tsEnumDeclaration;
|
|
8967
8997
|
},
|
|
@@ -11765,6 +11795,11 @@ function isTSTypeAssertion(node, opts) {
|
|
|
11765
11795
|
if (node.type !== "TSTypeAssertion") return false;
|
|
11766
11796
|
return opts == null || shallowEqual(node, opts);
|
|
11767
11797
|
}
|
|
11798
|
+
function isTSEnumBody(node, opts) {
|
|
11799
|
+
if (!node) return false;
|
|
11800
|
+
if (node.type !== "TSEnumBody") return false;
|
|
11801
|
+
return opts == null || shallowEqual(node, opts);
|
|
11802
|
+
}
|
|
11768
11803
|
function isTSEnumDeclaration(node, opts) {
|
|
11769
11804
|
if (!node) return false;
|
|
11770
11805
|
if (node.type !== "TSEnumDeclaration") return false;
|
|
@@ -12863,6 +12898,7 @@ function isTypeScript(node, opts) {
|
|
|
12863
12898
|
case "TSAsExpression":
|
|
12864
12899
|
case "TSSatisfiesExpression":
|
|
12865
12900
|
case "TSTypeAssertion":
|
|
12901
|
+
case "TSEnumBody":
|
|
12866
12902
|
case "TSEnumDeclaration":
|
|
12867
12903
|
case "TSEnumMember":
|
|
12868
12904
|
case "TSModuleDeclaration":
|
|
@@ -13842,7 +13878,6 @@ defineType$4("CallExpression", {
|
|
|
13842
13878
|
visitor: [
|
|
13843
13879
|
"callee",
|
|
13844
13880
|
"arguments",
|
|
13845
|
-
"typeParameters",
|
|
13846
13881
|
"typeArguments"
|
|
13847
13882
|
],
|
|
13848
13883
|
builder: [
|
|
@@ -13856,14 +13891,14 @@ defineType$4("CallExpression", {
|
|
|
13856
13891
|
callee: {
|
|
13857
13892
|
validate: assertNodeType("Expression", "Super", "V8IntrinsicIdentifier")
|
|
13858
13893
|
},
|
|
13859
|
-
arguments: validateArrayOfType("Expression", "SpreadElement", "ArgumentPlaceholder")
|
|
13860
|
-
}, {}, {
|
|
13894
|
+
arguments: validateArrayOfType("Expression", "SpreadElement", "ArgumentPlaceholder"),
|
|
13861
13895
|
typeArguments: {
|
|
13862
|
-
validate: assertNodeType("TypeParameterInstantiation"),
|
|
13896
|
+
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
13863
13897
|
optional: true
|
|
13864
|
-
}
|
|
13865
|
-
|
|
13866
|
-
|
|
13898
|
+
}
|
|
13899
|
+
}, {}, process.env.BABEL_TYPES_8_BREAKING ? {} : {
|
|
13900
|
+
optional: {
|
|
13901
|
+
validate: assertValueType("boolean"),
|
|
13867
13902
|
optional: true
|
|
13868
13903
|
}
|
|
13869
13904
|
})
|
|
@@ -14104,6 +14139,7 @@ defineType$4("FunctionDeclaration", {
|
|
|
14104
14139
|
"id",
|
|
14105
14140
|
"typeParameters",
|
|
14106
14141
|
"params",
|
|
14142
|
+
"predicate",
|
|
14107
14143
|
"returnType",
|
|
14108
14144
|
"body"
|
|
14109
14145
|
],
|
|
@@ -14961,6 +14997,7 @@ defineType$4("ArrowFunctionExpression", {
|
|
|
14961
14997
|
visitor: [
|
|
14962
14998
|
"typeParameters",
|
|
14963
14999
|
"params",
|
|
15000
|
+
"predicate",
|
|
14964
15001
|
"returnType",
|
|
14965
15002
|
"body"
|
|
14966
15003
|
],
|
|
@@ -15556,7 +15593,7 @@ defineType$4("Super", void 0);
|
|
|
15556
15593
|
defineType$4("TaggedTemplateExpression", {
|
|
15557
15594
|
visitor: [
|
|
15558
15595
|
"tag",
|
|
15559
|
-
"
|
|
15596
|
+
"typeArguments",
|
|
15560
15597
|
"quasi"
|
|
15561
15598
|
],
|
|
15562
15599
|
builder: [
|
|
@@ -15566,18 +15603,17 @@ defineType$4("TaggedTemplateExpression", {
|
|
|
15566
15603
|
aliases: [
|
|
15567
15604
|
"Expression"
|
|
15568
15605
|
],
|
|
15569
|
-
fields: {
|
|
15606
|
+
fields: _define_property({
|
|
15570
15607
|
tag: {
|
|
15571
15608
|
validate: assertNodeType("Expression")
|
|
15572
15609
|
},
|
|
15573
15610
|
quasi: {
|
|
15574
15611
|
validate: assertNodeType("TemplateLiteral")
|
|
15575
|
-
},
|
|
15576
|
-
typeParameters: {
|
|
15577
|
-
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
15578
|
-
optional: true
|
|
15579
15612
|
}
|
|
15580
|
-
}
|
|
15613
|
+
}, "typeArguments", {
|
|
15614
|
+
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
15615
|
+
optional: true
|
|
15616
|
+
})
|
|
15581
15617
|
});
|
|
15582
15618
|
defineType$4("TemplateElement", {
|
|
15583
15619
|
builder: [
|
|
@@ -15766,7 +15802,6 @@ defineType$4("OptionalCallExpression", {
|
|
|
15766
15802
|
visitor: [
|
|
15767
15803
|
"callee",
|
|
15768
15804
|
"arguments",
|
|
15769
|
-
"typeParameters",
|
|
15770
15805
|
"typeArguments"
|
|
15771
15806
|
],
|
|
15772
15807
|
builder: [
|
|
@@ -15777,7 +15812,7 @@ defineType$4("OptionalCallExpression", {
|
|
|
15777
15812
|
aliases: [
|
|
15778
15813
|
"Expression"
|
|
15779
15814
|
],
|
|
15780
|
-
fields: {
|
|
15815
|
+
fields: Object.assign({
|
|
15781
15816
|
callee: {
|
|
15782
15817
|
validate: assertNodeType("Expression")
|
|
15783
15818
|
},
|
|
@@ -15786,18 +15821,15 @@ defineType$4("OptionalCallExpression", {
|
|
|
15786
15821
|
validate: chain(assertValueType("boolean"), assertOptionalChainStart())
|
|
15787
15822
|
},
|
|
15788
15823
|
typeArguments: {
|
|
15789
|
-
validate: assertNodeType("TypeParameterInstantiation"),
|
|
15790
|
-
optional: true
|
|
15791
|
-
},
|
|
15792
|
-
typeParameters: {
|
|
15793
|
-
validate: assertNodeType("TSTypeParameterInstantiation"),
|
|
15824
|
+
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
15794
15825
|
optional: true
|
|
15795
15826
|
}
|
|
15796
|
-
}
|
|
15827
|
+
}, {})
|
|
15797
15828
|
});
|
|
15798
15829
|
defineType$4("ClassProperty", {
|
|
15799
15830
|
visitor: [
|
|
15800
15831
|
"decorators",
|
|
15832
|
+
"variance",
|
|
15801
15833
|
"key",
|
|
15802
15834
|
"typeAnnotation",
|
|
15803
15835
|
"value"
|
|
@@ -15907,6 +15939,7 @@ defineType$4("ClassAccessorProperty", {
|
|
|
15907
15939
|
defineType$4("ClassPrivateProperty", {
|
|
15908
15940
|
visitor: [
|
|
15909
15941
|
"decorators",
|
|
15942
|
+
"variance",
|
|
15910
15943
|
"key",
|
|
15911
15944
|
"typeAnnotation",
|
|
15912
15945
|
"value"
|
|
@@ -16107,9 +16140,13 @@ defineType$3("ClassImplements", {
|
|
|
16107
16140
|
});
|
|
16108
16141
|
defineInterfaceishType("DeclareClass");
|
|
16109
16142
|
defineType$3("DeclareFunction", {
|
|
16110
|
-
|
|
16143
|
+
builder: [
|
|
16111
16144
|
"id"
|
|
16112
16145
|
],
|
|
16146
|
+
visitor: [
|
|
16147
|
+
"id",
|
|
16148
|
+
"predicate"
|
|
16149
|
+
],
|
|
16113
16150
|
aliases: [
|
|
16114
16151
|
"FlowDeclaration",
|
|
16115
16152
|
"Statement",
|
|
@@ -16254,8 +16291,15 @@ defineType$3("ExistsTypeAnnotation", {
|
|
|
16254
16291
|
]
|
|
16255
16292
|
});
|
|
16256
16293
|
defineType$3("FunctionTypeAnnotation", {
|
|
16294
|
+
builder: [
|
|
16295
|
+
"typeParameters",
|
|
16296
|
+
"params",
|
|
16297
|
+
"rest",
|
|
16298
|
+
"returnType"
|
|
16299
|
+
],
|
|
16257
16300
|
visitor: [
|
|
16258
16301
|
"typeParameters",
|
|
16302
|
+
"this",
|
|
16259
16303
|
"params",
|
|
16260
16304
|
"rest",
|
|
16261
16305
|
"returnType"
|
|
@@ -16752,9 +16796,13 @@ defineType$3("EnumBooleanMember", {
|
|
|
16752
16796
|
aliases: [
|
|
16753
16797
|
"EnumMember"
|
|
16754
16798
|
],
|
|
16755
|
-
|
|
16799
|
+
builder: [
|
|
16756
16800
|
"id"
|
|
16757
16801
|
],
|
|
16802
|
+
visitor: [
|
|
16803
|
+
"id",
|
|
16804
|
+
"init"
|
|
16805
|
+
],
|
|
16758
16806
|
fields: {
|
|
16759
16807
|
id: validateType("Identifier"),
|
|
16760
16808
|
init: validateType("BooleanLiteral")
|
|
@@ -16955,12 +17003,13 @@ defineType$2("JSXOpeningElement", {
|
|
|
16955
17003
|
],
|
|
16956
17004
|
visitor: [
|
|
16957
17005
|
"name",
|
|
17006
|
+
"typeArguments",
|
|
16958
17007
|
"attributes"
|
|
16959
17008
|
],
|
|
16960
17009
|
aliases: [
|
|
16961
17010
|
"Immutable"
|
|
16962
17011
|
],
|
|
16963
|
-
fields: {
|
|
17012
|
+
fields: Object.assign({
|
|
16964
17013
|
name: {
|
|
16965
17014
|
validate: assertNodeType("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName")
|
|
16966
17015
|
},
|
|
@@ -16968,11 +17017,11 @@ defineType$2("JSXOpeningElement", {
|
|
|
16968
17017
|
default: false
|
|
16969
17018
|
},
|
|
16970
17019
|
attributes: validateArrayOfType("JSXAttribute", "JSXSpreadAttribute"),
|
|
16971
|
-
|
|
17020
|
+
typeArguments: {
|
|
16972
17021
|
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
16973
17022
|
optional: true
|
|
16974
17023
|
}
|
|
16975
|
-
}
|
|
17024
|
+
}, {})
|
|
16976
17025
|
});
|
|
16977
17026
|
defineType$2("JSXSpreadAttribute", {
|
|
16978
17027
|
visitor: [
|
|
@@ -17522,12 +17571,11 @@ defineType("TSTypeQuery", {
|
|
|
17522
17571
|
],
|
|
17523
17572
|
visitor: [
|
|
17524
17573
|
"exprName",
|
|
17525
|
-
"
|
|
17574
|
+
"typeArguments"
|
|
17526
17575
|
],
|
|
17527
|
-
fields: {
|
|
17528
|
-
exprName: validateType("TSEntityName", "TSImportType")
|
|
17529
|
-
|
|
17530
|
-
}
|
|
17576
|
+
fields: _define_property({
|
|
17577
|
+
exprName: validateType("TSEntityName", "TSImportType")
|
|
17578
|
+
}, "typeArguments", validateOptionalType("TSTypeParameterInstantiation"))
|
|
17531
17579
|
});
|
|
17532
17580
|
defineType("TSTypeLiteral", {
|
|
17533
17581
|
aliases: [
|
|
@@ -17741,22 +17789,33 @@ defineType("TSLiteralType", {
|
|
|
17741
17789
|
}
|
|
17742
17790
|
}
|
|
17743
17791
|
});
|
|
17744
|
-
var expressionWithTypeArguments = {
|
|
17745
|
-
aliases: [
|
|
17746
|
-
"TSType"
|
|
17747
|
-
],
|
|
17748
|
-
visitor: [
|
|
17749
|
-
"expression",
|
|
17750
|
-
"typeParameters"
|
|
17751
|
-
],
|
|
17752
|
-
fields: {
|
|
17753
|
-
expression: validateType("TSEntityName"),
|
|
17754
|
-
typeParameters: validateOptionalType("TSTypeParameterInstantiation")
|
|
17755
|
-
}
|
|
17756
|
-
};
|
|
17757
17792
|
{
|
|
17758
|
-
defineType("TSClassImplements",
|
|
17759
|
-
|
|
17793
|
+
defineType("TSClassImplements", {
|
|
17794
|
+
aliases: [
|
|
17795
|
+
"TSType"
|
|
17796
|
+
],
|
|
17797
|
+
visitor: [
|
|
17798
|
+
"expression",
|
|
17799
|
+
"typeArguments"
|
|
17800
|
+
],
|
|
17801
|
+
fields: {
|
|
17802
|
+
expression: validateType("TSEntityName"),
|
|
17803
|
+
typeArguments: validateOptionalType("TSTypeParameterInstantiation")
|
|
17804
|
+
}
|
|
17805
|
+
});
|
|
17806
|
+
defineType("TSInterfaceHeritage", {
|
|
17807
|
+
aliases: [
|
|
17808
|
+
"TSType"
|
|
17809
|
+
],
|
|
17810
|
+
visitor: [
|
|
17811
|
+
"expression",
|
|
17812
|
+
"typeArguments"
|
|
17813
|
+
],
|
|
17814
|
+
fields: {
|
|
17815
|
+
expression: validateType("TSEntityName"),
|
|
17816
|
+
typeArguments: validateOptionalType("TSTypeParameterInstantiation")
|
|
17817
|
+
}
|
|
17818
|
+
});
|
|
17760
17819
|
}defineType("TSInterfaceDeclaration", {
|
|
17761
17820
|
aliases: [
|
|
17762
17821
|
"Statement",
|
|
@@ -17807,12 +17866,11 @@ defineType("TSInstantiationExpression", {
|
|
|
17807
17866
|
],
|
|
17808
17867
|
visitor: [
|
|
17809
17868
|
"expression",
|
|
17810
|
-
"
|
|
17869
|
+
"typeArguments"
|
|
17811
17870
|
],
|
|
17812
|
-
fields: {
|
|
17813
|
-
expression: validateType("Expression")
|
|
17814
|
-
|
|
17815
|
-
}
|
|
17871
|
+
fields: _define_property({
|
|
17872
|
+
expression: validateType("Expression")
|
|
17873
|
+
}, "typeArguments", validateOptionalType("TSTypeParameterInstantiation"))
|
|
17816
17874
|
});
|
|
17817
17875
|
var TSTypeExpression = {
|
|
17818
17876
|
aliases: [
|
|
@@ -17846,24 +17904,32 @@ defineType("TSTypeAssertion", {
|
|
|
17846
17904
|
expression: validateType("Expression")
|
|
17847
17905
|
}
|
|
17848
17906
|
});
|
|
17849
|
-
defineType("
|
|
17850
|
-
aliases: [
|
|
17851
|
-
"Statement",
|
|
17852
|
-
"Declaration"
|
|
17853
|
-
],
|
|
17907
|
+
defineType("TSEnumBody", {
|
|
17854
17908
|
visitor: [
|
|
17855
|
-
"id",
|
|
17856
17909
|
"members"
|
|
17857
17910
|
],
|
|
17858
17911
|
fields: {
|
|
17859
|
-
|
|
17860
|
-
const: validateOptional(bool),
|
|
17861
|
-
id: validateType("Identifier"),
|
|
17862
|
-
members: validateArrayOfType("TSEnumMember"),
|
|
17863
|
-
initializer: validateOptionalType("Expression")
|
|
17912
|
+
members: validateArrayOfType("TSEnumMember")
|
|
17864
17913
|
}
|
|
17865
17914
|
});
|
|
17866
|
-
|
|
17915
|
+
{
|
|
17916
|
+
defineType("TSEnumDeclaration", {
|
|
17917
|
+
aliases: [
|
|
17918
|
+
"Statement",
|
|
17919
|
+
"Declaration"
|
|
17920
|
+
],
|
|
17921
|
+
visitor: [
|
|
17922
|
+
"id",
|
|
17923
|
+
"body"
|
|
17924
|
+
],
|
|
17925
|
+
fields: {
|
|
17926
|
+
declare: validateOptional(bool),
|
|
17927
|
+
const: validateOptional(bool),
|
|
17928
|
+
id: validateType("Identifier"),
|
|
17929
|
+
body: validateType("TSEnumBody")
|
|
17930
|
+
}
|
|
17931
|
+
});
|
|
17932
|
+
}defineType("TSEnumMember", {
|
|
17867
17933
|
visitor: [
|
|
17868
17934
|
"id",
|
|
17869
17935
|
"initializer"
|
|
@@ -17906,24 +17972,29 @@ defineType("TSModuleBlock", {
|
|
|
17906
17972
|
body: validateArrayOfType("Statement")
|
|
17907
17973
|
}
|
|
17908
17974
|
});
|
|
17975
|
+
var _obj2;
|
|
17909
17976
|
defineType("TSImportType", {
|
|
17910
17977
|
aliases: [
|
|
17911
17978
|
"TSType"
|
|
17912
17979
|
],
|
|
17980
|
+
builder: [
|
|
17981
|
+
"argument",
|
|
17982
|
+
"qualifier",
|
|
17983
|
+
"typeArguments"
|
|
17984
|
+
],
|
|
17913
17985
|
visitor: [
|
|
17914
17986
|
"argument",
|
|
17987
|
+
"options",
|
|
17915
17988
|
"qualifier",
|
|
17916
|
-
"
|
|
17989
|
+
"typeArguments"
|
|
17917
17990
|
],
|
|
17918
|
-
fields: {
|
|
17919
|
-
argument: validateType("
|
|
17920
|
-
qualifier: validateOptionalType("TSEntityName")
|
|
17921
|
-
|
|
17922
|
-
|
|
17923
|
-
|
|
17924
|
-
|
|
17925
|
-
}
|
|
17926
|
-
}
|
|
17991
|
+
fields: (_obj2 = {
|
|
17992
|
+
argument: validateType("TSLiteralType"),
|
|
17993
|
+
qualifier: validateOptionalType("TSEntityName")
|
|
17994
|
+
}, _define_property(_obj2, "typeArguments", validateOptionalType("TSTypeParameterInstantiation")), _define_property(_obj2, "options", {
|
|
17995
|
+
validate: assertNodeType("Expression"),
|
|
17996
|
+
optional: true
|
|
17997
|
+
}), _obj2)
|
|
17927
17998
|
});
|
|
17928
17999
|
defineType("TSImportEqualsDeclaration", {
|
|
17929
18000
|
aliases: [
|
|
@@ -18019,6 +18090,7 @@ defineType("TSTypeParameter", {
|
|
|
18019
18090
|
"name"
|
|
18020
18091
|
],
|
|
18021
18092
|
visitor: [
|
|
18093
|
+
"name",
|
|
18022
18094
|
"constraint",
|
|
18023
18095
|
"default"
|
|
18024
18096
|
],
|
|
@@ -20325,15 +20397,15 @@ function tsTypePredicate(parameterName) {
|
|
|
20325
20397
|
return node;
|
|
20326
20398
|
}
|
|
20327
20399
|
function tsTypeQuery(exprName) {
|
|
20328
|
-
var
|
|
20400
|
+
var typeArguments = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
|
|
20329
20401
|
var node = {
|
|
20330
20402
|
type: "TSTypeQuery",
|
|
20331
20403
|
exprName: exprName,
|
|
20332
|
-
|
|
20404
|
+
typeArguments: typeArguments
|
|
20333
20405
|
};
|
|
20334
20406
|
var defs = NODE_FIELDS.TSTypeQuery;
|
|
20335
20407
|
validate(defs.exprName, node, "exprName", exprName, 1);
|
|
20336
|
-
validate(defs.
|
|
20408
|
+
validate(defs.typeArguments, node, "typeArguments", typeArguments, 1);
|
|
20337
20409
|
return node;
|
|
20338
20410
|
}
|
|
20339
20411
|
function tsTypeLiteral(members) {
|
|
@@ -20493,27 +20565,27 @@ function tsLiteralType(literal) {
|
|
|
20493
20565
|
return node;
|
|
20494
20566
|
}
|
|
20495
20567
|
function tsClassImplements(expression2) {
|
|
20496
|
-
var
|
|
20568
|
+
var typeArguments = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
|
|
20497
20569
|
var node = {
|
|
20498
20570
|
type: "TSClassImplements",
|
|
20499
20571
|
expression: expression2,
|
|
20500
|
-
|
|
20572
|
+
typeArguments: typeArguments
|
|
20501
20573
|
};
|
|
20502
20574
|
var defs = NODE_FIELDS.TSClassImplements;
|
|
20503
20575
|
validate(defs.expression, node, "expression", expression2, 1);
|
|
20504
|
-
validate(defs.
|
|
20576
|
+
validate(defs.typeArguments, node, "typeArguments", typeArguments, 1);
|
|
20505
20577
|
return node;
|
|
20506
20578
|
}
|
|
20507
20579
|
function tsInterfaceHeritage(expression2) {
|
|
20508
|
-
var
|
|
20580
|
+
var typeArguments = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
|
|
20509
20581
|
var node = {
|
|
20510
20582
|
type: "TSInterfaceHeritage",
|
|
20511
20583
|
expression: expression2,
|
|
20512
|
-
|
|
20584
|
+
typeArguments: typeArguments
|
|
20513
20585
|
};
|
|
20514
20586
|
var defs = NODE_FIELDS.TSInterfaceHeritage;
|
|
20515
20587
|
validate(defs.expression, node, "expression", expression2, 1);
|
|
20516
|
-
validate(defs.
|
|
20588
|
+
validate(defs.typeArguments, node, "typeArguments", typeArguments, 1);
|
|
20517
20589
|
return node;
|
|
20518
20590
|
}
|
|
20519
20591
|
function tsInterfaceDeclaration(id) {
|
|
@@ -20556,15 +20628,15 @@ function tsTypeAliasDeclaration(id) {
|
|
|
20556
20628
|
return node;
|
|
20557
20629
|
}
|
|
20558
20630
|
function tsInstantiationExpression(expression2) {
|
|
20559
|
-
var
|
|
20631
|
+
var typeArguments = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
|
|
20560
20632
|
var node = {
|
|
20561
20633
|
type: "TSInstantiationExpression",
|
|
20562
20634
|
expression: expression2,
|
|
20563
|
-
|
|
20635
|
+
typeArguments: typeArguments
|
|
20564
20636
|
};
|
|
20565
20637
|
var defs = NODE_FIELDS.TSInstantiationExpression;
|
|
20566
20638
|
validate(defs.expression, node, "expression", expression2, 1);
|
|
20567
|
-
validate(defs.
|
|
20639
|
+
validate(defs.typeArguments, node, "typeArguments", typeArguments, 1);
|
|
20568
20640
|
return node;
|
|
20569
20641
|
}
|
|
20570
20642
|
function tsAsExpression(expression2, typeAnnotation2) {
|
|
@@ -20600,15 +20672,24 @@ function tsTypeAssertion(typeAnnotation2, expression2) {
|
|
|
20600
20672
|
validate(defs.expression, node, "expression", expression2, 1);
|
|
20601
20673
|
return node;
|
|
20602
20674
|
}
|
|
20603
|
-
function
|
|
20675
|
+
function tsEnumBody(members) {
|
|
20676
|
+
var node = {
|
|
20677
|
+
type: "TSEnumBody",
|
|
20678
|
+
members: members
|
|
20679
|
+
};
|
|
20680
|
+
var defs = NODE_FIELDS.TSEnumBody;
|
|
20681
|
+
validate(defs.members, node, "members", members, 1);
|
|
20682
|
+
return node;
|
|
20683
|
+
}
|
|
20684
|
+
function tsEnumDeclaration(id, body) {
|
|
20604
20685
|
var node = {
|
|
20605
20686
|
type: "TSEnumDeclaration",
|
|
20606
20687
|
id: id,
|
|
20607
|
-
|
|
20688
|
+
body: body
|
|
20608
20689
|
};
|
|
20609
20690
|
var defs = NODE_FIELDS.TSEnumDeclaration;
|
|
20610
20691
|
validate(defs.id, node, "id", id, 1);
|
|
20611
|
-
validate(defs.
|
|
20692
|
+
validate(defs.body, node, "body", body, 1);
|
|
20612
20693
|
return node;
|
|
20613
20694
|
}
|
|
20614
20695
|
function tsEnumMember(id) {
|
|
@@ -20645,17 +20726,17 @@ function tsModuleBlock(body) {
|
|
|
20645
20726
|
return node;
|
|
20646
20727
|
}
|
|
20647
20728
|
function tsImportType(argument) {
|
|
20648
|
-
var qualifier = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null,
|
|
20729
|
+
var qualifier = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, typeArguments = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
|
|
20649
20730
|
var node = {
|
|
20650
20731
|
type: "TSImportType",
|
|
20651
20732
|
argument: argument,
|
|
20652
20733
|
qualifier: qualifier,
|
|
20653
|
-
|
|
20734
|
+
typeArguments: typeArguments
|
|
20654
20735
|
};
|
|
20655
20736
|
var defs = NODE_FIELDS.TSImportType;
|
|
20656
20737
|
validate(defs.argument, node, "argument", argument, 1);
|
|
20657
20738
|
validate(defs.qualifier, node, "qualifier", qualifier, 1);
|
|
20658
|
-
validate(defs.
|
|
20739
|
+
validate(defs.typeArguments, node, "typeArguments", typeArguments, 1);
|
|
20659
20740
|
return node;
|
|
20660
20741
|
}
|
|
20661
20742
|
function tsImportEqualsDeclaration(id, moduleReference) {
|
|
@@ -21528,6 +21609,9 @@ function assertTSSatisfiesExpression(node, opts) {
|
|
|
21528
21609
|
function assertTSTypeAssertion(node, opts) {
|
|
21529
21610
|
assert("TSTypeAssertion", node, opts);
|
|
21530
21611
|
}
|
|
21612
|
+
function assertTSEnumBody(node, opts) {
|
|
21613
|
+
assert("TSEnumBody", node, opts);
|
|
21614
|
+
}
|
|
21531
21615
|
function assertTSEnumDeclaration(node, opts) {
|
|
21532
21616
|
assert("TSEnumDeclaration", node, opts);
|
|
21533
21617
|
}
|
|
@@ -23669,6 +23753,71 @@ function ParseErrorEnum(argument, syntaxPlugin) {
|
|
|
23669
23753
|
return ParseErrorConstructors;
|
|
23670
23754
|
}
|
|
23671
23755
|
var Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum(_templateObject())(PipelineOperatorErrors));
|
|
23756
|
+
function createDefaultOptions() {
|
|
23757
|
+
return {
|
|
23758
|
+
sourceType: "script",
|
|
23759
|
+
sourceFilename: void 0,
|
|
23760
|
+
startIndex: 0,
|
|
23761
|
+
startColumn: 0,
|
|
23762
|
+
startLine: 1,
|
|
23763
|
+
allowAwaitOutsideFunction: false,
|
|
23764
|
+
allowReturnOutsideFunction: false,
|
|
23765
|
+
allowNewTargetOutsideFunction: false,
|
|
23766
|
+
allowImportExportEverywhere: false,
|
|
23767
|
+
allowSuperOutsideMethod: false,
|
|
23768
|
+
allowUndeclaredExports: false,
|
|
23769
|
+
plugins: [],
|
|
23770
|
+
strictMode: null,
|
|
23771
|
+
ranges: false,
|
|
23772
|
+
tokens: false,
|
|
23773
|
+
createImportExpressions: true,
|
|
23774
|
+
createParenthesizedExpressions: false,
|
|
23775
|
+
errorRecovery: false,
|
|
23776
|
+
attachComment: true,
|
|
23777
|
+
annexB: true
|
|
23778
|
+
};
|
|
23779
|
+
}
|
|
23780
|
+
function getOptions(opts) {
|
|
23781
|
+
var options = createDefaultOptions();
|
|
23782
|
+
if (opts == null) {
|
|
23783
|
+
return options;
|
|
23784
|
+
}
|
|
23785
|
+
if (opts.annexB != null && opts.annexB !== false) {
|
|
23786
|
+
throw new Error("The `annexB` option can only be set to `false`.");
|
|
23787
|
+
}
|
|
23788
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
23789
|
+
try {
|
|
23790
|
+
for(var _iterator = Object.keys(options)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
23791
|
+
var key = _step.value;
|
|
23792
|
+
if (opts[key] != null) options[key] = opts[key];
|
|
23793
|
+
}
|
|
23794
|
+
} catch (err) {
|
|
23795
|
+
_didIteratorError = true;
|
|
23796
|
+
_iteratorError = err;
|
|
23797
|
+
} finally{
|
|
23798
|
+
try {
|
|
23799
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
23800
|
+
_iterator.return();
|
|
23801
|
+
}
|
|
23802
|
+
} finally{
|
|
23803
|
+
if (_didIteratorError) {
|
|
23804
|
+
throw _iteratorError;
|
|
23805
|
+
}
|
|
23806
|
+
}
|
|
23807
|
+
}
|
|
23808
|
+
if (options.startLine === 1) {
|
|
23809
|
+
if (opts.startIndex == null && options.startColumn > 0) {
|
|
23810
|
+
options.startIndex = options.startColumn;
|
|
23811
|
+
} else if (opts.startColumn == null && options.startIndex > 0) {
|
|
23812
|
+
options.startColumn = options.startIndex;
|
|
23813
|
+
}
|
|
23814
|
+
} else if (opts.startColumn == null || opts.startIndex == null) {
|
|
23815
|
+
{
|
|
23816
|
+
throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
|
|
23817
|
+
}
|
|
23818
|
+
}
|
|
23819
|
+
return options;
|
|
23820
|
+
}
|
|
23672
23821
|
var defineProperty = Object.defineProperty;
|
|
23673
23822
|
var toUnenumerable = function(object, key) {
|
|
23674
23823
|
if (object) {
|
|
@@ -23696,7 +23845,7 @@ var estree = function(superClass) {
|
|
|
23696
23845
|
key: "parse",
|
|
23697
23846
|
value: function parse() {
|
|
23698
23847
|
var file2 = toESTreeLocation(_get(_get_prototype_of(ESTreeParserMixin.prototype), "parse", this).call(this));
|
|
23699
|
-
if (this.
|
|
23848
|
+
if (this.optionFlags & 128) {
|
|
23700
23849
|
file2.tokens = file2.tokens.map(toESTreeLocation);
|
|
23701
23850
|
}
|
|
23702
23851
|
return file2;
|
|
@@ -23829,21 +23978,6 @@ var estree = function(superClass) {
|
|
|
23829
23978
|
delete node.directives;
|
|
23830
23979
|
}
|
|
23831
23980
|
},
|
|
23832
|
-
{
|
|
23833
|
-
key: "pushClassMethod",
|
|
23834
|
-
value: function pushClassMethod(classBody2, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
23835
|
-
this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
|
|
23836
|
-
var typeParameters = method.typeParameters;
|
|
23837
|
-
if (typeParameters) {
|
|
23838
|
-
delete method.typeParameters;
|
|
23839
|
-
var fn = method.value;
|
|
23840
|
-
fn.typeParameters = typeParameters;
|
|
23841
|
-
fn.start = typeParameters.start;
|
|
23842
|
-
fn.loc.start = typeParameters.loc.start;
|
|
23843
|
-
}
|
|
23844
|
-
classBody2.body.push(method);
|
|
23845
|
-
}
|
|
23846
|
-
},
|
|
23847
23981
|
{
|
|
23848
23982
|
key: "parsePrivateName",
|
|
23849
23983
|
value: function parsePrivateName() {
|
|
@@ -23901,9 +24035,22 @@ var estree = function(superClass) {
|
|
|
23901
24035
|
funcNode.type = "FunctionExpression";
|
|
23902
24036
|
delete funcNode.kind;
|
|
23903
24037
|
node.value = funcNode;
|
|
24038
|
+
var typeParameters = node.typeParameters;
|
|
24039
|
+
if (typeParameters) {
|
|
24040
|
+
delete node.typeParameters;
|
|
24041
|
+
funcNode.typeParameters = typeParameters;
|
|
24042
|
+
funcNode.start = typeParameters.start;
|
|
24043
|
+
funcNode.loc.start = typeParameters.loc.start;
|
|
24044
|
+
}
|
|
23904
24045
|
if (type === "ClassPrivateMethod") {
|
|
23905
24046
|
node.computed = false;
|
|
23906
24047
|
}
|
|
24048
|
+
if (node.abstract && this.hasPlugin("typescript")) {
|
|
24049
|
+
if (!funcNode.body) {
|
|
24050
|
+
funcNode.type = "TSEmptyBodyFunctionExpression";
|
|
24051
|
+
}
|
|
24052
|
+
return this.finishNode(node, "TSAbstractMethodDefinition");
|
|
24053
|
+
}
|
|
23907
24054
|
return this.finishNode(node, "MethodDefinition");
|
|
23908
24055
|
}
|
|
23909
24056
|
},
|
|
@@ -23924,7 +24071,11 @@ var estree = function(superClass) {
|
|
|
23924
24071
|
var propertyNode = (_$_get = _get(_get_prototype_of(ESTreeParserMixin.prototype), "parseClassProperty", this)).call.apply(_$_get, [
|
|
23925
24072
|
this
|
|
23926
24073
|
].concat(_to_consumable_array(args)));
|
|
23927
|
-
propertyNode.
|
|
24074
|
+
if (propertyNode.abstract && this.hasPlugin("typescript")) {
|
|
24075
|
+
propertyNode.type = "TSAbstractPropertyDefinition";
|
|
24076
|
+
} else {
|
|
24077
|
+
propertyNode.type = "PropertyDefinition";
|
|
24078
|
+
}
|
|
23928
24079
|
return propertyNode;
|
|
23929
24080
|
}
|
|
23930
24081
|
},
|
|
@@ -23938,7 +24089,11 @@ var estree = function(superClass) {
|
|
|
23938
24089
|
var propertyNode = (_$_get = _get(_get_prototype_of(ESTreeParserMixin.prototype), "parseClassPrivateProperty", this)).call.apply(_$_get, [
|
|
23939
24090
|
this
|
|
23940
24091
|
].concat(_to_consumable_array(args)));
|
|
23941
|
-
propertyNode.
|
|
24092
|
+
if (propertyNode.abstract && this.hasPlugin("typescript")) {
|
|
24093
|
+
propertyNode.type = "TSAbstractPropertyDefinition";
|
|
24094
|
+
} else {
|
|
24095
|
+
propertyNode.type = "PropertyDefinition";
|
|
24096
|
+
}
|
|
23942
24097
|
propertyNode.computed = false;
|
|
23943
24098
|
return propertyNode;
|
|
23944
24099
|
}
|
|
@@ -26244,6 +26399,14 @@ var CommentsParser = /*#__PURE__*/ function(BaseParser) {
|
|
|
26244
26399
|
case "ImportDeclaration":
|
|
26245
26400
|
adjustInnerComments(node, node.specifiers, commentWS);
|
|
26246
26401
|
break;
|
|
26402
|
+
case "TSEnumDeclaration":
|
|
26403
|
+
{
|
|
26404
|
+
setInnerComments(node, comments);
|
|
26405
|
+
}
|
|
26406
|
+
break;
|
|
26407
|
+
case "TSEnumBody":
|
|
26408
|
+
adjustInnerComments(node, node.members, commentWS);
|
|
26409
|
+
break;
|
|
26247
26410
|
default:
|
|
26248
26411
|
{
|
|
26249
26412
|
setInnerComments(node, comments);
|
|
@@ -26910,7 +27073,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26910
27073
|
__publicField(_this, "tokens", []);
|
|
26911
27074
|
__publicField(_this, "errorHandlers_readInt", {
|
|
26912
27075
|
invalidDigit: function(pos, lineStart, curLine, radix) {
|
|
26913
|
-
if (!_this.
|
|
27076
|
+
if (!(_this.optionFlags & 1024)) return false;
|
|
26914
27077
|
_this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), {
|
|
26915
27078
|
radix: radix
|
|
26916
27079
|
});
|
|
@@ -26958,7 +27121,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
26958
27121
|
key: "next",
|
|
26959
27122
|
value: function next() {
|
|
26960
27123
|
this.checkKeywordEscapes();
|
|
26961
|
-
if (this.
|
|
27124
|
+
if (this.optionFlags & 128) {
|
|
26962
27125
|
this.pushToken(new Token(this.state));
|
|
26963
27126
|
}
|
|
26964
27127
|
this.state.lastTokEndLoc = this.state.endLoc;
|
|
@@ -27125,7 +27288,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
27125
27288
|
end: this.sourceToOffsetPos(end + commentEnd.length),
|
|
27126
27289
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
|
27127
27290
|
};
|
|
27128
|
-
if (this.
|
|
27291
|
+
if (this.optionFlags & 128) this.pushToken(comment);
|
|
27129
27292
|
return comment;
|
|
27130
27293
|
}
|
|
27131
27294
|
},
|
|
@@ -27151,7 +27314,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
27151
27314
|
end: this.sourceToOffsetPos(end),
|
|
27152
27315
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
|
27153
27316
|
};
|
|
27154
|
-
if (this.
|
|
27317
|
+
if (this.optionFlags & 128) this.pushToken(comment);
|
|
27155
27318
|
return comment;
|
|
27156
27319
|
}
|
|
27157
27320
|
},
|
|
@@ -27159,7 +27322,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
27159
27322
|
key: "skipSpace",
|
|
27160
27323
|
value: function skipSpace() {
|
|
27161
27324
|
var spaceStart = this.state.pos;
|
|
27162
|
-
var comments = [];
|
|
27325
|
+
var comments = this.optionFlags & 2048 ? [] : null;
|
|
27163
27326
|
loop: while(this.state.pos < this.length){
|
|
27164
27327
|
var ch = this.input.charCodeAt(this.state.pos);
|
|
27165
27328
|
switch(ch){
|
|
@@ -27186,7 +27349,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
27186
27349
|
var comment = this.skipBlockComment("*/");
|
|
27187
27350
|
if (comment !== void 0) {
|
|
27188
27351
|
this.addComment(comment);
|
|
27189
|
-
|
|
27352
|
+
comments === null || comments === void 0 ? void 0 : comments.push(comment);
|
|
27190
27353
|
}
|
|
27191
27354
|
break;
|
|
27192
27355
|
}
|
|
@@ -27195,7 +27358,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
27195
27358
|
var comment1 = this.skipLineComment(2);
|
|
27196
27359
|
if (comment1 !== void 0) {
|
|
27197
27360
|
this.addComment(comment1);
|
|
27198
|
-
|
|
27361
|
+
comments === null || comments === void 0 ? void 0 : comments.push(comment1);
|
|
27199
27362
|
}
|
|
27200
27363
|
break;
|
|
27201
27364
|
}
|
|
@@ -27206,24 +27369,24 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
27206
27369
|
default:
|
|
27207
27370
|
if (isWhitespace(ch)) {
|
|
27208
27371
|
++this.state.pos;
|
|
27209
|
-
} else if (ch === 45 && !this.inModule && this.
|
|
27372
|
+
} else if (ch === 45 && !this.inModule && this.optionFlags & 4096) {
|
|
27210
27373
|
var pos = this.state.pos;
|
|
27211
27374
|
if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
|
|
27212
27375
|
var comment2 = this.skipLineComment(3);
|
|
27213
27376
|
if (comment2 !== void 0) {
|
|
27214
27377
|
this.addComment(comment2);
|
|
27215
|
-
|
|
27378
|
+
comments === null || comments === void 0 ? void 0 : comments.push(comment2);
|
|
27216
27379
|
}
|
|
27217
27380
|
} else {
|
|
27218
27381
|
break loop;
|
|
27219
27382
|
}
|
|
27220
|
-
} else if (ch === 60 && !this.inModule && this.
|
|
27383
|
+
} else if (ch === 60 && !this.inModule && this.optionFlags & 4096) {
|
|
27221
27384
|
var pos1 = this.state.pos;
|
|
27222
27385
|
if (this.input.charCodeAt(pos1 + 1) === 33 && this.input.charCodeAt(pos1 + 2) === 45 && this.input.charCodeAt(pos1 + 3) === 45) {
|
|
27223
27386
|
var comment3 = this.skipLineComment(4);
|
|
27224
27387
|
if (comment3 !== void 0) {
|
|
27225
27388
|
this.addComment(comment3);
|
|
27226
|
-
|
|
27389
|
+
comments === null || comments === void 0 ? void 0 : comments.push(comment3);
|
|
27227
27390
|
}
|
|
27228
27391
|
} else {
|
|
27229
27392
|
break loop;
|
|
@@ -27233,7 +27396,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
27233
27396
|
}
|
|
27234
27397
|
}
|
|
27235
27398
|
}
|
|
27236
|
-
if (comments.length > 0) {
|
|
27399
|
+
if ((comments === null || comments === void 0 ? void 0 : comments.length) > 0) {
|
|
27237
27400
|
var end = this.state.pos;
|
|
27238
27401
|
var commentWhitespace = {
|
|
27239
27402
|
start: this.sourceToOffsetPos(spaceStart),
|
|
@@ -27958,7 +28121,7 @@ var Tokenizer = /*#__PURE__*/ function(CommentsParser) {
|
|
|
27958
28121
|
var details = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
27959
28122
|
var loc = _instanceof(at, Position) ? at : at.loc.start;
|
|
27960
28123
|
var error = toParseError(loc, details);
|
|
27961
|
-
if (!this.
|
|
28124
|
+
if (!(this.optionFlags & 1024)) throw error;
|
|
27962
28125
|
if (!this.isLookahead) this.state.errors.push(error);
|
|
27963
28126
|
return error;
|
|
27964
28127
|
}
|
|
@@ -28675,7 +28838,7 @@ var Node = function Node(parser, pos, loc) {
|
|
|
28675
28838
|
this.start = pos;
|
|
28676
28839
|
this.end = 0;
|
|
28677
28840
|
this.loc = new SourceLocation(loc);
|
|
28678
|
-
if (parser === null || parser === void 0 ? void 0 : parser.
|
|
28841
|
+
if ((parser === null || parser === void 0 ? void 0 : parser.optionFlags) & 64) this.range = [
|
|
28679
28842
|
pos,
|
|
28680
28843
|
0
|
|
28681
28844
|
];
|
|
@@ -28758,8 +28921,10 @@ var NodeUtils = /*#__PURE__*/ function(UtilParser) {
|
|
|
28758
28921
|
node.type = type;
|
|
28759
28922
|
node.end = endLoc.index;
|
|
28760
28923
|
node.loc.end = endLoc;
|
|
28761
|
-
if (this.
|
|
28762
|
-
if (this.
|
|
28924
|
+
if (this.optionFlags & 64) node.range[1] = endLoc.index;
|
|
28925
|
+
if (this.optionFlags & 2048) {
|
|
28926
|
+
this.processComment(node);
|
|
28927
|
+
}
|
|
28763
28928
|
return node;
|
|
28764
28929
|
}
|
|
28765
28930
|
},
|
|
@@ -28768,7 +28933,7 @@ var NodeUtils = /*#__PURE__*/ function(UtilParser) {
|
|
|
28768
28933
|
value: function resetStartLocation(node, startLoc) {
|
|
28769
28934
|
node.start = startLoc.index;
|
|
28770
28935
|
node.loc.start = startLoc;
|
|
28771
|
-
if (this.
|
|
28936
|
+
if (this.optionFlags & 64) node.range[0] = startLoc.index;
|
|
28772
28937
|
}
|
|
28773
28938
|
},
|
|
28774
28939
|
{
|
|
@@ -28777,7 +28942,7 @@ var NodeUtils = /*#__PURE__*/ function(UtilParser) {
|
|
|
28777
28942
|
var endLoc = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.state.lastTokEndLoc;
|
|
28778
28943
|
node.end = endLoc.index;
|
|
28779
28944
|
node.loc.end = endLoc;
|
|
28780
|
-
if (this.
|
|
28945
|
+
if (this.optionFlags & 64) node.range[1] = endLoc.index;
|
|
28781
28946
|
}
|
|
28782
28947
|
},
|
|
28783
28948
|
{
|
|
@@ -29407,31 +29572,63 @@ var flow = function(superClass) {
|
|
|
29407
29572
|
return this.finishNode(node, "TypeParameterDeclaration");
|
|
29408
29573
|
}
|
|
29409
29574
|
},
|
|
29575
|
+
{
|
|
29576
|
+
key: "flowInTopLevelContext",
|
|
29577
|
+
value: function flowInTopLevelContext(cb) {
|
|
29578
|
+
if (this.curContext() !== types.brace) {
|
|
29579
|
+
var oldContext = this.state.context;
|
|
29580
|
+
this.state.context = [
|
|
29581
|
+
oldContext[0]
|
|
29582
|
+
];
|
|
29583
|
+
try {
|
|
29584
|
+
return cb();
|
|
29585
|
+
} finally{
|
|
29586
|
+
this.state.context = oldContext;
|
|
29587
|
+
}
|
|
29588
|
+
} else {
|
|
29589
|
+
return cb();
|
|
29590
|
+
}
|
|
29591
|
+
}
|
|
29592
|
+
},
|
|
29593
|
+
{
|
|
29594
|
+
key: "flowParseTypeParameterInstantiationInExpression",
|
|
29595
|
+
value: function flowParseTypeParameterInstantiationInExpression() {
|
|
29596
|
+
if (this.reScan_lt() !== 47) return;
|
|
29597
|
+
return this.flowParseTypeParameterInstantiation();
|
|
29598
|
+
}
|
|
29599
|
+
},
|
|
29410
29600
|
{
|
|
29411
29601
|
key: "flowParseTypeParameterInstantiation",
|
|
29412
29602
|
value: function flowParseTypeParameterInstantiation() {
|
|
29603
|
+
var _this = this;
|
|
29413
29604
|
var node = this.startNode();
|
|
29414
29605
|
var oldInType = this.state.inType;
|
|
29415
|
-
node.params = [];
|
|
29416
29606
|
this.state.inType = true;
|
|
29417
|
-
|
|
29418
|
-
|
|
29419
|
-
|
|
29420
|
-
|
|
29421
|
-
|
|
29422
|
-
|
|
29423
|
-
|
|
29607
|
+
node.params = [];
|
|
29608
|
+
this.flowInTopLevelContext(function() {
|
|
29609
|
+
_this.expect(47);
|
|
29610
|
+
var oldNoAnonFunctionType = _this.state.noAnonFunctionType;
|
|
29611
|
+
_this.state.noAnonFunctionType = false;
|
|
29612
|
+
while(!_this.match(48)){
|
|
29613
|
+
node.params.push(_this.flowParseType());
|
|
29614
|
+
if (!_this.match(48)) {
|
|
29615
|
+
_this.expect(12);
|
|
29616
|
+
}
|
|
29424
29617
|
}
|
|
29618
|
+
_this.state.noAnonFunctionType = oldNoAnonFunctionType;
|
|
29619
|
+
});
|
|
29620
|
+
this.state.inType = oldInType;
|
|
29621
|
+
if (!this.state.inType && this.curContext() === types.brace) {
|
|
29622
|
+
this.reScan_lt_gt();
|
|
29425
29623
|
}
|
|
29426
|
-
this.state.noAnonFunctionType = oldNoAnonFunctionType;
|
|
29427
29624
|
this.expect(48);
|
|
29428
|
-
this.state.inType = oldInType;
|
|
29429
29625
|
return this.finishNode(node, "TypeParameterInstantiation");
|
|
29430
29626
|
}
|
|
29431
29627
|
},
|
|
29432
29628
|
{
|
|
29433
29629
|
key: "flowParseTypeParameterInstantiationCallOrNew",
|
|
29434
29630
|
value: function flowParseTypeParameterInstantiationCallOrNew() {
|
|
29631
|
+
if (this.reScan_lt() !== 47) return;
|
|
29435
29632
|
var node = this.startNode();
|
|
29436
29633
|
var oldInType = this.state.inType;
|
|
29437
29634
|
node.params = [];
|
|
@@ -30694,9 +30891,9 @@ var flow = function(superClass) {
|
|
|
30694
30891
|
key: "parseClassSuper",
|
|
30695
30892
|
value: function parseClassSuper(node) {
|
|
30696
30893
|
_get(_get_prototype_of(FlowParserMixin.prototype), "parseClassSuper", this).call(this, node);
|
|
30697
|
-
if (node.superClass && this.match(47)) {
|
|
30894
|
+
if (node.superClass && (this.match(47) || this.match(51))) {
|
|
30698
30895
|
{
|
|
30699
|
-
node.superTypeArguments = this.
|
|
30896
|
+
node.superTypeArguments = this.flowParseTypeParameterInstantiationInExpression();
|
|
30700
30897
|
}
|
|
30701
30898
|
}
|
|
30702
30899
|
if (this.isContextual(113)) {
|
|
@@ -31105,12 +31302,12 @@ var flow = function(superClass) {
|
|
|
31105
31302
|
this.next();
|
|
31106
31303
|
var node = this.startNodeAt(startLoc);
|
|
31107
31304
|
node.callee = base;
|
|
31108
|
-
node.typeArguments = this.
|
|
31305
|
+
node.typeArguments = this.flowParseTypeParameterInstantiationInExpression();
|
|
31109
31306
|
this.expect(10);
|
|
31110
31307
|
node.arguments = this.parseCallExpressionArguments(11);
|
|
31111
31308
|
node.optional = true;
|
|
31112
31309
|
return this.finishCallExpression(node, true);
|
|
31113
|
-
} else if (!noCalls && this.shouldParseTypes() && this.match(47)) {
|
|
31310
|
+
} else if (!noCalls && this.shouldParseTypes() && (this.match(47) || this.match(51))) {
|
|
31114
31311
|
var node1 = this.startNodeAt(startLoc);
|
|
31115
31312
|
node1.callee = base;
|
|
31116
31313
|
var result = this.tryParse(function() {
|
|
@@ -31660,6 +31857,17 @@ var flow = function(superClass) {
|
|
|
31660
31857
|
return this.finishNode(node, "EnumDeclaration");
|
|
31661
31858
|
}
|
|
31662
31859
|
},
|
|
31860
|
+
{
|
|
31861
|
+
key: "jsxParseOpeningElementAfterName",
|
|
31862
|
+
value: function jsxParseOpeningElementAfterName(node) {
|
|
31863
|
+
if (this.shouldParseTypes()) {
|
|
31864
|
+
if (this.match(47) || this.match(51)) {
|
|
31865
|
+
node.typeArguments = this.flowParseTypeParameterInstantiationInExpression();
|
|
31866
|
+
}
|
|
31867
|
+
}
|
|
31868
|
+
return _get(_get_prototype_of(FlowParserMixin.prototype), "jsxParseOpeningElementAfterName", this).call(this, node);
|
|
31869
|
+
}
|
|
31870
|
+
},
|
|
31663
31871
|
{
|
|
31664
31872
|
key: "isLookaheadToken_lt",
|
|
31665
31873
|
value: function isLookaheadToken_lt() {
|
|
@@ -31671,6 +31879,31 @@ var flow = function(superClass) {
|
|
|
31671
31879
|
return false;
|
|
31672
31880
|
}
|
|
31673
31881
|
},
|
|
31882
|
+
{
|
|
31883
|
+
key: "reScan_lt_gt",
|
|
31884
|
+
value: function reScan_lt_gt() {
|
|
31885
|
+
var type = this.state.type;
|
|
31886
|
+
if (type === 47) {
|
|
31887
|
+
this.state.pos -= 1;
|
|
31888
|
+
this.readToken_lt();
|
|
31889
|
+
} else if (type === 48) {
|
|
31890
|
+
this.state.pos -= 1;
|
|
31891
|
+
this.readToken_gt();
|
|
31892
|
+
}
|
|
31893
|
+
}
|
|
31894
|
+
},
|
|
31895
|
+
{
|
|
31896
|
+
key: "reScan_lt",
|
|
31897
|
+
value: function reScan_lt() {
|
|
31898
|
+
var type = this.state.type;
|
|
31899
|
+
if (type === 51) {
|
|
31900
|
+
this.state.pos -= 2;
|
|
31901
|
+
this.finishOp(47, 1);
|
|
31902
|
+
return 47;
|
|
31903
|
+
}
|
|
31904
|
+
return type;
|
|
31905
|
+
}
|
|
31906
|
+
},
|
|
31674
31907
|
{
|
|
31675
31908
|
key: "maybeUnwrapTypeCastExpression",
|
|
31676
31909
|
value: function maybeUnwrapTypeCastExpression(node) {
|
|
@@ -33509,8 +33742,14 @@ var typescript = function(superClass) {
|
|
|
33509
33742
|
this.expect(10);
|
|
33510
33743
|
if (!this.match(134)) {
|
|
33511
33744
|
this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
|
|
33745
|
+
{
|
|
33746
|
+
node.argument = this.tsParseNonConditionalType();
|
|
33747
|
+
}
|
|
33748
|
+
} else {
|
|
33749
|
+
{
|
|
33750
|
+
node.argument = this.tsParseLiteralTypeNode();
|
|
33751
|
+
}
|
|
33512
33752
|
}
|
|
33513
|
-
node.argument = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseExprAtom", this).call(this);
|
|
33514
33753
|
if (this.eat(12) && !this.match(11)) {
|
|
33515
33754
|
node.options = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeAssignAllowIn", this).call(this);
|
|
33516
33755
|
this.eat(12);
|
|
@@ -33522,7 +33761,9 @@ var typescript = function(superClass) {
|
|
|
33522
33761
|
node.qualifier = this.tsParseEntityName();
|
|
33523
33762
|
}
|
|
33524
33763
|
if (this.match(47)) {
|
|
33525
|
-
|
|
33764
|
+
{
|
|
33765
|
+
node.typeArguments = this.tsParseTypeArguments();
|
|
33766
|
+
}
|
|
33526
33767
|
}
|
|
33527
33768
|
return this.finishNode(node, "TSImportType");
|
|
33528
33769
|
}
|
|
@@ -33584,7 +33825,9 @@ var typescript = function(superClass) {
|
|
|
33584
33825
|
node.exprName = this.tsParseEntityName();
|
|
33585
33826
|
}
|
|
33586
33827
|
if (!this.hasPrecedingLineBreak() && this.match(47)) {
|
|
33587
|
-
|
|
33828
|
+
{
|
|
33829
|
+
node.typeArguments = this.tsParseTypeArguments();
|
|
33830
|
+
}
|
|
33588
33831
|
}
|
|
33589
33832
|
return this.finishNode(node, "TSTypeQuery");
|
|
33590
33833
|
}
|
|
@@ -34084,7 +34327,7 @@ var typescript = function(superClass) {
|
|
|
34084
34327
|
return this.tsParseTupleType();
|
|
34085
34328
|
case 10:
|
|
34086
34329
|
{
|
|
34087
|
-
if (!this.
|
|
34330
|
+
if (!(this.optionFlags & 512)) {
|
|
34088
34331
|
var startLoc = this.state.startLoc;
|
|
34089
34332
|
this.next();
|
|
34090
34333
|
var type = this.tsParseType();
|
|
@@ -34466,10 +34709,12 @@ var typescript = function(superClass) {
|
|
|
34466
34709
|
var delimitedList = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
34467
34710
|
var node = _this.startNode();
|
|
34468
34711
|
node.expression = _this.tsParseEntityName();
|
|
34469
|
-
|
|
34470
|
-
|
|
34712
|
+
{
|
|
34713
|
+
if (_this.match(47)) {
|
|
34714
|
+
node.typeArguments = _this.tsParseTypeArguments();
|
|
34715
|
+
}
|
|
34716
|
+
return _this.finishNode(node, token === "extends" ? "TSInterfaceHeritage" : "TSClassImplements");
|
|
34471
34717
|
}
|
|
34472
|
-
return _this.finishNode(node, token === "extends" ? "TSInterfaceHeritage" : "TSClassImplements");
|
|
34473
34718
|
});
|
|
34474
34719
|
if (!delimitedList.length) {
|
|
34475
34720
|
this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, {
|
|
@@ -34524,16 +34769,20 @@ var typescript = function(superClass) {
|
|
|
34524
34769
|
}
|
|
34525
34770
|
},
|
|
34526
34771
|
{
|
|
34527
|
-
key: "
|
|
34528
|
-
value: function
|
|
34529
|
-
|
|
34530
|
-
|
|
34531
|
-
|
|
34532
|
-
|
|
34533
|
-
|
|
34772
|
+
key: "tsInTopLevelContext",
|
|
34773
|
+
value: function tsInTopLevelContext(cb) {
|
|
34774
|
+
if (this.curContext() !== types.brace) {
|
|
34775
|
+
var oldContext = this.state.context;
|
|
34776
|
+
this.state.context = [
|
|
34777
|
+
oldContext[0]
|
|
34778
|
+
];
|
|
34779
|
+
try {
|
|
34780
|
+
return cb();
|
|
34781
|
+
} finally{
|
|
34782
|
+
this.state.context = oldContext;
|
|
34783
|
+
}
|
|
34784
|
+
} else {
|
|
34534
34785
|
return cb();
|
|
34535
|
-
} finally{
|
|
34536
|
-
this.state.context = oldContext;
|
|
34537
34786
|
}
|
|
34538
34787
|
}
|
|
34539
34788
|
},
|
|
@@ -34621,10 +34870,20 @@ var typescript = function(superClass) {
|
|
|
34621
34870
|
this.expectContextual(126);
|
|
34622
34871
|
node.id = this.parseIdentifier();
|
|
34623
34872
|
this.checkIdentifier(node.id, node.const ? 8971 : 8459);
|
|
34873
|
+
{
|
|
34874
|
+
node.body = this.tsParseEnumBody();
|
|
34875
|
+
}
|
|
34876
|
+
return this.finishNode(node, "TSEnumDeclaration");
|
|
34877
|
+
}
|
|
34878
|
+
},
|
|
34879
|
+
{
|
|
34880
|
+
key: "tsParseEnumBody",
|
|
34881
|
+
value: function tsParseEnumBody() {
|
|
34882
|
+
var node = this.startNode();
|
|
34624
34883
|
this.expect(5);
|
|
34625
34884
|
node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
|
|
34626
34885
|
this.expect(8);
|
|
34627
|
-
return this.finishNode(node, "
|
|
34886
|
+
return this.finishNode(node, "TSEnumBody");
|
|
34628
34887
|
}
|
|
34629
34888
|
},
|
|
34630
34889
|
{
|
|
@@ -34920,7 +35179,7 @@ var typescript = function(superClass) {
|
|
|
34920
35179
|
var _this = this;
|
|
34921
35180
|
var node = this.startNode();
|
|
34922
35181
|
node.params = this.tsInType(function() {
|
|
34923
|
-
return _this.
|
|
35182
|
+
return _this.tsInTopLevelContext(function() {
|
|
34924
35183
|
_this.expect(47);
|
|
34925
35184
|
return _this.tsParseDelimitedList("TypeParametersOrArguments", _this.tsParseType.bind(_this));
|
|
34926
35185
|
});
|
|
@@ -35128,7 +35387,9 @@ var typescript = function(superClass) {
|
|
|
35128
35387
|
}
|
|
35129
35388
|
if (tokenIsTemplate(_this.state.type)) {
|
|
35130
35389
|
var result2 = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseTaggedTemplateExpression", _this).call(_this, base, startLoc, state);
|
|
35131
|
-
|
|
35390
|
+
{
|
|
35391
|
+
result2.typeArguments = typeArguments;
|
|
35392
|
+
}
|
|
35132
35393
|
return result2;
|
|
35133
35394
|
}
|
|
35134
35395
|
if (!noCalls && _this.eat(10)) {
|
|
@@ -35136,7 +35397,9 @@ var typescript = function(superClass) {
|
|
|
35136
35397
|
node2.callee = base;
|
|
35137
35398
|
node2.arguments = _this.parseCallExpressionArguments(11);
|
|
35138
35399
|
_this.tsCheckForInvalidTypeCasts(node2.arguments);
|
|
35139
|
-
|
|
35400
|
+
{
|
|
35401
|
+
node2.typeArguments = typeArguments;
|
|
35402
|
+
}
|
|
35140
35403
|
if (state.optionalChainMember) {
|
|
35141
35404
|
node2.optional = isOptionalCall;
|
|
35142
35405
|
}
|
|
@@ -35148,7 +35411,9 @@ var typescript = function(superClass) {
|
|
|
35148
35411
|
}
|
|
35149
35412
|
var node = _this.startNodeAt(startLoc);
|
|
35150
35413
|
node.expression = base;
|
|
35151
|
-
|
|
35414
|
+
{
|
|
35415
|
+
node.typeArguments = typeArguments;
|
|
35416
|
+
}
|
|
35152
35417
|
return _this.finishNode(node, "TSInstantiationExpression");
|
|
35153
35418
|
});
|
|
35154
35419
|
if (missingParenErrorLoc) {
|
|
@@ -35171,7 +35436,9 @@ var typescript = function(superClass) {
|
|
|
35171
35436
|
_get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseNewCallee", this).call(this, node);
|
|
35172
35437
|
var callee = node.callee;
|
|
35173
35438
|
if (callee.type === "TSInstantiationExpression" && !((_callee_extra = callee.extra) === null || _callee_extra === void 0 ? void 0 : _callee_extra.parenthesized)) {
|
|
35174
|
-
|
|
35439
|
+
{
|
|
35440
|
+
node.typeArguments = callee.typeArguments;
|
|
35441
|
+
}
|
|
35175
35442
|
node.callee = callee.expression;
|
|
35176
35443
|
}
|
|
35177
35444
|
}
|
|
@@ -35957,17 +36224,19 @@ var typescript = function(superClass) {
|
|
|
35957
36224
|
},
|
|
35958
36225
|
{
|
|
35959
36226
|
key: "parseMaybeDecoratorArguments",
|
|
35960
|
-
value: function parseMaybeDecoratorArguments(expr) {
|
|
36227
|
+
value: function parseMaybeDecoratorArguments(expr, startLoc) {
|
|
35961
36228
|
if (this.match(47) || this.match(51)) {
|
|
35962
36229
|
var typeArguments = this.tsParseTypeArgumentsInExpression();
|
|
35963
36230
|
if (this.match(10)) {
|
|
35964
|
-
var call2 = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeDecoratorArguments", this).call(this, expr);
|
|
35965
|
-
|
|
36231
|
+
var call2 = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeDecoratorArguments", this).call(this, expr, startLoc);
|
|
36232
|
+
{
|
|
36233
|
+
call2.typeArguments = typeArguments;
|
|
36234
|
+
}
|
|
35966
36235
|
return call2;
|
|
35967
36236
|
}
|
|
35968
36237
|
this.unexpected(null, 10);
|
|
35969
36238
|
}
|
|
35970
|
-
return _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeDecoratorArguments", this).call(this, expr);
|
|
36239
|
+
return _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMaybeDecoratorArguments", this).call(this, expr, startLoc);
|
|
35971
36240
|
}
|
|
35972
36241
|
},
|
|
35973
36242
|
{
|
|
@@ -36095,7 +36364,11 @@ var typescript = function(superClass) {
|
|
|
36095
36364
|
var typeArguments = this.tsTryParseAndCatch(function() {
|
|
36096
36365
|
return _this.tsParseTypeArgumentsInExpression();
|
|
36097
36366
|
});
|
|
36098
|
-
if (typeArguments)
|
|
36367
|
+
if (typeArguments) {
|
|
36368
|
+
{
|
|
36369
|
+
node.typeArguments = typeArguments;
|
|
36370
|
+
}
|
|
36371
|
+
}
|
|
36099
36372
|
}
|
|
36100
36373
|
return _get(_get_prototype_of(TypeScriptParserMixin.prototype), "jsxParseOpeningElementAfterName", this).call(this, node);
|
|
36101
36374
|
}
|
|
@@ -36170,8 +36443,9 @@ var typescript = function(superClass) {
|
|
|
36170
36443
|
value: function parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
|
|
36171
36444
|
var method = _get(_get_prototype_of(TypeScriptParserMixin.prototype), "parseMethod", this).call(this, node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
|
|
36172
36445
|
if (method.abstract) {
|
|
36173
|
-
var
|
|
36174
|
-
|
|
36446
|
+
var hasEstreePlugin = this.hasPlugin("estree");
|
|
36447
|
+
var methodFn = hasEstreePlugin ? method.value : method;
|
|
36448
|
+
if (methodFn.body) {
|
|
36175
36449
|
var key = method.key;
|
|
36176
36450
|
this.raise(TSErrors.AbstractMethodHasImplementation, method, {
|
|
36177
36451
|
methodName: key.type === "Identifier" && !method.computed ? key.name : "[".concat(this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end)), "]")
|
|
@@ -36784,71 +37058,6 @@ var mixinPlugins = {
|
|
|
36784
37058
|
placeholders: placeholders
|
|
36785
37059
|
};
|
|
36786
37060
|
var mixinPluginNames = Object.keys(mixinPlugins);
|
|
36787
|
-
function createDefaultOptions() {
|
|
36788
|
-
return {
|
|
36789
|
-
sourceType: "script",
|
|
36790
|
-
sourceFilename: void 0,
|
|
36791
|
-
startIndex: 0,
|
|
36792
|
-
startColumn: 0,
|
|
36793
|
-
startLine: 1,
|
|
36794
|
-
allowAwaitOutsideFunction: false,
|
|
36795
|
-
allowReturnOutsideFunction: false,
|
|
36796
|
-
allowNewTargetOutsideFunction: false,
|
|
36797
|
-
allowImportExportEverywhere: false,
|
|
36798
|
-
allowSuperOutsideMethod: false,
|
|
36799
|
-
allowUndeclaredExports: false,
|
|
36800
|
-
plugins: [],
|
|
36801
|
-
strictMode: null,
|
|
36802
|
-
ranges: false,
|
|
36803
|
-
tokens: false,
|
|
36804
|
-
createImportExpressions: true,
|
|
36805
|
-
createParenthesizedExpressions: false,
|
|
36806
|
-
errorRecovery: false,
|
|
36807
|
-
attachComment: true,
|
|
36808
|
-
annexB: true
|
|
36809
|
-
};
|
|
36810
|
-
}
|
|
36811
|
-
function getOptions(opts) {
|
|
36812
|
-
var options = createDefaultOptions();
|
|
36813
|
-
if (opts == null) {
|
|
36814
|
-
return options;
|
|
36815
|
-
}
|
|
36816
|
-
if (opts.annexB != null && opts.annexB !== false) {
|
|
36817
|
-
throw new Error("The `annexB` option can only be set to `false`.");
|
|
36818
|
-
}
|
|
36819
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
36820
|
-
try {
|
|
36821
|
-
for(var _iterator = Object.keys(options)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
36822
|
-
var key = _step.value;
|
|
36823
|
-
if (opts[key] != null) options[key] = opts[key];
|
|
36824
|
-
}
|
|
36825
|
-
} catch (err) {
|
|
36826
|
-
_didIteratorError = true;
|
|
36827
|
-
_iteratorError = err;
|
|
36828
|
-
} finally{
|
|
36829
|
-
try {
|
|
36830
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
36831
|
-
_iterator.return();
|
|
36832
|
-
}
|
|
36833
|
-
} finally{
|
|
36834
|
-
if (_didIteratorError) {
|
|
36835
|
-
throw _iteratorError;
|
|
36836
|
-
}
|
|
36837
|
-
}
|
|
36838
|
-
}
|
|
36839
|
-
if (options.startLine === 1) {
|
|
36840
|
-
if (opts.startIndex == null && options.startColumn > 0) {
|
|
36841
|
-
options.startIndex = options.startColumn;
|
|
36842
|
-
} else if (opts.startColumn == null && options.startIndex > 0) {
|
|
36843
|
-
options.startColumn = options.startIndex;
|
|
36844
|
-
}
|
|
36845
|
-
} else if (opts.startColumn == null || opts.startIndex == null) {
|
|
36846
|
-
{
|
|
36847
|
-
throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
|
|
36848
|
-
}
|
|
36849
|
-
}
|
|
36850
|
-
return options;
|
|
36851
|
-
}
|
|
36852
37061
|
var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
36853
37062
|
"use strict";
|
|
36854
37063
|
_inherits(ExpressionParser, LValParser);
|
|
@@ -36901,7 +37110,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
36901
37110
|
this.finalizeRemainingComments();
|
|
36902
37111
|
expr.comments = this.comments;
|
|
36903
37112
|
expr.errors = this.state.errors;
|
|
36904
|
-
if (this.
|
|
37113
|
+
if (this.optionFlags & 128) {
|
|
36905
37114
|
expr.tokens = this.tokens;
|
|
36906
37115
|
}
|
|
36907
37116
|
return expr;
|
|
@@ -37523,7 +37732,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37523
37732
|
return this.parseImportMetaProperty(node);
|
|
37524
37733
|
}
|
|
37525
37734
|
if (this.match(10)) {
|
|
37526
|
-
if (this.
|
|
37735
|
+
if (this.optionFlags & 256) {
|
|
37527
37736
|
return this.parseImportCall(node);
|
|
37528
37737
|
} else {
|
|
37529
37738
|
return this.finishNode(node, "Import");
|
|
@@ -37792,9 +38001,9 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37792
38001
|
value: function parseSuper() {
|
|
37793
38002
|
var node = this.startNode();
|
|
37794
38003
|
this.next();
|
|
37795
|
-
if (this.match(10) && !this.scope.allowDirectSuper && !this.
|
|
38004
|
+
if (this.match(10) && !this.scope.allowDirectSuper && !(this.optionFlags & 16)) {
|
|
37796
38005
|
this.raise(Errors.SuperNotAllowed, node);
|
|
37797
|
-
} else if (!this.scope.allowSuper && !this.
|
|
38006
|
+
} else if (!this.scope.allowSuper && !(this.optionFlags & 16)) {
|
|
37798
38007
|
this.raise(Errors.UnexpectedSuper, node);
|
|
37799
38008
|
}
|
|
37800
38009
|
if (!this.match(10) && !this.match(0) && !this.match(16)) {
|
|
@@ -37860,7 +38069,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
37860
38069
|
} else if (this.isContextual(105) || this.isContextual(97)) {
|
|
37861
38070
|
var isSource = this.isContextual(105);
|
|
37862
38071
|
this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation");
|
|
37863
|
-
if (!this.
|
|
38072
|
+
if (!(this.optionFlags & 256)) {
|
|
37864
38073
|
throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, {
|
|
37865
38074
|
phase: this.state.value
|
|
37866
38075
|
});
|
|
@@ -38013,7 +38222,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
38013
38222
|
{
|
|
38014
38223
|
key: "wrapParenthesis",
|
|
38015
38224
|
value: function wrapParenthesis(startLoc, expression2) {
|
|
38016
|
-
if (!this.
|
|
38225
|
+
if (!(this.optionFlags & 512)) {
|
|
38017
38226
|
this.addExtra(expression2, "parenthesized", true);
|
|
38018
38227
|
this.addExtra(expression2, "parenStart", startLoc.index);
|
|
38019
38228
|
this.takeSurroundingComments(expression2, startLoc.index, this.state.lastTokEndLoc.index);
|
|
@@ -38053,7 +38262,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
38053
38262
|
var meta = this.createIdentifier(this.startNodeAtNode(node), "new");
|
|
38054
38263
|
this.next();
|
|
38055
38264
|
var metaProp = this.parseMetaProperty(node, meta, "target");
|
|
38056
|
-
if (!this.scope.inNonArrowFunction && !this.scope.inClass && !this.
|
|
38265
|
+
if (!this.scope.inNonArrowFunction && !this.scope.inClass && !(this.optionFlags & 4)) {
|
|
38057
38266
|
this.raise(Errors.UnexpectedNewTarget, metaProp);
|
|
38058
38267
|
}
|
|
38059
38268
|
return metaProp;
|
|
@@ -38669,7 +38878,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
38669
38878
|
{
|
|
38670
38879
|
key: "recordAwaitIfAllowed",
|
|
38671
38880
|
value: function recordAwaitIfAllowed() {
|
|
38672
|
-
var isAwaitAllowed = this.prodParam.hasAwait || this.
|
|
38881
|
+
var isAwaitAllowed = this.prodParam.hasAwait || this.optionFlags & 1 && !this.scope.inFunction;
|
|
38673
38882
|
if (isAwaitAllowed && !this.scope.inFunction) {
|
|
38674
38883
|
this.state.hasTopLevelAwait = true;
|
|
38675
38884
|
}
|
|
@@ -38684,7 +38893,7 @@ var ExpressionParser = /*#__PURE__*/ function(LValParser) {
|
|
|
38684
38893
|
if (this.eat(55)) {
|
|
38685
38894
|
this.raise(Errors.ObsoleteAwaitStar, node);
|
|
38686
38895
|
}
|
|
38687
|
-
if (!this.scope.inFunction && !this.
|
|
38896
|
+
if (!this.scope.inFunction && !(this.optionFlags & 1)) {
|
|
38688
38897
|
if (this.isAmbiguousAwait()) {
|
|
38689
38898
|
this.ambiguousScriptDifferentAst = true;
|
|
38690
38899
|
} else {
|
|
@@ -38981,7 +39190,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38981
39190
|
value: function parseTopLevel(file2, program3) {
|
|
38982
39191
|
file2.program = this.parseProgram(program3);
|
|
38983
39192
|
file2.comments = this.comments;
|
|
38984
|
-
if (this.
|
|
39193
|
+
if (this.optionFlags & 128) {
|
|
38985
39194
|
file2.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex);
|
|
38986
39195
|
}
|
|
38987
39196
|
return this.finishNode(file2, "File");
|
|
@@ -38995,7 +39204,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
38995
39204
|
program3.interpreter = this.parseInterpreterDirective();
|
|
38996
39205
|
this.parseBlockBody(program3, true, true, end);
|
|
38997
39206
|
if (this.inModule) {
|
|
38998
|
-
if (!this.
|
|
39207
|
+
if (!(this.optionFlags & 32) && this.scope.undefinedExports.size > 0) {
|
|
38999
39208
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
39000
39209
|
try {
|
|
39001
39210
|
for(var _iterator = Array.from(this.scope.undefinedExports)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
@@ -39281,7 +39490,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39281
39490
|
}
|
|
39282
39491
|
case 82:
|
|
39283
39492
|
{
|
|
39284
|
-
if (!this.
|
|
39493
|
+
if (!(this.optionFlags & 8) && !topLevel) {
|
|
39285
39494
|
this.raise(Errors.UnexpectedImportExport, this.state.startLoc);
|
|
39286
39495
|
}
|
|
39287
39496
|
this.next();
|
|
@@ -39323,7 +39532,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39323
39532
|
{
|
|
39324
39533
|
key: "assertModuleNodeAllowed",
|
|
39325
39534
|
value: function assertModuleNodeAllowed(node) {
|
|
39326
|
-
if (!this.
|
|
39535
|
+
if (!(this.optionFlags & 8) && !this.inModule) {
|
|
39327
39536
|
this.raise(Errors.ImportOutsideModule, node);
|
|
39328
39537
|
}
|
|
39329
39538
|
}
|
|
@@ -39339,12 +39548,13 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39339
39548
|
key: "maybeTakeDecorators",
|
|
39340
39549
|
value: function maybeTakeDecorators(maybeDecorators, classNode, exportNode) {
|
|
39341
39550
|
if (maybeDecorators) {
|
|
39342
|
-
|
|
39343
|
-
|
|
39551
|
+
var _classNode_decorators;
|
|
39552
|
+
if ((_classNode_decorators = classNode.decorators) === null || _classNode_decorators === void 0 ? void 0 : _classNode_decorators.length) {
|
|
39553
|
+
var _classNode_decorators1;
|
|
39344
39554
|
if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") {
|
|
39345
39555
|
this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]);
|
|
39346
39556
|
}
|
|
39347
|
-
(
|
|
39557
|
+
(_classNode_decorators1 = classNode.decorators).unshift.apply(_classNode_decorators1, _to_consumable_array(maybeDecorators));
|
|
39348
39558
|
} else {
|
|
39349
39559
|
classNode.decorators = maybeDecorators;
|
|
39350
39560
|
}
|
|
@@ -39399,7 +39609,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39399
39609
|
this.expect(11);
|
|
39400
39610
|
expr = this.wrapParenthesis(startLoc2, expr);
|
|
39401
39611
|
var paramsStartLoc = this.state.startLoc;
|
|
39402
|
-
node.expression = this.parseMaybeDecoratorArguments(expr);
|
|
39612
|
+
node.expression = this.parseMaybeDecoratorArguments(expr, startLoc2);
|
|
39403
39613
|
if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) {
|
|
39404
39614
|
this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
|
|
39405
39615
|
}
|
|
@@ -39417,7 +39627,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39417
39627
|
node2.computed = false;
|
|
39418
39628
|
expr = this.finishNode(node2, "MemberExpression");
|
|
39419
39629
|
}
|
|
39420
|
-
node.expression = this.parseMaybeDecoratorArguments(expr);
|
|
39630
|
+
node.expression = this.parseMaybeDecoratorArguments(expr, startLoc);
|
|
39421
39631
|
}
|
|
39422
39632
|
} else {
|
|
39423
39633
|
node.expression = this.parseExprSubscripts();
|
|
@@ -39427,9 +39637,9 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39427
39637
|
},
|
|
39428
39638
|
{
|
|
39429
39639
|
key: "parseMaybeDecoratorArguments",
|
|
39430
|
-
value: function parseMaybeDecoratorArguments(expr) {
|
|
39640
|
+
value: function parseMaybeDecoratorArguments(expr, startLoc) {
|
|
39431
39641
|
if (this.eat(10)) {
|
|
39432
|
-
var node = this.
|
|
39642
|
+
var node = this.startNodeAt(startLoc);
|
|
39433
39643
|
node.callee = expr;
|
|
39434
39644
|
node.arguments = this.parseCallExpressionArguments(11);
|
|
39435
39645
|
this.toReferencedList(node.arguments);
|
|
@@ -39606,7 +39816,7 @@ var StatementParser = /*#__PURE__*/ function(ExpressionParser) {
|
|
|
39606
39816
|
{
|
|
39607
39817
|
key: "parseReturnStatement",
|
|
39608
39818
|
value: function parseReturnStatement(node) {
|
|
39609
|
-
if (!this.prodParam.hasReturn && !this.
|
|
39819
|
+
if (!this.prodParam.hasReturn && !(this.optionFlags & 2)) {
|
|
39610
39820
|
this.raise(Errors.IllegalReturn, this.state.startLoc);
|
|
39611
39821
|
}
|
|
39612
39822
|
this.next();
|
|
@@ -41235,6 +41445,47 @@ var Parser = /*#__PURE__*/ function(StatementParser) {
|
|
|
41235
41445
|
_this.plugins = pluginsMap;
|
|
41236
41446
|
_this.filename = options.sourceFilename;
|
|
41237
41447
|
_this.startIndex = options.startIndex;
|
|
41448
|
+
var optionFlags = 0;
|
|
41449
|
+
if (options.allowAwaitOutsideFunction) {
|
|
41450
|
+
optionFlags |= 1;
|
|
41451
|
+
}
|
|
41452
|
+
if (options.allowReturnOutsideFunction) {
|
|
41453
|
+
optionFlags |= 2;
|
|
41454
|
+
}
|
|
41455
|
+
if (options.allowImportExportEverywhere) {
|
|
41456
|
+
optionFlags |= 8;
|
|
41457
|
+
}
|
|
41458
|
+
if (options.allowSuperOutsideMethod) {
|
|
41459
|
+
optionFlags |= 16;
|
|
41460
|
+
}
|
|
41461
|
+
if (options.allowUndeclaredExports) {
|
|
41462
|
+
optionFlags |= 32;
|
|
41463
|
+
}
|
|
41464
|
+
if (options.allowNewTargetOutsideFunction) {
|
|
41465
|
+
optionFlags |= 4;
|
|
41466
|
+
}
|
|
41467
|
+
if (options.ranges) {
|
|
41468
|
+
optionFlags |= 64;
|
|
41469
|
+
}
|
|
41470
|
+
if (options.tokens) {
|
|
41471
|
+
optionFlags |= 128;
|
|
41472
|
+
}
|
|
41473
|
+
if (options.createImportExpressions) {
|
|
41474
|
+
optionFlags |= 256;
|
|
41475
|
+
}
|
|
41476
|
+
if (options.createParenthesizedExpressions) {
|
|
41477
|
+
optionFlags |= 512;
|
|
41478
|
+
}
|
|
41479
|
+
if (options.errorRecovery) {
|
|
41480
|
+
optionFlags |= 1024;
|
|
41481
|
+
}
|
|
41482
|
+
if (options.attachComment) {
|
|
41483
|
+
optionFlags |= 2048;
|
|
41484
|
+
}
|
|
41485
|
+
if (options.annexB) {
|
|
41486
|
+
optionFlags |= 4096;
|
|
41487
|
+
}
|
|
41488
|
+
_this.optionFlags = optionFlags;
|
|
41238
41489
|
return _this;
|
|
41239
41490
|
}
|
|
41240
41491
|
_create_class(Parser, [
|
|
@@ -43875,7 +44126,7 @@ function TSInferType$1(node, parent) {
|
|
|
43875
44126
|
}
|
|
43876
44127
|
function TSInstantiationExpression$1(node, parent) {
|
|
43877
44128
|
var parentType = parent.type;
|
|
43878
|
-
return (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression" || parentType === "TSInstantiationExpression") && !!parent.
|
|
44129
|
+
return (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression" || parentType === "TSInstantiationExpression") && !!parent.typeArguments;
|
|
43879
44130
|
}
|
|
43880
44131
|
function BinaryExpression(node, parent, tokenContext, inForStatementInit) {
|
|
43881
44132
|
return node.operator === "in" && inForStatementInit;
|
|
@@ -44487,7 +44738,9 @@ function childrenIterator(node) {
|
|
|
44487
44738
|
}
|
|
44488
44739
|
function TaggedTemplateExpression(node) {
|
|
44489
44740
|
this.print(node.tag);
|
|
44490
|
-
|
|
44741
|
+
{
|
|
44742
|
+
this.print(node.typeArguments);
|
|
44743
|
+
}
|
|
44491
44744
|
this.print(node.quasi);
|
|
44492
44745
|
}
|
|
44493
44746
|
function TemplateElement() {
|
|
@@ -44563,7 +44816,6 @@ function NewExpression(node, parent) {
|
|
|
44563
44816
|
return;
|
|
44564
44817
|
}
|
|
44565
44818
|
this.print(node.typeArguments);
|
|
44566
|
-
this.print(node.typeParameters);
|
|
44567
44819
|
if (node.optional) {
|
|
44568
44820
|
this.token("?.");
|
|
44569
44821
|
}
|
|
@@ -44622,7 +44874,6 @@ function OptionalMemberExpression(node) {
|
|
|
44622
44874
|
}
|
|
44623
44875
|
function OptionalCallExpression(node) {
|
|
44624
44876
|
this.print(node.callee);
|
|
44625
|
-
this.print(node.typeParameters);
|
|
44626
44877
|
if (node.optional) {
|
|
44627
44878
|
this.token("?.");
|
|
44628
44879
|
}
|
|
@@ -44636,7 +44887,6 @@ function OptionalCallExpression(node) {
|
|
|
44636
44887
|
function CallExpression(node) {
|
|
44637
44888
|
this.print(node.callee);
|
|
44638
44889
|
this.print(node.typeArguments);
|
|
44639
|
-
this.print(node.typeParameters);
|
|
44640
44890
|
this.tokenChar(40);
|
|
44641
44891
|
var exit = this.enterDelimited();
|
|
44642
44892
|
this.printList(node.arguments, this.shouldPrintTrailingComma(")"));
|
|
@@ -45779,14 +46029,6 @@ function BigIntLiteral(node) {
|
|
|
45779
46029
|
}
|
|
45780
46030
|
this.word(node.value + "n");
|
|
45781
46031
|
}
|
|
45782
|
-
function DecimalLiteral(node) {
|
|
45783
|
-
var raw = this.getPossibleRaw(node);
|
|
45784
|
-
if (!this.format.minified && raw !== void 0) {
|
|
45785
|
-
this.word(raw);
|
|
45786
|
-
return;
|
|
45787
|
-
}
|
|
45788
|
-
this.word(node.value + "m");
|
|
45789
|
-
}
|
|
45790
46032
|
var validTopicTokenSet = /* @__PURE__ */ new Set([
|
|
45791
46033
|
"^^",
|
|
45792
46034
|
"@@",
|
|
@@ -46542,7 +46784,9 @@ function spaceSeparator() {
|
|
|
46542
46784
|
function JSXOpeningElement(node) {
|
|
46543
46785
|
this.tokenChar(60);
|
|
46544
46786
|
this.print(node.name);
|
|
46545
|
-
|
|
46787
|
+
{
|
|
46788
|
+
this.print(node.typeArguments);
|
|
46789
|
+
}
|
|
46546
46790
|
if (node.attributes.length > 0) {
|
|
46547
46791
|
this.space();
|
|
46548
46792
|
this.printJoin(node.attributes, void 0, void 0, spaceSeparator);
|
|
@@ -46820,8 +47064,9 @@ function TSTypeQuery(node) {
|
|
|
46820
47064
|
this.word("typeof");
|
|
46821
47065
|
this.space();
|
|
46822
47066
|
this.print(node.exprName);
|
|
46823
|
-
|
|
46824
|
-
|
|
47067
|
+
var typeArguments = node.typeArguments;
|
|
47068
|
+
if (typeArguments) {
|
|
47069
|
+
this.print(typeArguments);
|
|
46825
47070
|
}
|
|
46826
47071
|
}
|
|
46827
47072
|
function TSTypeLiteral(node) {
|
|
@@ -46959,7 +47204,7 @@ function TSLiteralType(node) {
|
|
|
46959
47204
|
}
|
|
46960
47205
|
function TSClassImplements(node) {
|
|
46961
47206
|
this.print(node.expression);
|
|
46962
|
-
this.print(node.
|
|
47207
|
+
this.print(node.typeArguments);
|
|
46963
47208
|
}
|
|
46964
47209
|
function TSInterfaceDeclaration(node) {
|
|
46965
47210
|
var declare = node.declare, id = node.id, typeParameters = node.typeParameters, extendz = node.extends, body = node.body;
|
|
@@ -47020,11 +47265,12 @@ function TSTypeAssertion(node) {
|
|
|
47020
47265
|
}
|
|
47021
47266
|
function TSInstantiationExpression(node) {
|
|
47022
47267
|
this.print(node.expression);
|
|
47023
|
-
|
|
47268
|
+
{
|
|
47269
|
+
this.print(node.typeArguments);
|
|
47270
|
+
}
|
|
47024
47271
|
}
|
|
47025
47272
|
function TSEnumDeclaration(node) {
|
|
47026
|
-
var
|
|
47027
|
-
var declare = node.declare, isConst = node.const, id = node.id, members = node.members;
|
|
47273
|
+
var declare = node.declare, isConst = node.const, id = node.id;
|
|
47028
47274
|
if (declare) {
|
|
47029
47275
|
this.word("declare");
|
|
47030
47276
|
this.space();
|
|
@@ -47037,9 +47283,15 @@ function TSEnumDeclaration(node) {
|
|
|
47037
47283
|
this.space();
|
|
47038
47284
|
this.print(id);
|
|
47039
47285
|
this.space();
|
|
47286
|
+
{
|
|
47287
|
+
this.print(node.body);
|
|
47288
|
+
}
|
|
47289
|
+
}
|
|
47290
|
+
function TSEnumBody(node) {
|
|
47291
|
+
var _this = this;
|
|
47040
47292
|
printBraced(this, node, function() {
|
|
47041
47293
|
var _this_shouldPrintTrailingComma;
|
|
47042
|
-
return _this.printList(members, (_this_shouldPrintTrailingComma = _this.shouldPrintTrailingComma("}")) !== null && _this_shouldPrintTrailingComma !== void 0 ? _this_shouldPrintTrailingComma :
|
|
47294
|
+
return _this.printList(node.members, (_this_shouldPrintTrailingComma = _this.shouldPrintTrailingComma("}")) !== null && _this_shouldPrintTrailingComma !== void 0 ? _this_shouldPrintTrailingComma : false, true, true);
|
|
47043
47295
|
});
|
|
47044
47296
|
}
|
|
47045
47297
|
function TSEnumMember(node) {
|
|
@@ -47079,17 +47331,22 @@ function TSModuleBlock(node) {
|
|
|
47079
47331
|
});
|
|
47080
47332
|
}
|
|
47081
47333
|
function TSImportType(node) {
|
|
47082
|
-
var argument = node.argument, qualifier = node.qualifier,
|
|
47334
|
+
var argument = node.argument, qualifier = node.qualifier, options = node.options;
|
|
47083
47335
|
this.word("import");
|
|
47084
47336
|
this.tokenChar(40);
|
|
47085
47337
|
this.print(argument);
|
|
47338
|
+
if (options) {
|
|
47339
|
+
this.tokenChar(44);
|
|
47340
|
+
this.print(options);
|
|
47341
|
+
}
|
|
47086
47342
|
this.tokenChar(41);
|
|
47087
47343
|
if (qualifier) {
|
|
47088
47344
|
this.tokenChar(46);
|
|
47089
47345
|
this.print(qualifier);
|
|
47090
47346
|
}
|
|
47091
|
-
|
|
47092
|
-
|
|
47347
|
+
var typeArguments = node.typeArguments;
|
|
47348
|
+
if (typeArguments) {
|
|
47349
|
+
this.print(typeArguments);
|
|
47093
47350
|
}
|
|
47094
47351
|
}
|
|
47095
47352
|
function TSImportEqualsDeclaration(node) {
|
|
@@ -47252,7 +47509,6 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
47252
47509
|
ConditionalExpression: ConditionalExpression,
|
|
47253
47510
|
ContinueStatement: ContinueStatement,
|
|
47254
47511
|
DebuggerStatement: DebuggerStatement,
|
|
47255
|
-
DecimalLiteral: DecimalLiteral,
|
|
47256
47512
|
DeclareClass: DeclareClass,
|
|
47257
47513
|
DeclareExportAllDeclaration: DeclareExportAllDeclaration,
|
|
47258
47514
|
DeclareExportDeclaration: DeclareExportDeclaration,
|
|
@@ -47389,10 +47645,10 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
47389
47645
|
TSConstructorType: TSConstructorType,
|
|
47390
47646
|
TSDeclareFunction: TSDeclareFunction,
|
|
47391
47647
|
TSDeclareMethod: TSDeclareMethod,
|
|
47648
|
+
TSEnumBody: TSEnumBody,
|
|
47392
47649
|
TSEnumDeclaration: TSEnumDeclaration,
|
|
47393
47650
|
TSEnumMember: TSEnumMember,
|
|
47394
47651
|
TSExportAssignment: TSExportAssignment,
|
|
47395
|
-
TSExpressionWithTypeArguments: TSClassImplements,
|
|
47396
47652
|
TSExternalModuleReference: TSExternalModuleReference,
|
|
47397
47653
|
TSFunctionType: TSFunctionType,
|
|
47398
47654
|
TSImportEqualsDeclaration: TSImportEqualsDeclaration,
|
|
@@ -47490,7 +47746,7 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
47490
47746
|
tsPrintPropertyOrMethodName: tsPrintPropertyOrMethodName,
|
|
47491
47747
|
tsPrintSignatureDeclarationBase: tsPrintSignatureDeclarationBase
|
|
47492
47748
|
});
|
|
47493
|
-
var isExpression2 = lib_exports.isExpression, isFunction3 = lib_exports.isFunction, isStatement3 = lib_exports.isStatement, isClassBody2 = lib_exports.isClassBody, isTSInterfaceBody2 = lib_exports.isTSInterfaceBody,
|
|
47749
|
+
var isExpression2 = lib_exports.isExpression, isFunction3 = lib_exports.isFunction, isStatement3 = lib_exports.isStatement, isClassBody2 = lib_exports.isClassBody, isTSInterfaceBody2 = lib_exports.isTSInterfaceBody, isTSEnumMember2 = lib_exports.isTSEnumMember;
|
|
47494
47750
|
var SCIENTIFIC_NOTATION = /e/i;
|
|
47495
47751
|
var ZERO_DECIMAL_INTEGER = /\.0+$/;
|
|
47496
47752
|
var HAS_NEWLINE = /[\n\r\u2028\u2029]/;
|
|
@@ -48376,7 +48632,7 @@ var Printer = /*#__PURE__*/ function() {
|
|
|
48376
48632
|
}
|
|
48377
48633
|
if (len === 1) {
|
|
48378
48634
|
var singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value);
|
|
48379
|
-
var shouldSkipNewline = singleLine && !isStatement3(node) && !isClassBody2(parent) && !isTSInterfaceBody2(parent) && !
|
|
48635
|
+
var shouldSkipNewline = singleLine && !isStatement3(node) && !isClassBody2(parent) && !isTSInterfaceBody2(parent) && !isTSEnumMember2(node);
|
|
48380
48636
|
if (type === 0) {
|
|
48381
48637
|
this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction3(parent, {
|
|
48382
48638
|
body: node
|
|
@@ -48897,7 +49153,7 @@ function verify$1(visitor) {
|
|
|
48897
49153
|
}
|
|
48898
49154
|
if (shouldIgnoreKey(nodeType)) continue;
|
|
48899
49155
|
if (!TYPES2.includes(nodeType)) {
|
|
48900
|
-
throw new Error("You gave us a visitor for the node type ".concat(nodeType, " but it's not a valid type in @babel/traverse ", "8.0.0-alpha.
|
|
49156
|
+
throw new Error("You gave us a visitor for the node type ".concat(nodeType, " but it's not a valid type in @babel/traverse ", "8.0.0-alpha.15"));
|
|
48901
49157
|
}
|
|
48902
49158
|
var visitors2 = visitor[nodeType];
|
|
48903
49159
|
if ((typeof visitors2 === "undefined" ? "undefined" : _type_of(visitors2)) === "object") {
|