@putout/babel 5.0.5 → 5.0.6
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 +2 -0
- package/bundle/index.js +260 -428
- package/bundle/metafile-cjs.json +1 -1
- package/package.json +1 -1
package/bundle/index.js
CHANGED
|
@@ -8125,7 +8125,8 @@ var functionTypeAnnotationCommon = () => ({
|
|
|
8125
8125
|
},
|
|
8126
8126
|
});
|
|
8127
8127
|
|
|
8128
|
-
var functionDeclarationCommon = () =>
|
|
8128
|
+
var functionDeclarationCommon = () => ({
|
|
8129
|
+
...functionCommon(),
|
|
8129
8130
|
declare: {
|
|
8130
8131
|
validate: assertValueType('boolean'),
|
|
8131
8132
|
optional: true,
|
|
@@ -8152,7 +8153,9 @@ defineType$4('FunctionDeclaration', {
|
|
|
8152
8153
|
'returnType',
|
|
8153
8154
|
'body',
|
|
8154
8155
|
],
|
|
8155
|
-
fields:
|
|
8156
|
+
fields: {
|
|
8157
|
+
...functionDeclarationCommon(),
|
|
8158
|
+
...functionTypeAnnotationCommon(),
|
|
8156
8159
|
body: {
|
|
8157
8160
|
validate: assertNodeType('BlockStatement'),
|
|
8158
8161
|
},
|
|
@@ -8160,7 +8163,7 @@ defineType$4('FunctionDeclaration', {
|
|
|
8160
8163
|
validate: assertNodeType('DeclaredPredicate', 'InferredPredicate'),
|
|
8161
8164
|
optional: true,
|
|
8162
8165
|
},
|
|
8163
|
-
}
|
|
8166
|
+
},
|
|
8164
8167
|
aliases: [
|
|
8165
8168
|
'Scopable',
|
|
8166
8169
|
'Function',
|
|
@@ -8190,7 +8193,9 @@ defineType$4('FunctionExpression', {
|
|
|
8190
8193
|
'Expression',
|
|
8191
8194
|
'Pureish',
|
|
8192
8195
|
],
|
|
8193
|
-
fields:
|
|
8196
|
+
fields: {
|
|
8197
|
+
...functionCommon(),
|
|
8198
|
+
...functionTypeAnnotationCommon(),
|
|
8194
8199
|
id: {
|
|
8195
8200
|
validate: assertNodeType('Identifier'),
|
|
8196
8201
|
optional: true,
|
|
@@ -8202,7 +8207,7 @@ defineType$4('FunctionExpression', {
|
|
|
8202
8207
|
validate: assertNodeType('DeclaredPredicate', 'InferredPredicate'),
|
|
8203
8208
|
optional: true,
|
|
8204
8209
|
},
|
|
8205
|
-
}
|
|
8210
|
+
},
|
|
8206
8211
|
});
|
|
8207
8212
|
var patternLikeCommon = () => ({
|
|
8208
8213
|
typeAnnotation: {
|
|
@@ -8229,7 +8234,8 @@ defineType$4('Identifier', {
|
|
|
8229
8234
|
'LVal',
|
|
8230
8235
|
'TSEntityName',
|
|
8231
8236
|
],
|
|
8232
|
-
fields:
|
|
8237
|
+
fields: {
|
|
8238
|
+
...patternLikeCommon(),
|
|
8233
8239
|
name: {
|
|
8234
8240
|
validate: chain(assertValueType('string'), Object.assign(function(node, key, val) {
|
|
8235
8241
|
if (!isValidIdentifier(val, false)) {
|
|
@@ -8239,7 +8245,7 @@ defineType$4('Identifier', {
|
|
|
8239
8245
|
type: 'string',
|
|
8240
8246
|
})),
|
|
8241
8247
|
},
|
|
8242
|
-
}
|
|
8248
|
+
},
|
|
8243
8249
|
validate: function(parent, key, node) {
|
|
8244
8250
|
const match = /\.(\w+)$/.exec(key.toString());
|
|
8245
8251
|
|
|
@@ -8520,7 +8526,7 @@ defineType$4('ObjectExpression', {
|
|
|
8520
8526
|
properties: validateArrayOfType('ObjectMethod', 'ObjectProperty', 'SpreadElement'),
|
|
8521
8527
|
},
|
|
8522
8528
|
});
|
|
8523
|
-
defineType$4('ObjectMethod',
|
|
8529
|
+
defineType$4('ObjectMethod', {
|
|
8524
8530
|
builder: [
|
|
8525
8531
|
'kind',
|
|
8526
8532
|
'key',
|
|
@@ -8538,8 +8544,10 @@ defineType$4('ObjectMethod', Object.assign({
|
|
|
8538
8544
|
'returnType',
|
|
8539
8545
|
'body',
|
|
8540
8546
|
],
|
|
8541
|
-
|
|
8542
|
-
fields:
|
|
8547
|
+
...classMethodOrPropertyUnionShapeCommon(),
|
|
8548
|
+
fields: {
|
|
8549
|
+
...functionCommon(),
|
|
8550
|
+
...functionTypeAnnotationCommon(),
|
|
8543
8551
|
kind: {
|
|
8544
8552
|
validate: assertOneOf('method', 'get', 'set'),
|
|
8545
8553
|
},
|
|
@@ -8572,7 +8580,7 @@ defineType$4('ObjectMethod', Object.assign({
|
|
|
8572
8580
|
body: {
|
|
8573
8581
|
validate: assertNodeType('BlockStatement'),
|
|
8574
8582
|
},
|
|
8575
|
-
}
|
|
8583
|
+
},
|
|
8576
8584
|
aliases: [
|
|
8577
8585
|
'UserWhitespacable',
|
|
8578
8586
|
'Function',
|
|
@@ -8582,7 +8590,7 @@ defineType$4('ObjectMethod', Object.assign({
|
|
|
8582
8590
|
'Method',
|
|
8583
8591
|
'ObjectMember',
|
|
8584
8592
|
],
|
|
8585
|
-
})
|
|
8593
|
+
});
|
|
8586
8594
|
defineType$4('ObjectProperty', {
|
|
8587
8595
|
builder: [
|
|
8588
8596
|
'key',
|
|
@@ -8686,11 +8694,12 @@ defineType$4('RestElement', {
|
|
|
8686
8694
|
builder: ['argument'],
|
|
8687
8695
|
aliases: ['FunctionParameter', 'PatternLike'],
|
|
8688
8696
|
deprecatedAlias: 'RestProperty',
|
|
8689
|
-
fields:
|
|
8697
|
+
fields: {
|
|
8698
|
+
...patternLikeCommon(),
|
|
8690
8699
|
argument: {
|
|
8691
8700
|
validate: assertNodeType('Identifier', 'ArrayPattern', 'ObjectPattern', 'MemberExpression', 'TSAsExpression', 'TSSatisfiesExpression', 'TSTypeAssertion', 'TSNonNullExpression'),
|
|
8692
8701
|
},
|
|
8693
|
-
}
|
|
8702
|
+
},
|
|
8694
8703
|
validate: function(parent, key) {
|
|
8695
8704
|
const match = /(\w+)\[(\d+)\]/.exec(key.toString());
|
|
8696
8705
|
|
|
@@ -8945,7 +8954,8 @@ defineType$4('AssignmentPattern', {
|
|
|
8945
8954
|
'Pattern',
|
|
8946
8955
|
'PatternLike',
|
|
8947
8956
|
],
|
|
8948
|
-
fields:
|
|
8957
|
+
fields: {
|
|
8958
|
+
...patternLikeCommon(),
|
|
8949
8959
|
left: {
|
|
8950
8960
|
validate: assertNodeType('Identifier', 'ObjectPattern', 'ArrayPattern', 'MemberExpression', 'TSAsExpression', 'TSSatisfiesExpression', 'TSTypeAssertion', 'TSNonNullExpression'),
|
|
8951
8961
|
},
|
|
@@ -8956,7 +8966,7 @@ defineType$4('AssignmentPattern', {
|
|
|
8956
8966
|
validate: arrayOfType('Decorator'),
|
|
8957
8967
|
optional: true,
|
|
8958
8968
|
},
|
|
8959
|
-
}
|
|
8969
|
+
},
|
|
8960
8970
|
});
|
|
8961
8971
|
defineType$4('ArrayPattern', {
|
|
8962
8972
|
visitor: ['elements', 'typeAnnotation'],
|
|
@@ -8967,11 +8977,12 @@ defineType$4('ArrayPattern', {
|
|
|
8967
8977
|
'PatternLike',
|
|
8968
8978
|
'LVal',
|
|
8969
8979
|
],
|
|
8970
|
-
fields:
|
|
8980
|
+
fields: {
|
|
8981
|
+
...patternLikeCommon(),
|
|
8971
8982
|
elements: {
|
|
8972
8983
|
validate: chain(assertValueType('array'), assertEach(assertNodeOrValueType('null', 'PatternLike'))),
|
|
8973
8984
|
},
|
|
8974
|
-
}
|
|
8985
|
+
},
|
|
8975
8986
|
});
|
|
8976
8987
|
defineType$4('ArrowFunctionExpression', {
|
|
8977
8988
|
builder: [
|
|
@@ -8994,7 +9005,9 @@ defineType$4('ArrowFunctionExpression', {
|
|
|
8994
9005
|
'Expression',
|
|
8995
9006
|
'Pureish',
|
|
8996
9007
|
],
|
|
8997
|
-
fields:
|
|
9008
|
+
fields: {
|
|
9009
|
+
...functionCommon(),
|
|
9010
|
+
...functionTypeAnnotationCommon(),
|
|
8998
9011
|
expression: {
|
|
8999
9012
|
validate: assertValueType('boolean'),
|
|
9000
9013
|
},
|
|
@@ -9005,7 +9018,7 @@ defineType$4('ArrowFunctionExpression', {
|
|
|
9005
9018
|
validate: assertNodeType('DeclaredPredicate', 'InferredPredicate'),
|
|
9006
9019
|
optional: true,
|
|
9007
9020
|
},
|
|
9008
|
-
}
|
|
9021
|
+
},
|
|
9009
9022
|
});
|
|
9010
9023
|
defineType$4('ClassBody', {
|
|
9011
9024
|
visitor: ['body'],
|
|
@@ -9148,12 +9161,13 @@ defineType$4('ExportAllDeclaration', {
|
|
|
9148
9161
|
'ImportOrExportDeclaration',
|
|
9149
9162
|
'ExportDeclaration',
|
|
9150
9163
|
],
|
|
9151
|
-
fields:
|
|
9164
|
+
fields: {
|
|
9152
9165
|
source: {
|
|
9153
9166
|
validate: assertNodeType('StringLiteral'),
|
|
9154
9167
|
},
|
|
9155
9168
|
exportKind: validateOptional(assertOneOf('type', 'value')),
|
|
9156
|
-
|
|
9169
|
+
...importAttributes,
|
|
9170
|
+
},
|
|
9157
9171
|
});
|
|
9158
9172
|
defineType$4('ExportDefaultDeclaration', {
|
|
9159
9173
|
visitor: ['declaration'],
|
|
@@ -9186,7 +9200,7 @@ defineType$4('ExportNamedDeclaration', {
|
|
|
9186
9200
|
'ImportOrExportDeclaration',
|
|
9187
9201
|
'ExportDeclaration',
|
|
9188
9202
|
],
|
|
9189
|
-
fields:
|
|
9203
|
+
fields: {
|
|
9190
9204
|
declaration: {
|
|
9191
9205
|
optional: true,
|
|
9192
9206
|
validate: chain(assertNodeType('Declaration'), Object.assign(function(node, key, val) {
|
|
@@ -9201,7 +9215,7 @@ defineType$4('ExportNamedDeclaration', {
|
|
|
9201
9215
|
oneOfNodeTypes: ['Declaration'],
|
|
9202
9216
|
})),
|
|
9203
9217
|
},
|
|
9204
|
-
|
|
9218
|
+
...importAttributes,
|
|
9205
9219
|
specifiers: {
|
|
9206
9220
|
default: [],
|
|
9207
9221
|
validate: arrayOf((function() {
|
|
@@ -9225,7 +9239,7 @@ defineType$4('ExportNamedDeclaration', {
|
|
|
9225
9239
|
optional: true,
|
|
9226
9240
|
},
|
|
9227
9241
|
exportKind: validateOptional(assertOneOf('type', 'value')),
|
|
9228
|
-
}
|
|
9242
|
+
},
|
|
9229
9243
|
});
|
|
9230
9244
|
defineType$4('ExportSpecifier', {
|
|
9231
9245
|
visitor: ['local', 'exported'],
|
|
@@ -9313,7 +9327,8 @@ defineType$4('ImportDeclaration', {
|
|
|
9313
9327
|
'Declaration',
|
|
9314
9328
|
'ImportOrExportDeclaration',
|
|
9315
9329
|
],
|
|
9316
|
-
fields:
|
|
9330
|
+
fields: {
|
|
9331
|
+
...importAttributes,
|
|
9317
9332
|
module: {
|
|
9318
9333
|
optional: true,
|
|
9319
9334
|
validate: assertValueType('boolean'),
|
|
@@ -9330,7 +9345,7 @@ defineType$4('ImportDeclaration', {
|
|
|
9330
9345
|
validate: assertOneOf('type', 'typeof', 'value'),
|
|
9331
9346
|
optional: true,
|
|
9332
9347
|
},
|
|
9333
|
-
}
|
|
9348
|
+
},
|
|
9334
9349
|
});
|
|
9335
9350
|
defineType$4('ImportDefaultSpecifier', {
|
|
9336
9351
|
visitor: ['local'],
|
|
@@ -9453,7 +9468,9 @@ var classMethodOrPropertyCommon = () => ({
|
|
|
9453
9468
|
},
|
|
9454
9469
|
});
|
|
9455
9470
|
|
|
9456
|
-
var classMethodOrDeclareMethodCommon = () =>
|
|
9471
|
+
var classMethodOrDeclareMethodCommon = () => ({
|
|
9472
|
+
...functionCommon(),
|
|
9473
|
+
...classMethodOrPropertyCommon(),
|
|
9457
9474
|
params: validateArrayOfType('FunctionParameter', 'TSParameterProperty'),
|
|
9458
9475
|
kind: {
|
|
9459
9476
|
validate: assertOneOf('get', 'set', 'method', 'constructor'),
|
|
@@ -9469,7 +9486,7 @@ var classMethodOrDeclareMethodCommon = () => Object.assign({}, functionCommon(),
|
|
|
9469
9486
|
},
|
|
9470
9487
|
});
|
|
9471
9488
|
|
|
9472
|
-
defineType$4('ClassMethod',
|
|
9489
|
+
defineType$4('ClassMethod', {
|
|
9473
9490
|
aliases: [
|
|
9474
9491
|
'Function',
|
|
9475
9492
|
'Scopable',
|
|
@@ -9495,13 +9512,15 @@ defineType$4('ClassMethod', Object.assign({
|
|
|
9495
9512
|
'returnType',
|
|
9496
9513
|
'body',
|
|
9497
9514
|
],
|
|
9498
|
-
|
|
9499
|
-
fields:
|
|
9515
|
+
...classMethodOrPropertyUnionShapeCommon(),
|
|
9516
|
+
fields: {
|
|
9517
|
+
...classMethodOrDeclareMethodCommon(),
|
|
9518
|
+
...functionTypeAnnotationCommon(),
|
|
9500
9519
|
body: {
|
|
9501
9520
|
validate: assertNodeType('BlockStatement'),
|
|
9502
9521
|
},
|
|
9503
|
-
}
|
|
9504
|
-
})
|
|
9522
|
+
},
|
|
9523
|
+
});
|
|
9505
9524
|
defineType$4('ObjectPattern', {
|
|
9506
9525
|
visitor: [
|
|
9507
9526
|
'decorators',
|
|
@@ -9515,9 +9534,10 @@ defineType$4('ObjectPattern', {
|
|
|
9515
9534
|
'PatternLike',
|
|
9516
9535
|
'LVal',
|
|
9517
9536
|
],
|
|
9518
|
-
fields:
|
|
9537
|
+
fields: {
|
|
9538
|
+
...patternLikeCommon(),
|
|
9519
9539
|
properties: validateArrayOfType('RestElement', 'ObjectProperty'),
|
|
9520
|
-
}
|
|
9540
|
+
},
|
|
9521
9541
|
});
|
|
9522
9542
|
defineType$4('SpreadElement', {
|
|
9523
9543
|
visitor: ['argument'],
|
|
@@ -9729,7 +9749,7 @@ defineType$4('OptionalCallExpression', {
|
|
|
9729
9749
|
},
|
|
9730
9750
|
},
|
|
9731
9751
|
});
|
|
9732
|
-
defineType$4('ClassProperty',
|
|
9752
|
+
defineType$4('ClassProperty', {
|
|
9733
9753
|
visitor: [
|
|
9734
9754
|
'decorators',
|
|
9735
9755
|
'variance',
|
|
@@ -9746,8 +9766,9 @@ defineType$4('ClassProperty', Object.assign({
|
|
|
9746
9766
|
'static',
|
|
9747
9767
|
],
|
|
9748
9768
|
aliases: ['Property'],
|
|
9749
|
-
|
|
9750
|
-
fields:
|
|
9769
|
+
...classMethodOrPropertyUnionShapeCommon(),
|
|
9770
|
+
fields: {
|
|
9771
|
+
...classMethodOrPropertyCommon(),
|
|
9751
9772
|
value: {
|
|
9752
9773
|
validate: assertNodeType('Expression'),
|
|
9753
9774
|
optional: true,
|
|
@@ -9776,9 +9797,9 @@ defineType$4('ClassProperty', Object.assign({
|
|
|
9776
9797
|
validate: assertNodeType('Variance'),
|
|
9777
9798
|
optional: true,
|
|
9778
9799
|
},
|
|
9779
|
-
}
|
|
9780
|
-
})
|
|
9781
|
-
defineType$4('ClassAccessorProperty',
|
|
9800
|
+
},
|
|
9801
|
+
});
|
|
9802
|
+
defineType$4('ClassAccessorProperty', {
|
|
9782
9803
|
visitor: [
|
|
9783
9804
|
'decorators',
|
|
9784
9805
|
'key',
|
|
@@ -9794,8 +9815,9 @@ defineType$4('ClassAccessorProperty', Object.assign({
|
|
|
9794
9815
|
'static',
|
|
9795
9816
|
],
|
|
9796
9817
|
aliases: ['Property', 'Accessor'],
|
|
9797
|
-
|
|
9798
|
-
fields:
|
|
9818
|
+
...classMethodOrPropertyUnionShapeCommon(true),
|
|
9819
|
+
fields: {
|
|
9820
|
+
...classMethodOrPropertyCommon(),
|
|
9799
9821
|
key: {
|
|
9800
9822
|
validate: chain((function() {
|
|
9801
9823
|
const normal = assertNodeType('Identifier', 'StringLiteral', 'NumericLiteral', 'BigIntLiteral', 'PrivateName');
|
|
@@ -9835,8 +9857,8 @@ defineType$4('ClassAccessorProperty', Object.assign({
|
|
|
9835
9857
|
validate: assertNodeType('Variance'),
|
|
9836
9858
|
optional: true,
|
|
9837
9859
|
},
|
|
9838
|
-
}
|
|
9839
|
-
})
|
|
9860
|
+
},
|
|
9861
|
+
});
|
|
9840
9862
|
defineType$4('ClassPrivateProperty', {
|
|
9841
9863
|
visitor: [
|
|
9842
9864
|
'decorators',
|
|
@@ -9914,7 +9936,9 @@ defineType$4('ClassPrivateMethod', {
|
|
|
9914
9936
|
'Method',
|
|
9915
9937
|
'Private',
|
|
9916
9938
|
],
|
|
9917
|
-
fields:
|
|
9939
|
+
fields: {
|
|
9940
|
+
...classMethodOrDeclareMethodCommon(),
|
|
9941
|
+
...functionTypeAnnotationCommon(),
|
|
9918
9942
|
kind: {
|
|
9919
9943
|
validate: assertOneOf('get', 'set', 'method'),
|
|
9920
9944
|
default: 'method',
|
|
@@ -9925,7 +9949,7 @@ defineType$4('ClassPrivateMethod', {
|
|
|
9925
9949
|
body: {
|
|
9926
9950
|
validate: assertNodeType('BlockStatement'),
|
|
9927
9951
|
},
|
|
9928
|
-
}
|
|
9952
|
+
},
|
|
9929
9953
|
});
|
|
9930
9954
|
defineType$4('PrivateName', {
|
|
9931
9955
|
visitor: ['id'],
|
|
@@ -9985,16 +10009,16 @@ var defineInterfaceishType = (name) => {
|
|
|
9985
10009
|
'Statement',
|
|
9986
10010
|
'Declaration',
|
|
9987
10011
|
],
|
|
9988
|
-
fields:
|
|
10012
|
+
fields: {
|
|
9989
10013
|
id: validateType('Identifier'),
|
|
9990
10014
|
typeParameters: validateOptionalType('TypeParameterDeclaration'),
|
|
9991
10015
|
extends: validateOptional(arrayOfType('InterfaceExtends')),
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
|
|
10016
|
+
...isDeclareClass2 ? {
|
|
10017
|
+
mixins: validateOptional(arrayOfType('InterfaceExtends')),
|
|
10018
|
+
implements: validateOptional(arrayOfType('ClassImplements')),
|
|
10019
|
+
} : {},
|
|
9996
10020
|
body: validateType('ObjectTypeAnnotation'),
|
|
9997
|
-
}
|
|
10021
|
+
},
|
|
9998
10022
|
});
|
|
9999
10023
|
};
|
|
10000
10024
|
|
|
@@ -10126,12 +10150,13 @@ defineType$3('DeclareExportDeclaration', {
|
|
|
10126
10150
|
'Statement',
|
|
10127
10151
|
'Declaration',
|
|
10128
10152
|
],
|
|
10129
|
-
fields:
|
|
10153
|
+
fields: {
|
|
10130
10154
|
declaration: validateOptionalType('Flow'),
|
|
10131
10155
|
specifiers: validateOptional(arrayOfType('ExportSpecifier', 'ExportNamespaceSpecifier')),
|
|
10132
10156
|
source: validateOptionalType('StringLiteral'),
|
|
10133
10157
|
default: validateOptional(assertValueType('boolean')),
|
|
10134
|
-
|
|
10158
|
+
...importAttributes,
|
|
10159
|
+
},
|
|
10135
10160
|
});
|
|
10136
10161
|
defineType$3('DeclareExportAllDeclaration', {
|
|
10137
10162
|
visitor: ['source', 'attributes'],
|
|
@@ -10140,10 +10165,11 @@ defineType$3('DeclareExportAllDeclaration', {
|
|
|
10140
10165
|
'Statement',
|
|
10141
10166
|
'Declaration',
|
|
10142
10167
|
],
|
|
10143
|
-
fields:
|
|
10168
|
+
fields: {
|
|
10144
10169
|
source: validateType('StringLiteral'),
|
|
10145
10170
|
exportKind: validateOptional(assertOneOf('type', 'value')),
|
|
10146
|
-
|
|
10171
|
+
...importAttributes,
|
|
10172
|
+
},
|
|
10147
10173
|
});
|
|
10148
10174
|
defineType$3('DeclaredPredicate', {
|
|
10149
10175
|
visitor: ['value'],
|
|
@@ -10784,14 +10810,15 @@ var defineType$1 = defineAliasedType('Miscellaneous');
|
|
|
10784
10810
|
defineType$1('Placeholder', {
|
|
10785
10811
|
visitor: [],
|
|
10786
10812
|
builder: ['expectedNode', 'name'],
|
|
10787
|
-
fields:
|
|
10813
|
+
fields: {
|
|
10788
10814
|
name: {
|
|
10789
10815
|
validate: assertNodeType('Identifier'),
|
|
10790
10816
|
},
|
|
10791
10817
|
expectedNode: {
|
|
10792
10818
|
validate: assertOneOf(...PLACEHOLDERS),
|
|
10793
10819
|
},
|
|
10794
|
-
|
|
10820
|
+
...patternLikeCommon(),
|
|
10821
|
+
},
|
|
10795
10822
|
});
|
|
10796
10823
|
defineType$1('V8IntrinsicIdentifier', {
|
|
10797
10824
|
builder: ['name'],
|
|
@@ -10934,9 +10961,12 @@ defineType('TSDeclareFunction', {
|
|
|
10934
10961
|
'params',
|
|
10935
10962
|
'returnType',
|
|
10936
10963
|
],
|
|
10937
|
-
fields:
|
|
10964
|
+
fields: {
|
|
10965
|
+
...functionDeclarationCommon(),
|
|
10966
|
+
...tSFunctionTypeAnnotationCommon(),
|
|
10967
|
+
},
|
|
10938
10968
|
});
|
|
10939
|
-
defineType('TSDeclareMethod',
|
|
10969
|
+
defineType('TSDeclareMethod', {
|
|
10940
10970
|
visitor: [
|
|
10941
10971
|
'decorators',
|
|
10942
10972
|
'key',
|
|
@@ -10944,9 +10974,12 @@ defineType('TSDeclareMethod', Object.assign({
|
|
|
10944
10974
|
'params',
|
|
10945
10975
|
'returnType',
|
|
10946
10976
|
],
|
|
10947
|
-
|
|
10948
|
-
fields:
|
|
10949
|
-
|
|
10977
|
+
...classMethodOrPropertyUnionShapeCommon(),
|
|
10978
|
+
fields: {
|
|
10979
|
+
...classMethodOrDeclareMethodCommon(),
|
|
10980
|
+
...tSFunctionTypeAnnotationCommon(),
|
|
10981
|
+
},
|
|
10982
|
+
});
|
|
10950
10983
|
defineType('TSQualifiedName', {
|
|
10951
10984
|
aliases: ['TSEntityName'],
|
|
10952
10985
|
visitor: ['left', 'right'],
|
|
@@ -10984,14 +11017,15 @@ var namedTypeElementCommon = () => ({
|
|
|
10984
11017
|
defineType('TSPropertySignature', {
|
|
10985
11018
|
aliases: ['TSTypeElement'],
|
|
10986
11019
|
visitor: ['key', 'typeAnnotation'],
|
|
10987
|
-
fields:
|
|
11020
|
+
fields: {
|
|
11021
|
+
...namedTypeElementCommon(),
|
|
10988
11022
|
readonly: validateOptional(bool),
|
|
10989
11023
|
typeAnnotation: validateOptionalType('TSTypeAnnotation'),
|
|
10990
11024
|
kind: {
|
|
10991
11025
|
optional: true,
|
|
10992
11026
|
validate: assertOneOf('get', 'set'),
|
|
10993
11027
|
},
|
|
10994
|
-
}
|
|
11028
|
+
},
|
|
10995
11029
|
});
|
|
10996
11030
|
defineType('TSMethodSignature', {
|
|
10997
11031
|
aliases: ['TSTypeElement'],
|
|
@@ -11001,11 +11035,13 @@ defineType('TSMethodSignature', {
|
|
|
11001
11035
|
'params',
|
|
11002
11036
|
'returnType',
|
|
11003
11037
|
],
|
|
11004
|
-
fields:
|
|
11038
|
+
fields: {
|
|
11039
|
+
...signatureDeclarationCommon(),
|
|
11040
|
+
...namedTypeElementCommon(),
|
|
11005
11041
|
kind: {
|
|
11006
11042
|
validate: assertOneOf('method', 'get', 'set'),
|
|
11007
11043
|
},
|
|
11008
|
-
}
|
|
11044
|
+
},
|
|
11009
11045
|
});
|
|
11010
11046
|
defineType('TSIndexSignature', {
|
|
11011
11047
|
aliases: ['TSTypeElement'],
|
|
@@ -11056,18 +11092,17 @@ var fnOrCtrBase = {
|
|
|
11056
11092
|
],
|
|
11057
11093
|
};
|
|
11058
11094
|
|
|
11059
|
-
defineType('TSFunctionType',
|
|
11060
|
-
fnOrCtrBase,
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11064
|
-
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
}),
|
|
11095
|
+
defineType('TSFunctionType', {
|
|
11096
|
+
...fnOrCtrBase,
|
|
11097
|
+
fields: signatureDeclarationCommon(),
|
|
11098
|
+
});
|
|
11099
|
+
defineType('TSConstructorType', {
|
|
11100
|
+
...fnOrCtrBase,
|
|
11101
|
+
fields: {
|
|
11102
|
+
...signatureDeclarationCommon(),
|
|
11103
|
+
abstract: validateOptional(bool),
|
|
11069
11104
|
},
|
|
11070
|
-
)
|
|
11105
|
+
});
|
|
11071
11106
|
defineType('TSTypeReference', {
|
|
11072
11107
|
aliases: ['TSType'],
|
|
11073
11108
|
visitor: ['typeName', 'typeArguments'],
|
|
@@ -16792,7 +16827,9 @@ function cloneNodeInternal(node, deep = true, withoutLoc = false, commentsCache)
|
|
|
16792
16827
|
}
|
|
16793
16828
|
|
|
16794
16829
|
if (hasOwn(node, 'extra')) {
|
|
16795
|
-
newNode.extra =
|
|
16830
|
+
newNode.extra = {
|
|
16831
|
+
...node.extra,
|
|
16832
|
+
};
|
|
16796
16833
|
}
|
|
16797
16834
|
|
|
16798
16835
|
return newNode;
|
|
@@ -17922,22 +17959,6 @@ var react = {
|
|
|
17922
17959
|
};
|
|
17923
17960
|
|
|
17924
17961
|
// ../babel-babel/packages/babel-parser/lib/index.js
|
|
17925
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
17926
|
-
if (null == r)
|
|
17927
|
-
return {};
|
|
17928
|
-
|
|
17929
|
-
var t = {};
|
|
17930
|
-
|
|
17931
|
-
for (var n2 in r) if ({}.hasOwnProperty.call(r, n2)) {
|
|
17932
|
-
if (-1 !== e.indexOf(n2))
|
|
17933
|
-
continue;
|
|
17934
|
-
|
|
17935
|
-
t[n2] = r[n2];
|
|
17936
|
-
}
|
|
17937
|
-
|
|
17938
|
-
return t;
|
|
17939
|
-
}
|
|
17940
|
-
|
|
17941
17962
|
var Position = class {
|
|
17942
17963
|
constructor(line, col, index2) {
|
|
17943
17964
|
__publicField(this, 'line');
|
|
@@ -18030,10 +18051,8 @@ var StandardErrors = {
|
|
|
18030
18051
|
ConstructorIsGenerator: 'Constructor can\'t be a generator.',
|
|
18031
18052
|
DeclarationMissingInitializer: ({kind}) => `Missing initializer in ${kind} declaration.`,
|
|
18032
18053
|
DecoratorArgumentsOutsideParentheses: 'Decorator arguments must be moved inside parentheses: use \'@(decorator(args))\' instead of \'@(decorator)(args)\'.',
|
|
18033
|
-
DecoratorBeforeExport: 'Decorators must be placed *before* the \'export\' keyword. Remove the \'decoratorsBeforeExport: true\' option to use the \'export @decorator class {}\' syntax.',
|
|
18034
18054
|
DecoratorsBeforeAfterExport: 'Decorators can be placed *either* before or after the \'export\' keyword, but not in both locations at the same time.',
|
|
18035
18055
|
DecoratorConstructor: 'Decorators can\'t be used with a constructor. Did you mean \'@dec class { ... }\'?',
|
|
18036
|
-
DecoratorExportClass: 'Decorators must be placed *after* the \'export\' keyword. Remove the \'decoratorsBeforeExport: false\' option to use the \'@decorator export class {}\' syntax.',
|
|
18037
18056
|
DecoratorSemicolon: 'Decorators must not be followed by a semicolon.',
|
|
18038
18057
|
DecoratorStaticBlock: 'Decorators can\'t be used with a static block.',
|
|
18039
18058
|
DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.',
|
|
@@ -18057,21 +18076,16 @@ var StandardErrors = {
|
|
|
18057
18076
|
IllegalBreakContinue: ({type}) => `Unsyntactic ${type === 'BreakStatement' ? 'break' : 'continue'}.`,
|
|
18058
18077
|
IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list.',
|
|
18059
18078
|
IllegalReturn: '\'return\' outside of function.',
|
|
18060
|
-
ImportAttributesUseAssert: 'The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.',
|
|
18061
18079
|
ImportBindingIsString: ({importName}) => `A string literal cannot be used as an imported binding.
|
|
18062
18080
|
- Did you mean \`import { "${importName}" as foo }\`?`,
|
|
18063
18081
|
ImportCallArity: `\`import()\` requires exactly one or two arguments.`,
|
|
18064
18082
|
ImportCallNotNewExpression: 'Cannot use new with import(...).',
|
|
18065
18083
|
ImportCallSpreadArgument: '`...` is not allowed in `import()`.',
|
|
18066
|
-
ImportJSONBindingNotDefault: 'A JSON module can only be imported with `default`.',
|
|
18067
|
-
ImportReflectionHasAssertion: '`import module x` cannot have assertions.',
|
|
18068
|
-
ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.',
|
|
18069
18084
|
IncompatibleRegExpUVFlags: 'The \'u\' and \'v\' regular expression flags cannot be enabled at the same time.',
|
|
18070
18085
|
InvalidBigIntLiteral: 'Invalid BigIntLiteral.',
|
|
18071
18086
|
InvalidCodePoint: 'Code point out of bounds.',
|
|
18072
18087
|
InvalidCoverDiscardElement: '\'void\' must be followed by an expression when not used in a binding position.',
|
|
18073
18088
|
InvalidCoverInitializedName: 'Invalid shorthand property initializer.',
|
|
18074
|
-
InvalidDecimal: 'Invalid decimal.',
|
|
18075
18089
|
InvalidDigit: ({radix}) => `Expected number in radix ${radix}.`,
|
|
18076
18090
|
InvalidEscapeSequence: 'Bad character escape sequence.',
|
|
18077
18091
|
InvalidEscapeSequenceTemplate: 'Invalid escape sequence in template.',
|
|
@@ -18086,7 +18100,6 @@ var StandardErrors = {
|
|
|
18086
18100
|
InvalidParenthesizedAssignment: 'Invalid parenthesized assignment pattern.',
|
|
18087
18101
|
InvalidPrivateFieldResolution: ({identifierName}) => `Private name #${identifierName} is not defined.`,
|
|
18088
18102
|
InvalidPropertyBindingPattern: 'Binding member expression.',
|
|
18089
|
-
InvalidRecordProperty: 'Only properties and spread elements are allowed in record definitions.',
|
|
18090
18103
|
InvalidRestAssignmentPattern: 'Invalid rest operator\'s argument.',
|
|
18091
18104
|
LabelRedeclaration: ({labelName}) => `Label '${labelName}' is already declared.`,
|
|
18092
18105
|
LetInLexicalBinding: '\'let\' is disallowed as a lexically bound name.',
|
|
@@ -18103,7 +18116,6 @@ var StandardErrors = {
|
|
|
18103
18116
|
.join(', ')}.`,
|
|
18104
18117
|
MissingUnicodeEscape: 'Expecting Unicode escape sequence \\uXXXX.',
|
|
18105
18118
|
MixingCoalesceWithLogical: 'Nullish coalescing operator(??) requires parens when mixing with logical operators.',
|
|
18106
|
-
ModuleAttributeDifferentFromType: 'The only accepted module attribute is `type`.',
|
|
18107
18119
|
ModuleAttributeInvalidValue: 'Only string literals are allowed as module attribute values.',
|
|
18108
18120
|
ModuleAttributesWithDuplicateKeys: ({key}) => `Duplicate key "${key}" is not allowed in module attributes.`,
|
|
18109
18121
|
ModuleExportNameHasLoneSurrogate: ({surrogateCharCode}) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`,
|
|
@@ -18122,10 +18134,6 @@ var StandardErrors = {
|
|
|
18122
18134
|
PatternHasMethod: 'Object pattern can\'t contain methods.',
|
|
18123
18135
|
PrivateInExpectedIn: ({identifierName}) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`,
|
|
18124
18136
|
PrivateNameRedeclaration: ({identifierName}) => `Duplicate private name #${identifierName}.`,
|
|
18125
|
-
RecordExpressionBarIncorrectEndSyntaxType: 'Record expressions ending with \'|}\' are only allowed when the \'syntaxType\' option of the \'recordAndTuple\' plugin is set to \'bar\'.',
|
|
18126
|
-
RecordExpressionBarIncorrectStartSyntaxType: 'Record expressions starting with \'{|\' are only allowed when the \'syntaxType\' option of the \'recordAndTuple\' plugin is set to \'bar\'.',
|
|
18127
|
-
RecordExpressionHashIncorrectStartSyntaxType: 'Record expressions starting with \'#{\' are only allowed when the \'syntaxType\' option of the \'recordAndTuple\' plugin is set to \'hash\'.',
|
|
18128
|
-
RecordNoProto: '\'__proto__\' is not allowed in Record expressions.',
|
|
18129
18137
|
RestTrailingComma: 'Unexpected trailing comma after rest element.',
|
|
18130
18138
|
SloppyFunction: 'In non-strict mode code, functions can only be declared at top level or inside a block.',
|
|
18131
18139
|
SloppyFunctionAnnexB: 'In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.',
|
|
@@ -18134,11 +18142,7 @@ var StandardErrors = {
|
|
|
18134
18142
|
SuperNotAllowed: '`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name (\'constructor\') or not extending another class?',
|
|
18135
18143
|
SuperPrivateField: 'Private fields can\'t be accessed on super.',
|
|
18136
18144
|
TrailingDecorator: 'Decorators must be attached to a class element.',
|
|
18137
|
-
TupleExpressionBarIncorrectEndSyntaxType: 'Tuple expressions ending with \'|]\' are only allowed when the \'syntaxType\' option of the \'recordAndTuple\' plugin is set to \'bar\'.',
|
|
18138
|
-
TupleExpressionBarIncorrectStartSyntaxType: 'Tuple expressions starting with \'[|\' are only allowed when the \'syntaxType\' option of the \'recordAndTuple\' plugin is set to \'bar\'.',
|
|
18139
|
-
TupleExpressionHashIncorrectStartSyntaxType: 'Tuple expressions starting with \'#[\' are only allowed when the \'syntaxType\' option of the \'recordAndTuple\' plugin is set to \'hash\'.',
|
|
18140
18145
|
UnexpectedArgumentPlaceholder: 'Unexpected argument placeholder.',
|
|
18141
|
-
UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
|
|
18142
18146
|
UnexpectedDigitAfterHash: 'Unexpected digit after hash token.',
|
|
18143
18147
|
UnexpectedImportExport: '\'import\' and \'export\' may only appear at the top level.',
|
|
18144
18148
|
UnexpectedKeyword: ({keyword}) => `Unexpected keyword '${keyword}'.`,
|
|
@@ -18209,8 +18213,6 @@ var PipelineOperatorErrors = {
|
|
|
18209
18213
|
})}; please wrap it in parentheses.`,
|
|
18210
18214
|
};
|
|
18211
18215
|
|
|
18212
|
-
var _excluded = ['message'];
|
|
18213
|
-
|
|
18214
18216
|
function defineHidden(obj, key, value) {
|
|
18215
18217
|
Object.defineProperty(obj, key, {
|
|
18216
18218
|
enumerable: false,
|
|
@@ -18242,7 +18244,10 @@ function toParseErrorConstructor({toMessage, code: code2, reasonCode, syntaxPlug
|
|
|
18242
18244
|
index: index2,
|
|
18243
18245
|
} = overrides.loc ?? loc;
|
|
18244
18246
|
|
|
18245
|
-
return constructor(new Position(line, column, index2),
|
|
18247
|
+
return constructor(new Position(line, column, index2), {
|
|
18248
|
+
...details,
|
|
18249
|
+
...overrides.details,
|
|
18250
|
+
});
|
|
18246
18251
|
});
|
|
18247
18252
|
defineHidden(error, 'details', details);
|
|
18248
18253
|
Object.defineProperty(error, 'message', {
|
|
@@ -18273,27 +18278,35 @@ function ParseErrorEnum(argument, syntaxPlugin) {
|
|
|
18273
18278
|
|
|
18274
18279
|
for (const reasonCode of Object.keys(argument)) {
|
|
18275
18280
|
const template = argument[reasonCode];
|
|
18276
|
-
const
|
|
18277
|
-
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
|
|
18281
|
+
const {message, ...rest} = typeof template === 'string' ? {
|
|
18282
|
+
message: () => template,
|
|
18283
|
+
} : typeof template === 'function' ? {
|
|
18284
|
+
message: template,
|
|
18285
|
+
} : template;
|
|
18281
18286
|
|
|
18282
18287
|
const toMessage = typeof message === 'string' ? () => message : message;
|
|
18283
18288
|
|
|
18284
|
-
ParseErrorConstructors[reasonCode] = toParseErrorConstructor(
|
|
18289
|
+
ParseErrorConstructors[reasonCode] = toParseErrorConstructor({
|
|
18285
18290
|
code: 'BABEL_PARSER_SYNTAX_ERROR',
|
|
18286
18291
|
reasonCode,
|
|
18287
18292
|
toMessage,
|
|
18288
|
-
|
|
18289
|
-
|
|
18290
|
-
|
|
18293
|
+
...syntaxPlugin ? {
|
|
18294
|
+
syntaxPlugin,
|
|
18295
|
+
} : {},
|
|
18296
|
+
...rest,
|
|
18297
|
+
});
|
|
18291
18298
|
}
|
|
18292
18299
|
|
|
18293
18300
|
return ParseErrorConstructors;
|
|
18294
18301
|
}
|
|
18295
18302
|
|
|
18296
|
-
var Errors =
|
|
18303
|
+
var Errors = {
|
|
18304
|
+
...ParseErrorEnum(ModuleErrors),
|
|
18305
|
+
...ParseErrorEnum(StandardErrors),
|
|
18306
|
+
...ParseErrorEnum(StrictModeErrors),
|
|
18307
|
+
...ParseErrorEnum(ParseExpressionErrors),
|
|
18308
|
+
...ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors),
|
|
18309
|
+
};
|
|
18297
18310
|
|
|
18298
18311
|
function createDefaultOptions() {
|
|
18299
18312
|
return {
|
|
@@ -18425,14 +18438,6 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
|
18425
18438
|
return node;
|
|
18426
18439
|
}
|
|
18427
18440
|
|
|
18428
|
-
parseDecimalLiteral(value) {
|
|
18429
|
-
const decimal = null;
|
|
18430
|
-
const node = this.estreeParseLiteral(decimal);
|
|
18431
|
-
|
|
18432
|
-
node.decimal = String(node.value || value);
|
|
18433
|
-
return node;
|
|
18434
|
-
}
|
|
18435
|
-
|
|
18436
18441
|
estreeParseLiteral(value) {
|
|
18437
18442
|
return this.parseLiteral(value, 'Literal');
|
|
18438
18443
|
}
|
|
@@ -22655,24 +22660,27 @@ var Tokenizer = class extends CommentsParser {
|
|
|
22655
22660
|
numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),
|
|
22656
22661
|
unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator),
|
|
22657
22662
|
});
|
|
22658
|
-
__publicField(this, 'errorHandlers_readCodePoint',
|
|
22663
|
+
__publicField(this, 'errorHandlers_readCodePoint', {
|
|
22664
|
+
...this.errorHandlers_readInt,
|
|
22659
22665
|
invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence),
|
|
22660
22666
|
invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint),
|
|
22661
|
-
})
|
|
22662
|
-
__publicField(this, 'errorHandlers_readStringContents_string',
|
|
22667
|
+
});
|
|
22668
|
+
__publicField(this, 'errorHandlers_readStringContents_string', {
|
|
22669
|
+
...this.errorHandlers_readCodePoint,
|
|
22663
22670
|
strictNumericEscape: (pos, lineStart, curLine) => {
|
|
22664
22671
|
this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine));
|
|
22665
22672
|
},
|
|
22666
22673
|
unterminated: (pos, lineStart, curLine) => {
|
|
22667
22674
|
throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine));
|
|
22668
22675
|
},
|
|
22669
|
-
})
|
|
22670
|
-
__publicField(this, 'errorHandlers_readStringContents_template',
|
|
22676
|
+
});
|
|
22677
|
+
__publicField(this, 'errorHandlers_readStringContents_template', {
|
|
22678
|
+
...this.errorHandlers_readCodePoint,
|
|
22671
22679
|
strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape),
|
|
22672
22680
|
unterminated: (pos, lineStart, curLine) => {
|
|
22673
22681
|
throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine));
|
|
22674
22682
|
},
|
|
22675
|
-
})
|
|
22683
|
+
});
|
|
22676
22684
|
this.state = new State();
|
|
22677
22685
|
this.state.init(options);
|
|
22678
22686
|
this.input = input;
|
|
@@ -23525,8 +23533,6 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23525
23533
|
if (next === 110) {
|
|
23526
23534
|
++this.state.pos;
|
|
23527
23535
|
isBigInt = true;
|
|
23528
|
-
} else if (next === 109) {
|
|
23529
|
-
throw this.raise(Errors.InvalidDecimal, startLoc);
|
|
23530
23536
|
}
|
|
23531
23537
|
|
|
23532
23538
|
if (isIdentifierStart2(this.codePointAtPos(this.state.pos))) {
|
|
@@ -25057,7 +25063,6 @@ var TSErrors = ParseErrorEnum`typescript`({
|
|
|
25057
25063
|
EmptyTypeParameters: 'Type parameter list cannot be empty.',
|
|
25058
25064
|
ExpectedAmbientAfterExportDeclare: '\'export declare\' must be followed by an ambient declaration.',
|
|
25059
25065
|
ImportAliasHasImportType: 'An import alias can not use \'import type\'.',
|
|
25060
|
-
ImportReflectionHasImportType: 'An `import module` declaration can not use `type` modifier',
|
|
25061
25066
|
IncompatibleModifiers: ({modifiers}) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`,
|
|
25062
25067
|
IndexSignatureHasAbstract: 'Index signatures cannot have the \'abstract\' modifier.',
|
|
25063
25068
|
IndexSignatureHasAccessibility: ({modifier}) => `Index signatures cannot have an accessibility modifier ('${modifier}').`,
|
|
@@ -27108,8 +27113,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27108
27113
|
return exprList;
|
|
27109
27114
|
}
|
|
27110
27115
|
|
|
27111
|
-
parseArrayLike(close,
|
|
27112
|
-
const node = super.parseArrayLike(close,
|
|
27116
|
+
parseArrayLike(close, refExpressionErrors) {
|
|
27117
|
+
const node = super.parseArrayLike(close, refExpressionErrors);
|
|
27113
27118
|
|
|
27114
27119
|
if (node.type === 'ArrayExpression') {
|
|
27115
27120
|
this.tsCheckForInvalidTypeCasts(node.elements);
|
|
@@ -27266,14 +27271,6 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27266
27271
|
}
|
|
27267
27272
|
}
|
|
27268
27273
|
|
|
27269
|
-
checkImportReflection(node) {
|
|
27270
|
-
super.checkImportReflection(node);
|
|
27271
|
-
|
|
27272
|
-
if (node.module && node.importKind !== 'value') {
|
|
27273
|
-
this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start);
|
|
27274
|
-
}
|
|
27275
|
-
}
|
|
27276
|
-
|
|
27277
27274
|
checkDuplicateExports() {}
|
|
27278
27275
|
|
|
27279
27276
|
isPotentialImportPhase(isExport) {
|
|
@@ -28985,18 +28982,6 @@ function validatePlugins(pluginsMap) {
|
|
|
28985
28982
|
if (pluginsMap.has('decorators-legacy')) {
|
|
28986
28983
|
throw new Error('Cannot use the decorators and decorators-legacy plugin together');
|
|
28987
28984
|
}
|
|
28988
|
-
|
|
28989
|
-
const decoratorsBeforeExport = pluginsMap.get('decorators').decoratorsBeforeExport;
|
|
28990
|
-
|
|
28991
|
-
if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== 'boolean') {
|
|
28992
|
-
throw new Error('\'decoratorsBeforeExport\' must be a boolean, if specified.');
|
|
28993
|
-
}
|
|
28994
|
-
|
|
28995
|
-
const allowCallParenthesized = pluginsMap.get('decorators').allowCallParenthesized;
|
|
28996
|
-
|
|
28997
|
-
if (allowCallParenthesized != null && typeof allowCallParenthesized !== 'boolean') {
|
|
28998
|
-
throw new Error('\'allowCallParenthesized\' must be a boolean.');
|
|
28999
|
-
}
|
|
29000
28985
|
}
|
|
29001
28986
|
|
|
29002
28987
|
if (pluginsMap.has('flow') && pluginsMap.has('typescript')) {
|
|
@@ -29090,7 +29075,7 @@ var mixinPlugins = {
|
|
|
29090
29075
|
var mixinPluginNames = Object.keys(mixinPlugins);
|
|
29091
29076
|
|
|
29092
29077
|
var ExpressionParser = class extends LValParser {
|
|
29093
|
-
checkProto(prop,
|
|
29078
|
+
checkProto(prop, sawProto, refExpressionErrors) {
|
|
29094
29079
|
if (prop.type === 'SpreadElement' || this.isObjectMethod(prop) || prop.computed || prop.shorthand) {
|
|
29095
29080
|
return sawProto;
|
|
29096
29081
|
}
|
|
@@ -29099,11 +29084,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
29099
29084
|
const name = key.type === 'Identifier' ? key.name : key.value;
|
|
29100
29085
|
|
|
29101
29086
|
if (name === '__proto__') {
|
|
29102
|
-
if (isRecord) {
|
|
29103
|
-
this.raise(Errors.RecordNoProto, key);
|
|
29104
|
-
return true;
|
|
29105
|
-
}
|
|
29106
|
-
|
|
29107
29087
|
if (sawProto) {
|
|
29108
29088
|
if (refExpressionErrors) {
|
|
29109
29089
|
if (refExpressionErrors.doubleProtoLoc === null) {
|
|
@@ -29847,11 +29827,11 @@ var ExpressionParser = class extends LValParser {
|
|
|
29847
29827
|
}
|
|
29848
29828
|
|
|
29849
29829
|
case 0: {
|
|
29850
|
-
return this.parseArrayLike(3,
|
|
29830
|
+
return this.parseArrayLike(3, refExpressionErrors);
|
|
29851
29831
|
}
|
|
29852
29832
|
|
|
29853
29833
|
case 5: {
|
|
29854
|
-
return this.parseObjectLike(8, false,
|
|
29834
|
+
return this.parseObjectLike(8, false, refExpressionErrors);
|
|
29855
29835
|
}
|
|
29856
29836
|
|
|
29857
29837
|
case 68:
|
|
@@ -30014,9 +29994,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
30014
29994
|
}]);
|
|
30015
29995
|
}
|
|
30016
29996
|
|
|
30017
|
-
case 'smart':
|
|
30018
|
-
return tokenType === 27;
|
|
30019
|
-
|
|
30020
29997
|
default:
|
|
30021
29998
|
throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc);
|
|
30022
29999
|
}
|
|
@@ -30185,10 +30162,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
30185
30162
|
return node;
|
|
30186
30163
|
}
|
|
30187
30164
|
|
|
30188
|
-
parseDecimalLiteral(value) {
|
|
30189
|
-
return this.parseLiteral(value, 'DecimalLiteral');
|
|
30190
|
-
}
|
|
30191
|
-
|
|
30192
30165
|
parseRegExpLiteral(value) {
|
|
30193
30166
|
const node = this.startNode();
|
|
30194
30167
|
this.addExtra(node, 'raw', this.input.slice(this.offsetToSourcePos(node.start), this.state.end));
|
|
@@ -30431,11 +30404,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30431
30404
|
return this.parseExpression();
|
|
30432
30405
|
}
|
|
30433
30406
|
|
|
30434
|
-
parseObjectLike(close, isPattern3,
|
|
30435
|
-
if (isRecord) {
|
|
30436
|
-
this.expectPlugin('recordAndTuple');
|
|
30437
|
-
}
|
|
30438
|
-
|
|
30407
|
+
parseObjectLike(close, isPattern3, refExpressionErrors) {
|
|
30439
30408
|
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
30440
30409
|
|
|
30441
30410
|
this.state.inFSharpPipelineDirectBody = false;
|
|
@@ -30463,11 +30432,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30463
30432
|
prop = this.parseBindingProperty();
|
|
30464
30433
|
} else {
|
|
30465
30434
|
prop = this.parsePropertyDefinition(refExpressionErrors);
|
|
30466
|
-
sawProto = this.checkProto(prop,
|
|
30467
|
-
}
|
|
30468
|
-
|
|
30469
|
-
if (isRecord && !this.isObjectProperty(prop) && prop.type !== 'SpreadElement') {
|
|
30470
|
-
this.raise(Errors.InvalidRecordProperty, prop);
|
|
30435
|
+
sawProto = this.checkProto(prop, sawProto, refExpressionErrors);
|
|
30471
30436
|
}
|
|
30472
30437
|
|
|
30473
30438
|
node.properties.push(prop);
|
|
@@ -30475,13 +30440,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30475
30440
|
|
|
30476
30441
|
this.next();
|
|
30477
30442
|
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
30478
|
-
|
|
30479
|
-
|
|
30480
|
-
if (isPattern3) {
|
|
30481
|
-
type = 'ObjectPattern';
|
|
30482
|
-
} else if (isRecord) {
|
|
30483
|
-
type = 'RecordExpression';
|
|
30484
|
-
}
|
|
30443
|
+
const type = isPattern3 ? 'ObjectPattern' : 'ObjectExpression';
|
|
30485
30444
|
|
|
30486
30445
|
return this.finishNode(node, type);
|
|
30487
30446
|
}
|
|
@@ -30728,19 +30687,15 @@ var ExpressionParser = class extends LValParser {
|
|
|
30728
30687
|
return finishedNode;
|
|
30729
30688
|
}
|
|
30730
30689
|
|
|
30731
|
-
parseArrayLike(close,
|
|
30732
|
-
if (isTuple) {
|
|
30733
|
-
this.expectPlugin('recordAndTuple');
|
|
30734
|
-
}
|
|
30735
|
-
|
|
30690
|
+
parseArrayLike(close, refExpressionErrors) {
|
|
30736
30691
|
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
30737
30692
|
|
|
30738
30693
|
this.state.inFSharpPipelineDirectBody = false;
|
|
30739
30694
|
const node = this.startNode();
|
|
30740
30695
|
this.next();
|
|
30741
|
-
node.elements = this.parseExprList(close,
|
|
30696
|
+
node.elements = this.parseExprList(close, true, refExpressionErrors, node);
|
|
30742
30697
|
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
30743
|
-
return this.finishNode(node,
|
|
30698
|
+
return this.finishNode(node, 'ArrayExpression');
|
|
30744
30699
|
}
|
|
30745
30700
|
|
|
30746
30701
|
parseArrowExpression(node, params, isAsync, trailingCommaLoc) {
|
|
@@ -31112,10 +31067,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
31112
31067
|
}
|
|
31113
31068
|
}
|
|
31114
31069
|
|
|
31115
|
-
withSmartMixTopicForbiddingContext(callback) {
|
|
31116
|
-
return callback();
|
|
31117
|
-
}
|
|
31118
|
-
|
|
31119
31070
|
withSoloAwaitPermittingContext(callback) {
|
|
31120
31071
|
const outerContextSoloAwaitState = this.state.soloAwait;
|
|
31121
31072
|
|
|
@@ -31646,20 +31597,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31646
31597
|
}
|
|
31647
31598
|
}
|
|
31648
31599
|
|
|
31649
|
-
decoratorsEnabledBeforeExport() {
|
|
31650
|
-
if (this.hasPlugin('decorators-legacy'))
|
|
31651
|
-
return true;
|
|
31652
|
-
|
|
31653
|
-
return this.hasPlugin('decorators') && this.getPluginOption('decorators', 'decoratorsBeforeExport') !== false;
|
|
31654
|
-
}
|
|
31655
|
-
|
|
31656
31600
|
maybeTakeDecorators(maybeDecorators, classNode, exportNode) {
|
|
31657
31601
|
if (maybeDecorators) {
|
|
31658
31602
|
if (classNode.decorators?.length) {
|
|
31659
|
-
|
|
31660
|
-
this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]);
|
|
31661
|
-
}
|
|
31662
|
-
|
|
31603
|
+
this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]);
|
|
31663
31604
|
classNode.decorators.unshift(...maybeDecorators);
|
|
31664
31605
|
} else {
|
|
31665
31606
|
classNode.decorators = maybeDecorators;
|
|
@@ -31688,10 +31629,6 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31688
31629
|
if (!allowExport) {
|
|
31689
31630
|
this.unexpected();
|
|
31690
31631
|
}
|
|
31691
|
-
|
|
31692
|
-
if (!this.decoratorsEnabledBeforeExport()) {
|
|
31693
|
-
this.raise(Errors.DecoratorExportClass, this.state.startLoc);
|
|
31694
|
-
}
|
|
31695
31632
|
} else if (!this.canHaveLeadingDecorator()) {
|
|
31696
31633
|
throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc);
|
|
31697
31634
|
}
|
|
@@ -31718,7 +31655,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31718
31655
|
|
|
31719
31656
|
node.expression = this.parseMaybeDecoratorArguments(expr, startLoc2);
|
|
31720
31657
|
|
|
31721
|
-
if (
|
|
31658
|
+
if (node.expression !== expr) {
|
|
31722
31659
|
this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
|
|
31723
31660
|
}
|
|
31724
31661
|
} else {
|
|
@@ -31816,7 +31753,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31816
31753
|
parseDoWhileStatement(node) {
|
|
31817
31754
|
this.next();
|
|
31818
31755
|
this.state.labels.push(loopLabel);
|
|
31819
|
-
node.body = this.
|
|
31756
|
+
node.body = this.parseStatement();
|
|
31820
31757
|
this.state.labels.pop();
|
|
31821
31758
|
this.expect(92);
|
|
31822
31759
|
node.test = this.parseHeaderExpression();
|
|
@@ -32043,7 +31980,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32043
31980
|
this.scope.enter(0);
|
|
32044
31981
|
}
|
|
32045
31982
|
|
|
32046
|
-
clause.body = this.
|
|
31983
|
+
clause.body = this.parseBlock(false, false);
|
|
32047
31984
|
this.scope.exit();
|
|
32048
31985
|
node.handler = this.finishNode(clause, 'CatchClause');
|
|
32049
31986
|
}
|
|
@@ -32068,7 +32005,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32068
32005
|
this.next();
|
|
32069
32006
|
node.test = this.parseHeaderExpression();
|
|
32070
32007
|
this.state.labels.push(loopLabel);
|
|
32071
|
-
node.body = this.
|
|
32008
|
+
node.body = this.parseStatement();
|
|
32072
32009
|
this.state.labels.pop();
|
|
32073
32010
|
return this.finishNode(node, 'WhileStatement');
|
|
32074
32011
|
}
|
|
@@ -32080,7 +32017,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32080
32017
|
|
|
32081
32018
|
this.next();
|
|
32082
32019
|
node.object = this.parseHeaderExpression();
|
|
32083
|
-
node.body = this.
|
|
32020
|
+
node.body = this.parseStatement();
|
|
32084
32021
|
return this.finishNode(node, 'WithStatement');
|
|
32085
32022
|
}
|
|
32086
32023
|
|
|
@@ -32204,7 +32141,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32204
32141
|
this.semicolon(false);
|
|
32205
32142
|
node.update = this.match(11) ? null : this.parseExpression();
|
|
32206
32143
|
this.expect(11);
|
|
32207
|
-
node.body = this.
|
|
32144
|
+
node.body = this.parseStatement();
|
|
32208
32145
|
this.scope.exit();
|
|
32209
32146
|
this.state.labels.pop();
|
|
32210
32147
|
return this.finishNode(node, 'ForStatement');
|
|
@@ -32238,7 +32175,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32238
32175
|
node.left = init;
|
|
32239
32176
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
32240
32177
|
this.expect(11);
|
|
32241
|
-
node.body = this.
|
|
32178
|
+
node.body = this.parseStatement();
|
|
32242
32179
|
this.scope.exit();
|
|
32243
32180
|
this.state.labels.pop();
|
|
32244
32181
|
return this.finishNode(node, isForIn ? 'ForInStatement' : 'ForOfStatement');
|
|
@@ -32329,9 +32266,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32329
32266
|
}
|
|
32330
32267
|
|
|
32331
32268
|
this.parseFunctionParams(node, false);
|
|
32332
|
-
this.
|
|
32333
|
-
this.parseFunctionBodyAndFinish(node, isDeclaration2 ? 'FunctionDeclaration' : 'FunctionExpression');
|
|
32334
|
-
});
|
|
32269
|
+
this.parseFunctionBodyAndFinish(node, isDeclaration2 ? 'FunctionDeclaration' : 'FunctionExpression');
|
|
32335
32270
|
this.prodParam.exit();
|
|
32336
32271
|
this.scope.exit();
|
|
32337
32272
|
|
|
@@ -32401,36 +32336,35 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32401
32336
|
|
|
32402
32337
|
classBody2.body = [];
|
|
32403
32338
|
this.expect(5);
|
|
32404
|
-
this.
|
|
32405
|
-
|
|
32406
|
-
if (
|
|
32407
|
-
|
|
32408
|
-
throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc);
|
|
32409
|
-
}
|
|
32410
|
-
|
|
32411
|
-
continue;
|
|
32412
|
-
}
|
|
32413
|
-
|
|
32414
|
-
if (this.match(26)) {
|
|
32415
|
-
decorators.push(this.parseDecorator());
|
|
32416
|
-
continue;
|
|
32417
|
-
}
|
|
32418
|
-
|
|
32419
|
-
const member = this.startNode();
|
|
32420
|
-
|
|
32421
|
-
if (decorators.length) {
|
|
32422
|
-
member.decorators = decorators;
|
|
32423
|
-
this.resetStartLocationFromNode(member, decorators[0]);
|
|
32424
|
-
decorators = [];
|
|
32339
|
+
while (!this.match(8)) {
|
|
32340
|
+
if (this.eat(13)) {
|
|
32341
|
+
if (decorators.length > 0) {
|
|
32342
|
+
throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc);
|
|
32425
32343
|
}
|
|
32426
32344
|
|
|
32427
|
-
|
|
32428
|
-
|
|
32429
|
-
if (member.kind === 'constructor' && member.decorators && member.decorators.length > 0) {
|
|
32430
|
-
this.raise(Errors.DecoratorConstructor, member);
|
|
32431
|
-
}
|
|
32345
|
+
continue;
|
|
32432
32346
|
}
|
|
32433
|
-
|
|
32347
|
+
|
|
32348
|
+
if (this.match(26)) {
|
|
32349
|
+
decorators.push(this.parseDecorator());
|
|
32350
|
+
continue;
|
|
32351
|
+
}
|
|
32352
|
+
|
|
32353
|
+
const member = this.startNode();
|
|
32354
|
+
|
|
32355
|
+
if (decorators.length) {
|
|
32356
|
+
member.decorators = decorators;
|
|
32357
|
+
this.resetStartLocationFromNode(member, decorators[0]);
|
|
32358
|
+
decorators = [];
|
|
32359
|
+
}
|
|
32360
|
+
|
|
32361
|
+
this.parseClassMember(classBody2, member, state);
|
|
32362
|
+
|
|
32363
|
+
if (member.kind === 'constructor' && member.decorators && member.decorators.length > 0) {
|
|
32364
|
+
this.raise(Errors.DecoratorConstructor, member);
|
|
32365
|
+
}
|
|
32366
|
+
}
|
|
32367
|
+
|
|
32434
32368
|
this.state.strict = oldStrict;
|
|
32435
32369
|
this.next();
|
|
32436
32370
|
|
|
@@ -32926,10 +32860,6 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32926
32860
|
}
|
|
32927
32861
|
|
|
32928
32862
|
if (this.match(26)) {
|
|
32929
|
-
if (this.hasPlugin('decorators') && this.getPluginOption('decorators', 'decoratorsBeforeExport') === true) {
|
|
32930
|
-
this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
|
|
32931
|
-
}
|
|
32932
|
-
|
|
32933
32863
|
return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);
|
|
32934
32864
|
}
|
|
32935
32865
|
|
|
@@ -32992,7 +32922,6 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32992
32922
|
node.source = this.parseImportSource();
|
|
32993
32923
|
this.checkExport(node);
|
|
32994
32924
|
this.maybeParseImportAttributes(node);
|
|
32995
|
-
this.checkJSONModuleImport(node);
|
|
32996
32925
|
} else if (expect) {
|
|
32997
32926
|
this.unexpected();
|
|
32998
32927
|
}
|
|
@@ -33007,10 +32936,6 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33007
32936
|
this.expectOnePlugin(['decorators', 'decorators-legacy']);
|
|
33008
32937
|
|
|
33009
32938
|
if (this.hasPlugin('decorators')) {
|
|
33010
|
-
if (this.getPluginOption('decorators', 'decoratorsBeforeExport') === true) {
|
|
33011
|
-
this.raise(Errors.DecoratorBeforeExport, this.state.startLoc);
|
|
33012
|
-
}
|
|
33013
|
-
|
|
33014
32939
|
return true;
|
|
33015
32940
|
}
|
|
33016
32941
|
}
|
|
@@ -33185,17 +33110,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33185
33110
|
return this.parseIdentifier(true);
|
|
33186
33111
|
}
|
|
33187
33112
|
|
|
33188
|
-
|
|
33189
|
-
if (node.assertions != null) {
|
|
33190
|
-
return node.assertions.some(({key, value}) => {
|
|
33191
|
-
return value.value === 'json' && (key.type === 'Identifier' ? key.name === 'type' : key.value === 'type');
|
|
33192
|
-
});
|
|
33193
|
-
}
|
|
33194
|
-
|
|
33195
|
-
return false;
|
|
33196
|
-
}
|
|
33197
|
-
|
|
33198
|
-
checkImportReflection(node) {
|
|
33113
|
+
checkImportPhase(node) {
|
|
33199
33114
|
const {specifiers} = node;
|
|
33200
33115
|
|
|
33201
33116
|
const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null;
|
|
@@ -33208,41 +33123,6 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33208
33123
|
if (singleBindingType !== 'ImportNamespaceSpecifier') {
|
|
33209
33124
|
this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start);
|
|
33210
33125
|
}
|
|
33211
|
-
} else if (node.module) {
|
|
33212
|
-
if (singleBindingType !== 'ImportDefaultSpecifier') {
|
|
33213
|
-
this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start);
|
|
33214
|
-
}
|
|
33215
|
-
|
|
33216
|
-
if (node.assertions?.length > 0) {
|
|
33217
|
-
this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start);
|
|
33218
|
-
}
|
|
33219
|
-
}
|
|
33220
|
-
|
|
33221
|
-
}
|
|
33222
|
-
|
|
33223
|
-
checkJSONModuleImport(node) {
|
|
33224
|
-
if (this.isJSONModuleImport(node) && node.type !== 'ExportAllDeclaration') {
|
|
33225
|
-
const {specifiers} = node;
|
|
33226
|
-
|
|
33227
|
-
if (specifiers != null) {
|
|
33228
|
-
const nonDefaultNamedSpecifier = specifiers.find((specifier) => {
|
|
33229
|
-
let imported;
|
|
33230
|
-
|
|
33231
|
-
if (specifier.type === 'ExportSpecifier') {
|
|
33232
|
-
imported = specifier.local;
|
|
33233
|
-
} else if (specifier.type === 'ImportSpecifier') {
|
|
33234
|
-
imported = specifier.imported;
|
|
33235
|
-
}
|
|
33236
|
-
|
|
33237
|
-
if (imported !== void 0) {
|
|
33238
|
-
return imported.type === 'Identifier' ? imported.name !== 'default' : imported.value !== 'default';
|
|
33239
|
-
}
|
|
33240
|
-
});
|
|
33241
|
-
|
|
33242
|
-
if (nonDefaultNamedSpecifier !== void 0) {
|
|
33243
|
-
this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start);
|
|
33244
|
-
}
|
|
33245
|
-
}
|
|
33246
33126
|
}
|
|
33247
33127
|
}
|
|
33248
33128
|
|
|
@@ -33258,10 +33138,6 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33258
33138
|
return;
|
|
33259
33139
|
}
|
|
33260
33140
|
|
|
33261
|
-
if (this.hasPlugin('importReflection')) {
|
|
33262
|
-
node.module = false;
|
|
33263
|
-
}
|
|
33264
|
-
|
|
33265
33141
|
if (phase === 'source') {
|
|
33266
33142
|
this.expectPlugin('sourcePhaseImports', loc);
|
|
33267
33143
|
node.phase = 'source';
|
|
@@ -33327,8 +33203,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33327
33203
|
node.specifiers ?? (node.specifiers = []);
|
|
33328
33204
|
node.source = this.parseImportSource();
|
|
33329
33205
|
this.maybeParseImportAttributes(node);
|
|
33330
|
-
this.
|
|
33331
|
-
this.checkJSONModuleImport(node);
|
|
33206
|
+
this.checkImportPhase(node);
|
|
33332
33207
|
this.semicolon();
|
|
33333
33208
|
this.sawUnambiguousESM = true;
|
|
33334
33209
|
return this.finishNode(node, 'ImportDeclaration');
|
|
@@ -33393,39 +33268,6 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33393
33268
|
return attrs;
|
|
33394
33269
|
}
|
|
33395
33270
|
|
|
33396
|
-
parseModuleAttributes() {
|
|
33397
|
-
const attrs = [];
|
|
33398
|
-
const attributes = /* @__PURE__ */new Set();
|
|
33399
|
-
|
|
33400
|
-
do {
|
|
33401
|
-
const node = this.startNode();
|
|
33402
|
-
|
|
33403
|
-
node.key = this.parseIdentifier(true);
|
|
33404
|
-
|
|
33405
|
-
if (node.key.name !== 'type') {
|
|
33406
|
-
this.raise(Errors.ModuleAttributeDifferentFromType, node.key);
|
|
33407
|
-
}
|
|
33408
|
-
|
|
33409
|
-
if (attributes.has(node.key.name)) {
|
|
33410
|
-
this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, {
|
|
33411
|
-
key: node.key.name,
|
|
33412
|
-
});
|
|
33413
|
-
}
|
|
33414
|
-
|
|
33415
|
-
attributes.add(node.key.name);
|
|
33416
|
-
this.expect(14);
|
|
33417
|
-
|
|
33418
|
-
if (!this.match(134)) {
|
|
33419
|
-
throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
|
33420
|
-
}
|
|
33421
|
-
|
|
33422
|
-
node.value = this.parseStringLiteral(this.state.value);
|
|
33423
|
-
attrs.push(this.finishNode(node, 'ImportAttribute'));
|
|
33424
|
-
} while (this.eat(12))
|
|
33425
|
-
|
|
33426
|
-
return attrs;
|
|
33427
|
-
}
|
|
33428
|
-
|
|
33429
33271
|
maybeParseImportAttributes(node) {
|
|
33430
33272
|
let attributes;
|
|
33431
33273
|
|
|
@@ -33615,7 +33457,9 @@ var Parser = class extends StatementParser {
|
|
|
33615
33457
|
|
|
33616
33458
|
function parse(input, options) {
|
|
33617
33459
|
if (options?.sourceType === 'unambiguous') {
|
|
33618
|
-
options =
|
|
33460
|
+
options = {
|
|
33461
|
+
...options,
|
|
33462
|
+
};
|
|
33619
33463
|
try {
|
|
33620
33464
|
options.sourceType = 'module';
|
|
33621
33465
|
const parser = getParser(options, input);
|
|
@@ -34415,12 +34259,17 @@ function highlight(text) {
|
|
|
34415
34259
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
34416
34260
|
|
|
34417
34261
|
function getMarkerLines(loc, source, opts) {
|
|
34418
|
-
const startLoc =
|
|
34262
|
+
const startLoc = {
|
|
34419
34263
|
column: 0,
|
|
34420
34264
|
line: -1,
|
|
34421
|
-
|
|
34265
|
+
...loc.start,
|
|
34266
|
+
};
|
|
34267
|
+
|
|
34268
|
+
const endLoc = {
|
|
34269
|
+
...startLoc,
|
|
34270
|
+
...loc.end,
|
|
34271
|
+
};
|
|
34422
34272
|
|
|
34423
|
-
const endLoc = Object.assign({}, startLoc, loc.end);
|
|
34424
34273
|
const {linesAbove = 2, linesBelow = 3} = opts || {};
|
|
34425
34274
|
|
|
34426
34275
|
const startLine = startLoc.line;
|
|
@@ -34618,29 +34467,6 @@ var program$1 = {
|
|
|
34618
34467
|
unwrap: (ast) => ast.program,
|
|
34619
34468
|
};
|
|
34620
34469
|
|
|
34621
|
-
function _objectWithoutPropertiesLoose2(r, e) {
|
|
34622
|
-
if (null == r)
|
|
34623
|
-
return {};
|
|
34624
|
-
|
|
34625
|
-
var t = {};
|
|
34626
|
-
|
|
34627
|
-
for (var n2 in r) if ({}.hasOwnProperty.call(r, n2)) {
|
|
34628
|
-
if (-1 !== e.indexOf(n2))
|
|
34629
|
-
continue;
|
|
34630
|
-
|
|
34631
|
-
t[n2] = r[n2];
|
|
34632
|
-
}
|
|
34633
|
-
|
|
34634
|
-
return t;
|
|
34635
|
-
}
|
|
34636
|
-
|
|
34637
|
-
var _excluded2 = [
|
|
34638
|
-
'placeholderWhitelist',
|
|
34639
|
-
'placeholderPattern',
|
|
34640
|
-
'preserveComments',
|
|
34641
|
-
'syntacticPlaceholders',
|
|
34642
|
-
];
|
|
34643
|
-
|
|
34644
34470
|
function merge(a, b2) {
|
|
34645
34471
|
const {
|
|
34646
34472
|
placeholderWhitelist = a.placeholderWhitelist,
|
|
@@ -34650,7 +34476,10 @@ function merge(a, b2) {
|
|
|
34650
34476
|
} = b2;
|
|
34651
34477
|
|
|
34652
34478
|
return {
|
|
34653
|
-
parser:
|
|
34479
|
+
parser: {
|
|
34480
|
+
...a.parser,
|
|
34481
|
+
...b2.parser,
|
|
34482
|
+
},
|
|
34654
34483
|
placeholderWhitelist,
|
|
34655
34484
|
placeholderPattern,
|
|
34656
34485
|
preserveComments,
|
|
@@ -34663,12 +34492,13 @@ function validate$12(opts) {
|
|
|
34663
34492
|
throw new Error('Unknown template options.');
|
|
34664
34493
|
}
|
|
34665
34494
|
|
|
34666
|
-
const
|
|
34667
|
-
|
|
34668
|
-
|
|
34669
|
-
|
|
34670
|
-
|
|
34671
|
-
|
|
34495
|
+
const {
|
|
34496
|
+
placeholderWhitelist,
|
|
34497
|
+
placeholderPattern,
|
|
34498
|
+
preserveComments,
|
|
34499
|
+
syntacticPlaceholders,
|
|
34500
|
+
...parser
|
|
34501
|
+
} = opts || {};
|
|
34672
34502
|
|
|
34673
34503
|
if (placeholderWhitelist != null && !(placeholderWhitelist instanceof Set)) {
|
|
34674
34504
|
throw new Error('\'.placeholderWhitelist\' must be a Set, null, or undefined');
|
|
@@ -34757,9 +34587,10 @@ function parseAndBuildMetadata(formatter, code2, opts) {
|
|
|
34757
34587
|
};
|
|
34758
34588
|
|
|
34759
34589
|
traverse2(ast, placeholderVisitorHandler, state);
|
|
34760
|
-
return
|
|
34590
|
+
return {
|
|
34761
34591
|
ast,
|
|
34762
|
-
|
|
34592
|
+
...state.syntactic.placeholders.length ? state.syntactic : state.legacy,
|
|
34593
|
+
};
|
|
34763
34594
|
}
|
|
34764
34595
|
|
|
34765
34596
|
function placeholderVisitorHandler(node, ancestors, state) {
|
|
@@ -34854,16 +34685,16 @@ function parseWithCodeFrame(code2, parserOpts, syntacticPlaceholders) {
|
|
|
34854
34685
|
plugins.push('placeholders');
|
|
34855
34686
|
}
|
|
34856
34687
|
|
|
34857
|
-
parserOpts =
|
|
34688
|
+
parserOpts = {
|
|
34858
34689
|
allowAwaitOutsideFunction: true,
|
|
34859
34690
|
allowReturnOutsideFunction: true,
|
|
34860
34691
|
allowNewTargetOutsideFunction: true,
|
|
34861
34692
|
allowSuperOutsideMethod: true,
|
|
34862
34693
|
allowYieldOutsideFunction: true,
|
|
34863
34694
|
sourceType: 'module',
|
|
34864
|
-
|
|
34695
|
+
...parserOpts,
|
|
34865
34696
|
plugins,
|
|
34866
|
-
}
|
|
34697
|
+
};
|
|
34867
34698
|
try {
|
|
34868
34699
|
return parse(code2, parserOpts);
|
|
34869
34700
|
} catch(err) {
|
|
@@ -37823,7 +37654,7 @@ function NewExpression2(node, parent) {
|
|
|
37823
37654
|
this.space();
|
|
37824
37655
|
this.print(node.callee);
|
|
37825
37656
|
|
|
37826
|
-
if (this.format.minified && node.arguments.length === 0 && !
|
|
37657
|
+
if (this.format.minified && node.arguments.length === 0 && !isCallExpression3(parent, {callee: node}) && !isMemberExpression2(parent) && !isNewExpression3(parent)) {
|
|
37827
37658
|
return;
|
|
37828
37659
|
}
|
|
37829
37660
|
|
|
@@ -37853,10 +37684,6 @@ function Super2() {
|
|
|
37853
37684
|
}
|
|
37854
37685
|
|
|
37855
37686
|
function _shouldPrintDecoratorsBeforeExport(node) {
|
|
37856
|
-
if (typeof this.format.decoratorsBeforeExport === 'boolean') {
|
|
37857
|
-
return this.format.decoratorsBeforeExport;
|
|
37858
|
-
}
|
|
37859
|
-
|
|
37860
37687
|
return typeof node.start === 'number' && node.start === node.declaration.start;
|
|
37861
37688
|
}
|
|
37862
37689
|
|
|
@@ -38060,6 +37887,7 @@ var {
|
|
|
38060
37887
|
isForStatement: isForStatement2,
|
|
38061
37888
|
isIfStatement: isIfStatement2,
|
|
38062
37889
|
isStatement: isStatement$3,
|
|
37890
|
+
isVoidPattern: isVoidPattern2,
|
|
38063
37891
|
} = lib_exports;
|
|
38064
37892
|
|
|
38065
37893
|
function WithStatement2(node) {
|
|
@@ -38347,7 +38175,9 @@ function VariableDeclarator2(node) {
|
|
|
38347
38175
|
if (node.definite)
|
|
38348
38176
|
this.tokenChar(33);
|
|
38349
38177
|
|
|
38350
|
-
|
|
38178
|
+
if (!isVoidPattern2(node.id)) {
|
|
38179
|
+
this.print(node.id.typeAnnotation);
|
|
38180
|
+
}
|
|
38351
38181
|
|
|
38352
38182
|
if (node.init) {
|
|
38353
38183
|
this.space();
|
|
@@ -39385,7 +39215,7 @@ function DeclareFunction2(node, parent) {
|
|
|
39385
39215
|
this.word('function');
|
|
39386
39216
|
this.space();
|
|
39387
39217
|
this.print(node.id);
|
|
39388
|
-
this.print(node.id.typeAnnotation
|
|
39218
|
+
this.print(node.id.typeAnnotation?.typeAnnotation);
|
|
39389
39219
|
|
|
39390
39220
|
if (node.predicate) {
|
|
39391
39221
|
this.space();
|
|
@@ -42318,11 +42148,12 @@ function normalizeOptions(code2, opts, ast) {
|
|
|
42318
42148
|
adjustMultilineComment: true,
|
|
42319
42149
|
style: ' ',
|
|
42320
42150
|
},
|
|
42321
|
-
jsescOption:
|
|
42151
|
+
jsescOption: {
|
|
42322
42152
|
quotes: 'double',
|
|
42323
42153
|
wrap: true,
|
|
42324
42154
|
minimal: true,
|
|
42325
|
-
|
|
42155
|
+
...opts.jsescOption,
|
|
42156
|
+
},
|
|
42326
42157
|
topicToken: opts.topicToken,
|
|
42327
42158
|
};
|
|
42328
42159
|
|
|
@@ -42867,7 +42698,9 @@ function explode$1(visitor) {
|
|
|
42867
42698
|
if (existing) {
|
|
42868
42699
|
mergePair(existing, fns);
|
|
42869
42700
|
} else {
|
|
42870
|
-
visitor[alias2] =
|
|
42701
|
+
visitor[alias2] = {
|
|
42702
|
+
...fns,
|
|
42703
|
+
};
|
|
42871
42704
|
}
|
|
42872
42705
|
}
|
|
42873
42706
|
}
|
|
@@ -42899,7 +42732,7 @@ function verify$1(visitor) {
|
|
|
42899
42732
|
continue;
|
|
42900
42733
|
|
|
42901
42734
|
if (!TYPES2.includes(nodeType)) {
|
|
42902
|
-
throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${'
|
|
42735
|
+
throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${'7.28.5'}`);
|
|
42903
42736
|
}
|
|
42904
42737
|
|
|
42905
42738
|
const visitors2 = visitor[nodeType];
|
|
@@ -43218,8 +43051,8 @@ function traverseForScope(path, visitors2, state) {
|
|
|
43218
43051
|
throw new Error('Should not be used with enter/exit visitors.');
|
|
43219
43052
|
}
|
|
43220
43053
|
|
|
43221
|
-
|
|
43222
|
-
function
|
|
43054
|
+
_traverse(path.parentPath, path.parent, path.node, path.container, path.key, path.listKey, path.hub, path);
|
|
43055
|
+
function _traverse(parentPath, parent, node, container, key, listKey, hub, inPath) {
|
|
43223
43056
|
if (!node) {
|
|
43224
43057
|
return;
|
|
43225
43058
|
}
|
|
@@ -43261,10 +43094,10 @@ function traverseForScope(path, visitors2, state) {
|
|
|
43261
43094
|
if (Array.isArray(prop)) {
|
|
43262
43095
|
for (let i = 0; i < prop.length; i++) {
|
|
43263
43096
|
const value = prop[i];
|
|
43264
|
-
|
|
43097
|
+
_traverse(path2, node, value, prop, i, key2);
|
|
43265
43098
|
}
|
|
43266
43099
|
} else {
|
|
43267
|
-
|
|
43100
|
+
_traverse(path2, node, prop, node, key2, null);
|
|
43268
43101
|
}
|
|
43269
43102
|
}
|
|
43270
43103
|
|
|
@@ -46717,8 +46550,9 @@ function arrowFunctionToExpression({allowInsertArrow = true, allowInsertArrowWit
|
|
|
46717
46550
|
}
|
|
46718
46551
|
|
|
46719
46552
|
fn.get('body').unshiftContainer('body', expressionStatement3(callExpression2(this.hub.addHelper('newArrowCheck'), [thisExpression2(), checkBinding ? identifier3(checkBinding.name) : identifier3(thisBinding)])));
|
|
46720
|
-
fn
|
|
46721
|
-
|
|
46553
|
+
return fn
|
|
46554
|
+
.replaceWith(callExpression2(memberExpression2(fn.node, identifier3('bind')), [checkBinding ? identifier3(checkBinding.name) : thisExpression2()]))[0]
|
|
46555
|
+
.get('callee.object');
|
|
46722
46556
|
}
|
|
46723
46557
|
|
|
46724
46558
|
return fn;
|
|
@@ -46759,8 +46593,9 @@ function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow =
|
|
|
46759
46593
|
if (arrowParent) {
|
|
46760
46594
|
thisEnvFn = arrowParent;
|
|
46761
46595
|
} else if (allowInsertArrow) {
|
|
46762
|
-
|
|
46763
|
-
|
|
46596
|
+
thisEnvFn = fnPath
|
|
46597
|
+
.replaceWith(callExpression2(arrowFunctionExpression2([], toExpression2(fnPath.node)), []))[0]
|
|
46598
|
+
.get('callee');
|
|
46764
46599
|
fnPath = thisEnvFn.get('body');
|
|
46765
46600
|
} else {
|
|
46766
46601
|
throw fnPath.buildCodeFrameError('Unable to transform arrow inside class property');
|
|
@@ -46872,8 +46707,9 @@ function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow =
|
|
|
46872
46707
|
} else if (isAssignment) {
|
|
46873
46708
|
superParentPath.replaceWith(call2);
|
|
46874
46709
|
} else if (isTaggedTemplate) {
|
|
46875
|
-
|
|
46876
|
-
|
|
46710
|
+
thisPaths.push(superProp
|
|
46711
|
+
.replaceWith(callExpression2(memberExpression2(call2, identifier3('bind'), false), [thisExpression2()]))[0]
|
|
46712
|
+
.get('arguments.0'));
|
|
46877
46713
|
} else {
|
|
46878
46714
|
superProp.replaceWith(call2);
|
|
46879
46715
|
}
|
|
@@ -46952,9 +46788,9 @@ function standardizeSuperProperty(superProp) {
|
|
|
46952
46788
|
parts.push(identifier3(tmp.name));
|
|
46953
46789
|
}
|
|
46954
46790
|
|
|
46955
|
-
updateExpr.replaceWith(sequenceExpression2(parts));
|
|
46956
|
-
const left =
|
|
46957
|
-
const right =
|
|
46791
|
+
const sequenceExpr = updateExpr.replaceWith(sequenceExpression2(parts))[0];
|
|
46792
|
+
const left = sequenceExpr.get('expressions.0.right');
|
|
46793
|
+
const right = sequenceExpr.get('expressions.1.left');
|
|
46958
46794
|
|
|
46959
46795
|
return [left, right];
|
|
46960
46796
|
}
|
|
@@ -47899,9 +47735,10 @@ function getStatementListCompletion(paths, context) {
|
|
|
47899
47735
|
|
|
47900
47736
|
for (let i = 0; i < paths.length; i++) {
|
|
47901
47737
|
const path = paths[i];
|
|
47902
|
-
const newContext =
|
|
47738
|
+
const newContext = {
|
|
47739
|
+
...context,
|
|
47903
47740
|
inCaseClause: false,
|
|
47904
|
-
}
|
|
47741
|
+
};
|
|
47905
47742
|
|
|
47906
47743
|
if (path.isBlockStatement() && (context.inCaseClause || context.shouldPopulateBreak)) {
|
|
47907
47744
|
newContext.shouldPopulateBreak = true;
|
|
@@ -48737,7 +48574,7 @@ function _visit(ctx, path) {
|
|
|
48737
48574
|
}
|
|
48738
48575
|
|
|
48739
48576
|
const opts = ctx.opts;
|
|
48740
|
-
const denylist = opts.denylist
|
|
48577
|
+
const denylist = opts.denylist;
|
|
48741
48578
|
|
|
48742
48579
|
if (denylist?.includes(node.type)) {
|
|
48743
48580
|
return false;
|
|
@@ -48758,7 +48595,7 @@ function _visit(ctx, path) {
|
|
|
48758
48595
|
return path.shouldStop;
|
|
48759
48596
|
}
|
|
48760
48597
|
|
|
48761
|
-
path.shouldStop =
|
|
48598
|
+
path.shouldStop = traverseNode(path.node, opts, path.scope, ctx.state, path, path.skipKeys);
|
|
48762
48599
|
|
|
48763
48600
|
if (path.node) {
|
|
48764
48601
|
if (_call.call(path, opts.exit))
|
|
@@ -48772,7 +48609,7 @@ function _visit(ctx, path) {
|
|
|
48772
48609
|
return path.shouldStop;
|
|
48773
48610
|
}
|
|
48774
48611
|
|
|
48775
|
-
function
|
|
48612
|
+
function traverseNode(node, opts, scope2, state, path, skipKeys, visitSelf) {
|
|
48776
48613
|
const keys2 = VISITOR_KEYS$12[node.type];
|
|
48777
48614
|
|
|
48778
48615
|
if (!keys2?.length)
|
|
@@ -48828,10 +48665,6 @@ function _traverse(node, opts, scope2, state, path, skipKeys, visitSelf) {
|
|
|
48828
48665
|
return false;
|
|
48829
48666
|
}
|
|
48830
48667
|
|
|
48831
|
-
function traverseNode(node, opts, scope2, state, path, skipKeys, visitSelf) {
|
|
48832
|
-
return _traverse(node, opts, scope2, state, path, skipKeys, visitSelf);
|
|
48833
|
-
}
|
|
48834
|
-
|
|
48835
48668
|
function call(key) {
|
|
48836
48669
|
const opts = this.opts;
|
|
48837
48670
|
this.debug(key);
|
|
@@ -48882,8 +48715,7 @@ function _call(fns) {
|
|
|
48882
48715
|
}
|
|
48883
48716
|
|
|
48884
48717
|
function isDenylisted() {
|
|
48885
|
-
|
|
48886
|
-
return denylist?.includes(this.node.type);
|
|
48718
|
+
return !!this.opts.denylist?.includes(this.node.type);
|
|
48887
48719
|
}
|
|
48888
48720
|
|
|
48889
48721
|
function restoreContext(path, context) {
|