@putout/babel 5.2.5 → 5.2.7
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 +517 -769
- package/bundle/metafile-esm.json +1 -1
- package/package.json +1 -1
package/bundle/index.js
CHANGED
|
@@ -676,9 +676,6 @@ __export(lib_exports, {
|
|
|
676
676
|
PROPERTY_TYPES: () => PROPERTY_TYPES,
|
|
677
677
|
PUREISH_TYPES: () => PUREISH_TYPES,
|
|
678
678
|
ParenthesizedExpression: () => ParenthesizedExpression,
|
|
679
|
-
PipelineBareFunction: () => PipelineBareFunction,
|
|
680
|
-
PipelinePrimaryTopicReference: () => PipelinePrimaryTopicReference,
|
|
681
|
-
PipelineTopicExpression: () => PipelineTopicExpression,
|
|
682
679
|
Placeholder: () => Placeholder,
|
|
683
680
|
PrivateName: () => PrivateName,
|
|
684
681
|
Program: () => Program,
|
|
@@ -992,9 +989,6 @@ __export(lib_exports, {
|
|
|
992
989
|
assertParenthesizedExpression: () => assertParenthesizedExpression,
|
|
993
990
|
assertPattern: () => assertPattern,
|
|
994
991
|
assertPatternLike: () => assertPatternLike,
|
|
995
|
-
assertPipelineBareFunction: () => assertPipelineBareFunction,
|
|
996
|
-
assertPipelinePrimaryTopicReference: () => assertPipelinePrimaryTopicReference,
|
|
997
|
-
assertPipelineTopicExpression: () => assertPipelineTopicExpression,
|
|
998
992
|
assertPlaceholder: () => assertPlaceholder,
|
|
999
993
|
assertPrivate: () => assertPrivate,
|
|
1000
994
|
assertPrivateName: () => assertPrivateName,
|
|
@@ -1409,9 +1403,6 @@ __export(lib_exports, {
|
|
|
1409
1403
|
isParenthesizedExpression: () => isParenthesizedExpression,
|
|
1410
1404
|
isPattern: () => isPattern,
|
|
1411
1405
|
isPatternLike: () => isPatternLike,
|
|
1412
|
-
isPipelineBareFunction: () => isPipelineBareFunction,
|
|
1413
|
-
isPipelinePrimaryTopicReference: () => isPipelinePrimaryTopicReference,
|
|
1414
|
-
isPipelineTopicExpression: () => isPipelineTopicExpression,
|
|
1415
1406
|
isPlaceholder: () => isPlaceholder,
|
|
1416
1407
|
isPlaceholderType: () => isPlaceholderType,
|
|
1417
1408
|
isPrivate: () => isPrivate,
|
|
@@ -1596,9 +1587,6 @@ __export(lib_exports, {
|
|
|
1596
1587
|
optionalIndexedAccessType: () => optionalIndexedAccessType,
|
|
1597
1588
|
optionalMemberExpression: () => optionalMemberExpression,
|
|
1598
1589
|
parenthesizedExpression: () => parenthesizedExpression,
|
|
1599
|
-
pipelineBareFunction: () => pipelineBareFunction,
|
|
1600
|
-
pipelinePrimaryTopicReference: () => pipelinePrimaryTopicReference,
|
|
1601
|
-
pipelineTopicExpression: () => pipelineTopicExpression,
|
|
1602
1590
|
placeholder: () => placeholder,
|
|
1603
1591
|
prependToMemberExpression: () => prependToMemberExpression,
|
|
1604
1592
|
privateName: () => privateName,
|
|
@@ -4102,16 +4090,6 @@ function isClassProperty(node, opts) {
|
|
|
4102
4090
|
return opts == null || shallowEqual(node, opts);
|
|
4103
4091
|
}
|
|
4104
4092
|
|
|
4105
|
-
function isClassAccessorProperty(node, opts) {
|
|
4106
|
-
if (!node)
|
|
4107
|
-
return false;
|
|
4108
|
-
|
|
4109
|
-
if (node.type !== 'ClassAccessorProperty')
|
|
4110
|
-
return false;
|
|
4111
|
-
|
|
4112
|
-
return opts == null || shallowEqual(node, opts);
|
|
4113
|
-
}
|
|
4114
|
-
|
|
4115
4093
|
function isClassPrivateProperty(node, opts) {
|
|
4116
4094
|
if (!node)
|
|
4117
4095
|
return false;
|
|
@@ -5002,6 +4980,16 @@ function isBindExpression(node, opts) {
|
|
|
5002
4980
|
return opts == null || shallowEqual(node, opts);
|
|
5003
4981
|
}
|
|
5004
4982
|
|
|
4983
|
+
function isClassAccessorProperty(node, opts) {
|
|
4984
|
+
if (!node)
|
|
4985
|
+
return false;
|
|
4986
|
+
|
|
4987
|
+
if (node.type !== 'ClassAccessorProperty')
|
|
4988
|
+
return false;
|
|
4989
|
+
|
|
4990
|
+
return opts == null || shallowEqual(node, opts);
|
|
4991
|
+
}
|
|
4992
|
+
|
|
5005
4993
|
function isDecorator(node, opts) {
|
|
5006
4994
|
if (!node)
|
|
5007
4995
|
return false;
|
|
@@ -5052,36 +5040,6 @@ function isTopicReference(node, opts) {
|
|
|
5052
5040
|
return opts == null || shallowEqual(node, opts);
|
|
5053
5041
|
}
|
|
5054
5042
|
|
|
5055
|
-
function isPipelineTopicExpression(node, opts) {
|
|
5056
|
-
if (!node)
|
|
5057
|
-
return false;
|
|
5058
|
-
|
|
5059
|
-
if (node.type !== 'PipelineTopicExpression')
|
|
5060
|
-
return false;
|
|
5061
|
-
|
|
5062
|
-
return opts == null || shallowEqual(node, opts);
|
|
5063
|
-
}
|
|
5064
|
-
|
|
5065
|
-
function isPipelineBareFunction(node, opts) {
|
|
5066
|
-
if (!node)
|
|
5067
|
-
return false;
|
|
5068
|
-
|
|
5069
|
-
if (node.type !== 'PipelineBareFunction')
|
|
5070
|
-
return false;
|
|
5071
|
-
|
|
5072
|
-
return opts == null || shallowEqual(node, opts);
|
|
5073
|
-
}
|
|
5074
|
-
|
|
5075
|
-
function isPipelinePrimaryTopicReference(node, opts) {
|
|
5076
|
-
if (!node)
|
|
5077
|
-
return false;
|
|
5078
|
-
|
|
5079
|
-
if (node.type !== 'PipelinePrimaryTopicReference')
|
|
5080
|
-
return false;
|
|
5081
|
-
|
|
5082
|
-
return opts == null || shallowEqual(node, opts);
|
|
5083
|
-
}
|
|
5084
|
-
|
|
5085
5043
|
function isVoidPattern(node, opts) {
|
|
5086
5044
|
if (!node)
|
|
5087
5045
|
return false;
|
|
@@ -5860,7 +5818,6 @@ function isStandardized(node, opts) {
|
|
|
5860
5818
|
case 'OptionalMemberExpression':
|
|
5861
5819
|
case 'OptionalCallExpression':
|
|
5862
5820
|
case 'ClassProperty':
|
|
5863
|
-
case 'ClassAccessorProperty':
|
|
5864
5821
|
case 'ClassPrivateProperty':
|
|
5865
5822
|
case 'ClassPrivateMethod':
|
|
5866
5823
|
case 'PrivateName':
|
|
@@ -5935,9 +5892,6 @@ function isExpression(node, opts) {
|
|
|
5935
5892
|
case 'DoExpression':
|
|
5936
5893
|
case 'ModuleExpression':
|
|
5937
5894
|
case 'TopicReference':
|
|
5938
|
-
case 'PipelineTopicExpression':
|
|
5939
|
-
case 'PipelineBareFunction':
|
|
5940
|
-
case 'PipelinePrimaryTopicReference':
|
|
5941
5895
|
case 'TSInstantiationExpression':
|
|
5942
5896
|
case 'TSAsExpression':
|
|
5943
5897
|
case 'TSSatisfiesExpression':
|
|
@@ -6629,8 +6583,8 @@ function isProperty(node, opts) {
|
|
|
6629
6583
|
switch(node.type) {
|
|
6630
6584
|
case 'ObjectProperty':
|
|
6631
6585
|
case 'ClassProperty':
|
|
6632
|
-
case '
|
|
6633
|
-
case '
|
|
6586
|
+
case 'ClassPrivateProperty':
|
|
6587
|
+
case 'ClassAccessorProperty':
|
|
6634
6588
|
break;
|
|
6635
6589
|
|
|
6636
6590
|
default:
|
|
@@ -6756,22 +6710,6 @@ function isModuleSpecifier(node, opts) {
|
|
|
6756
6710
|
return opts == null || shallowEqual(node, opts);
|
|
6757
6711
|
}
|
|
6758
6712
|
|
|
6759
|
-
function isAccessor(node, opts) {
|
|
6760
|
-
if (!node)
|
|
6761
|
-
return false;
|
|
6762
|
-
|
|
6763
|
-
switch(node.type) {
|
|
6764
|
-
case 'ClassAccessorProperty':
|
|
6765
|
-
break;
|
|
6766
|
-
|
|
6767
|
-
default:
|
|
6768
|
-
return false;
|
|
6769
|
-
}
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
return opts == null || shallowEqual(node, opts);
|
|
6773
|
-
}
|
|
6774
|
-
|
|
6775
6713
|
function isPrivate(node, opts) {
|
|
6776
6714
|
if (!node)
|
|
6777
6715
|
return false;
|
|
@@ -6885,6 +6823,22 @@ function isMiscellaneous(node, opts) {
|
|
|
6885
6823
|
return opts == null || shallowEqual(node, opts);
|
|
6886
6824
|
}
|
|
6887
6825
|
|
|
6826
|
+
function isAccessor(node, opts) {
|
|
6827
|
+
if (!node)
|
|
6828
|
+
return false;
|
|
6829
|
+
|
|
6830
|
+
switch(node.type) {
|
|
6831
|
+
case 'ClassAccessorProperty':
|
|
6832
|
+
break;
|
|
6833
|
+
|
|
6834
|
+
default:
|
|
6835
|
+
return false;
|
|
6836
|
+
}
|
|
6837
|
+
|
|
6838
|
+
|
|
6839
|
+
return opts == null || shallowEqual(node, opts);
|
|
6840
|
+
}
|
|
6841
|
+
|
|
6888
6842
|
function isTypeScript(node, opts) {
|
|
6889
6843
|
if (!node)
|
|
6890
6844
|
return false;
|
|
@@ -7387,6 +7341,14 @@ function validateOptional(validate4) {
|
|
|
7387
7341
|
};
|
|
7388
7342
|
}
|
|
7389
7343
|
|
|
7344
|
+
function validateDefault(validate4, defaultValue) {
|
|
7345
|
+
return {
|
|
7346
|
+
validate: validate4,
|
|
7347
|
+
default: defaultValue,
|
|
7348
|
+
optional: false,
|
|
7349
|
+
};
|
|
7350
|
+
}
|
|
7351
|
+
|
|
7390
7352
|
function validateOptionalType(...typeNames) {
|
|
7391
7353
|
return {
|
|
7392
7354
|
validate: assertNodeType(...typeNames),
|
|
@@ -7627,6 +7589,12 @@ function defineAliasedType(...aliases) {
|
|
|
7627
7589
|
|
|
7628
7590
|
function defineType$5(type, opts = {}) {
|
|
7629
7591
|
const inherits3 = opts.inherits && store[opts.inherits] || {};
|
|
7592
|
+
const visitor = opts.visitor || inherits3.visitor || [];
|
|
7593
|
+
const aliases = opts.aliases || inherits3.aliases || [];
|
|
7594
|
+
const builder = opts.builder
|
|
7595
|
+
|| inherits3.builder
|
|
7596
|
+
|| opts.visitor
|
|
7597
|
+
|| [];
|
|
7630
7598
|
let fields = opts.fields;
|
|
7631
7599
|
|
|
7632
7600
|
if (!fields) {
|
|
@@ -7653,13 +7621,6 @@ function defineType$5(type, opts = {}) {
|
|
|
7653
7621
|
}
|
|
7654
7622
|
}
|
|
7655
7623
|
|
|
7656
|
-
const visitor = opts.visitor || inherits3.visitor || [];
|
|
7657
|
-
const aliases = opts.aliases || inherits3.aliases || [];
|
|
7658
|
-
const builder = opts.builder
|
|
7659
|
-
|| inherits3.builder
|
|
7660
|
-
|| opts.visitor
|
|
7661
|
-
|| [];
|
|
7662
|
-
|
|
7663
7624
|
for (const k of Object.keys(opts)) {
|
|
7664
7625
|
if (!validTypeOpts.has(k)) {
|
|
7665
7626
|
throw new Error(`Unknown type option "${k}" on ${type}`);
|
|
@@ -7677,12 +7638,13 @@ function defineType$5(type, opts = {}) {
|
|
|
7677
7638
|
for (const key of Object.keys(fields)) {
|
|
7678
7639
|
const field = fields[key];
|
|
7679
7640
|
|
|
7680
|
-
if (field.default
|
|
7681
|
-
field.optional
|
|
7641
|
+
if (field.default === null) {
|
|
7642
|
+
field.optional ??= true;
|
|
7682
7643
|
}
|
|
7683
7644
|
|
|
7684
7645
|
if (field.default === void 0) {
|
|
7685
7646
|
field.default = null;
|
|
7647
|
+
field.optional ??= false;
|
|
7686
7648
|
} else if (!field.validate && field.default != null) {
|
|
7687
7649
|
field.validate = assertValueType(getType(field.default));
|
|
7688
7650
|
}
|
|
@@ -7743,6 +7705,7 @@ var utils = /* @__PURE__ */Object.freeze({
|
|
|
7743
7705
|
defineAliasedType,
|
|
7744
7706
|
validate: validate$2,
|
|
7745
7707
|
validateArrayOfType,
|
|
7708
|
+
validateDefault,
|
|
7746
7709
|
validateOptional,
|
|
7747
7710
|
validateOptionalType,
|
|
7748
7711
|
validateType,
|
|
@@ -8982,6 +8945,17 @@ defineType$4('ArrowFunctionExpression', {
|
|
|
8982
8945
|
],
|
|
8983
8946
|
fields: {
|
|
8984
8947
|
...functionCommon(),
|
|
8948
|
+
generator: {
|
|
8949
|
+
default: null,
|
|
8950
|
+
optional: true,
|
|
8951
|
+
validate: Object.assign((node, key, val) => {
|
|
8952
|
+
if (val) {
|
|
8953
|
+
throw new TypeError('ArrowFunctionExpression cannot be a generator');
|
|
8954
|
+
}
|
|
8955
|
+
}, {
|
|
8956
|
+
type: 'boolean',
|
|
8957
|
+
}),
|
|
8958
|
+
},
|
|
8985
8959
|
...functionTypeAnnotationCommon(),
|
|
8986
8960
|
expression: {
|
|
8987
8961
|
validate: assertValueType('boolean'),
|
|
@@ -9124,12 +9098,7 @@ var importAttributes = {
|
|
|
9124
9098
|
};
|
|
9125
9099
|
|
|
9126
9100
|
defineType$4('ExportAllDeclaration', {
|
|
9127
|
-
|
|
9128
|
-
visitor: [
|
|
9129
|
-
'source',
|
|
9130
|
-
'attributes',
|
|
9131
|
-
'assertions',
|
|
9132
|
-
],
|
|
9101
|
+
visitor: ['source', 'attributes'],
|
|
9133
9102
|
aliases: [
|
|
9134
9103
|
'Statement',
|
|
9135
9104
|
'Declaration',
|
|
@@ -9162,6 +9131,7 @@ defineType$4('ExportNamedDeclaration', {
|
|
|
9162
9131
|
'declaration',
|
|
9163
9132
|
'specifiers',
|
|
9164
9133
|
'source',
|
|
9134
|
+
'attributes',
|
|
9165
9135
|
],
|
|
9166
9136
|
visitor: [
|
|
9167
9137
|
'declaration',
|
|
@@ -9291,7 +9261,11 @@ defineType$4('ForOfStatement', {
|
|
|
9291
9261
|
},
|
|
9292
9262
|
});
|
|
9293
9263
|
defineType$4('ImportDeclaration', {
|
|
9294
|
-
builder: [
|
|
9264
|
+
builder: [
|
|
9265
|
+
'specifiers',
|
|
9266
|
+
'source',
|
|
9267
|
+
'attributes',
|
|
9268
|
+
],
|
|
9295
9269
|
visitor: [
|
|
9296
9270
|
'specifiers',
|
|
9297
9271
|
'source',
|
|
@@ -9411,6 +9385,7 @@ defineType$4('MetaProperty', {
|
|
|
9411
9385
|
var classMethodOrPropertyCommon = () => ({
|
|
9412
9386
|
abstract: {
|
|
9413
9387
|
validate: assertValueType('boolean'),
|
|
9388
|
+
default: false,
|
|
9414
9389
|
optional: true,
|
|
9415
9390
|
},
|
|
9416
9391
|
accessibility: {
|
|
@@ -9421,6 +9396,8 @@ var classMethodOrPropertyCommon = () => ({
|
|
|
9421
9396
|
default: false,
|
|
9422
9397
|
},
|
|
9423
9398
|
override: {
|
|
9399
|
+
optional: true,
|
|
9400
|
+
validate: assertValueType('boolean'),
|
|
9424
9401
|
default: false,
|
|
9425
9402
|
},
|
|
9426
9403
|
computed: {
|
|
@@ -9774,66 +9751,6 @@ defineType$4('ClassProperty', {
|
|
|
9774
9751
|
},
|
|
9775
9752
|
},
|
|
9776
9753
|
});
|
|
9777
|
-
defineType$4('ClassAccessorProperty', {
|
|
9778
|
-
visitor: [
|
|
9779
|
-
'decorators',
|
|
9780
|
-
'key',
|
|
9781
|
-
'typeAnnotation',
|
|
9782
|
-
'value',
|
|
9783
|
-
],
|
|
9784
|
-
builder: [
|
|
9785
|
-
'key',
|
|
9786
|
-
'value',
|
|
9787
|
-
'typeAnnotation',
|
|
9788
|
-
'decorators',
|
|
9789
|
-
'computed',
|
|
9790
|
-
'static',
|
|
9791
|
-
],
|
|
9792
|
-
aliases: ['Property', 'Accessor'],
|
|
9793
|
-
...classMethodOrPropertyUnionShapeCommon(true),
|
|
9794
|
-
fields: {
|
|
9795
|
-
...classMethodOrPropertyCommon(),
|
|
9796
|
-
key: {
|
|
9797
|
-
validate: chain((function() {
|
|
9798
|
-
const normal = assertNodeType('Identifier', 'StringLiteral', 'NumericLiteral', 'BigIntLiteral', 'PrivateName');
|
|
9799
|
-
const computed = assertNodeType('Expression');
|
|
9800
|
-
|
|
9801
|
-
return function(node, key, val) {
|
|
9802
|
-
const validator = node.computed ? computed : normal;
|
|
9803
|
-
validator(node, key, val);
|
|
9804
|
-
};
|
|
9805
|
-
})(), assertNodeType('Identifier', 'StringLiteral', 'NumericLiteral', 'BigIntLiteral', 'Expression', 'PrivateName')),
|
|
9806
|
-
},
|
|
9807
|
-
value: {
|
|
9808
|
-
validate: assertNodeType('Expression'),
|
|
9809
|
-
optional: true,
|
|
9810
|
-
},
|
|
9811
|
-
definite: {
|
|
9812
|
-
validate: assertValueType('boolean'),
|
|
9813
|
-
optional: true,
|
|
9814
|
-
},
|
|
9815
|
-
typeAnnotation: {
|
|
9816
|
-
validate: assertNodeType('TypeAnnotation', 'TSTypeAnnotation'),
|
|
9817
|
-
optional: true,
|
|
9818
|
-
},
|
|
9819
|
-
decorators: {
|
|
9820
|
-
validate: arrayOfType('Decorator'),
|
|
9821
|
-
optional: true,
|
|
9822
|
-
},
|
|
9823
|
-
readonly: {
|
|
9824
|
-
validate: assertValueType('boolean'),
|
|
9825
|
-
optional: true,
|
|
9826
|
-
},
|
|
9827
|
-
declare: {
|
|
9828
|
-
validate: assertValueType('boolean'),
|
|
9829
|
-
optional: true,
|
|
9830
|
-
},
|
|
9831
|
-
variance: {
|
|
9832
|
-
validate: assertNodeType('Variance'),
|
|
9833
|
-
optional: true,
|
|
9834
|
-
},
|
|
9835
|
-
},
|
|
9836
|
-
});
|
|
9837
9754
|
defineType$4('ClassPrivateProperty', {
|
|
9838
9755
|
visitor: [
|
|
9839
9756
|
'decorators',
|
|
@@ -10306,7 +10223,7 @@ defineType$3('ObjectTypeCallProperty', {
|
|
|
10306
10223
|
aliases: ['UserWhitespacable'],
|
|
10307
10224
|
fields: {
|
|
10308
10225
|
value: validateType('FlowType'),
|
|
10309
|
-
static:
|
|
10226
|
+
static: validateDefault(assertValueType('boolean'), false),
|
|
10310
10227
|
},
|
|
10311
10228
|
});
|
|
10312
10229
|
defineType$3('ObjectTypeIndexer', {
|
|
@@ -10327,7 +10244,7 @@ defineType$3('ObjectTypeIndexer', {
|
|
|
10327
10244
|
id: validateOptionalType('Identifier'),
|
|
10328
10245
|
key: validateType('FlowType'),
|
|
10329
10246
|
value: validateType('FlowType'),
|
|
10330
|
-
static:
|
|
10247
|
+
static: validateDefault(assertValueType('boolean'), false),
|
|
10331
10248
|
variance: validateOptionalType('Variance'),
|
|
10332
10249
|
},
|
|
10333
10250
|
});
|
|
@@ -10341,12 +10258,16 @@ defineType$3('ObjectTypeProperty', {
|
|
|
10341
10258
|
fields: {
|
|
10342
10259
|
key: validateType('Identifier', 'StringLiteral'),
|
|
10343
10260
|
value: validateType('FlowType'),
|
|
10344
|
-
kind:
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10261
|
+
kind: {
|
|
10262
|
+
validate: assertOneOf('init', 'get', 'set'),
|
|
10263
|
+
default: 'init',
|
|
10264
|
+
optional: false,
|
|
10265
|
+
},
|
|
10266
|
+
static: validateDefault(assertValueType('boolean'), false),
|
|
10267
|
+
proto: validateDefault(assertValueType('boolean'), false),
|
|
10268
|
+
optional: validateDefault(assertValueType('boolean'), false),
|
|
10348
10269
|
variance: validateOptionalType('Variance'),
|
|
10349
|
-
method:
|
|
10270
|
+
method: validateDefault(assertValueType('boolean'), false),
|
|
10350
10271
|
},
|
|
10351
10272
|
});
|
|
10352
10273
|
defineType$3('ObjectTypeSpreadProperty', {
|
|
@@ -10445,6 +10366,12 @@ defineType$3('TypeCastExpression', {
|
|
|
10445
10366
|
},
|
|
10446
10367
|
});
|
|
10447
10368
|
defineType$3('TypeParameter', {
|
|
10369
|
+
builder: [
|
|
10370
|
+
'name',
|
|
10371
|
+
'bound',
|
|
10372
|
+
'default',
|
|
10373
|
+
'variance',
|
|
10374
|
+
],
|
|
10448
10375
|
visitor: [
|
|
10449
10376
|
'bound',
|
|
10450
10377
|
'default',
|
|
@@ -10493,31 +10420,33 @@ defineType$3('EnumDeclaration', {
|
|
|
10493
10420
|
body: validateType('EnumBooleanBody', 'EnumNumberBody', 'EnumStringBody', 'EnumSymbolBody'),
|
|
10494
10421
|
},
|
|
10495
10422
|
});
|
|
10423
|
+
var enumBodyBase = {
|
|
10424
|
+
explicitType: validateDefault(assertValueType('boolean'), false),
|
|
10425
|
+
hasUnknownMembers: validateDefault(assertValueType('boolean'), false),
|
|
10426
|
+
};
|
|
10427
|
+
|
|
10496
10428
|
defineType$3('EnumBooleanBody', {
|
|
10497
10429
|
aliases: ['EnumBody'],
|
|
10498
10430
|
visitor: ['members'],
|
|
10499
10431
|
fields: {
|
|
10500
|
-
|
|
10432
|
+
...enumBodyBase,
|
|
10501
10433
|
members: validateArrayOfType('EnumBooleanMember'),
|
|
10502
|
-
hasUnknownMembers: validate$2(assertValueType('boolean')),
|
|
10503
10434
|
},
|
|
10504
10435
|
});
|
|
10505
10436
|
defineType$3('EnumNumberBody', {
|
|
10506
10437
|
aliases: ['EnumBody'],
|
|
10507
10438
|
visitor: ['members'],
|
|
10508
10439
|
fields: {
|
|
10509
|
-
|
|
10440
|
+
...enumBodyBase,
|
|
10510
10441
|
members: validateArrayOfType('EnumNumberMember'),
|
|
10511
|
-
hasUnknownMembers: validate$2(assertValueType('boolean')),
|
|
10512
10442
|
},
|
|
10513
10443
|
});
|
|
10514
10444
|
defineType$3('EnumStringBody', {
|
|
10515
10445
|
aliases: ['EnumBody'],
|
|
10516
10446
|
visitor: ['members'],
|
|
10517
10447
|
fields: {
|
|
10518
|
-
|
|
10448
|
+
...enumBodyBase,
|
|
10519
10449
|
members: validateArrayOfType('EnumStringMember', 'EnumDefaultedMember'),
|
|
10520
|
-
hasUnknownMembers: validate$2(assertValueType('boolean')),
|
|
10521
10450
|
},
|
|
10522
10451
|
});
|
|
10523
10452
|
defineType$3('EnumSymbolBody', {
|
|
@@ -10525,12 +10454,11 @@ defineType$3('EnumSymbolBody', {
|
|
|
10525
10454
|
visitor: ['members'],
|
|
10526
10455
|
fields: {
|
|
10527
10456
|
members: validateArrayOfType('EnumDefaultedMember'),
|
|
10528
|
-
hasUnknownMembers:
|
|
10457
|
+
hasUnknownMembers: validateDefault(assertValueType('boolean'), false),
|
|
10529
10458
|
},
|
|
10530
10459
|
});
|
|
10531
10460
|
defineType$3('EnumBooleanMember', {
|
|
10532
10461
|
aliases: ['EnumMember'],
|
|
10533
|
-
builder: ['id'],
|
|
10534
10462
|
visitor: ['id', 'init'],
|
|
10535
10463
|
fields: {
|
|
10536
10464
|
id: validateType('Identifier'),
|
|
@@ -10574,7 +10502,7 @@ defineType$3('OptionalIndexedAccessType', {
|
|
|
10574
10502
|
fields: {
|
|
10575
10503
|
objectType: validateType('FlowType'),
|
|
10576
10504
|
indexType: validateType('FlowType'),
|
|
10577
|
-
optional:
|
|
10505
|
+
optional: validateDefault(assertValueType('boolean'), false),
|
|
10578
10506
|
},
|
|
10579
10507
|
});
|
|
10580
10508
|
var defineType$2 = defineAliasedType('JSX');
|
|
@@ -10816,6 +10744,66 @@ defineType$5('BindExpression', {
|
|
|
10816
10744
|
},
|
|
10817
10745
|
},
|
|
10818
10746
|
});
|
|
10747
|
+
defineType$5('ClassAccessorProperty', {
|
|
10748
|
+
visitor: [
|
|
10749
|
+
'decorators',
|
|
10750
|
+
'key',
|
|
10751
|
+
'typeAnnotation',
|
|
10752
|
+
'value',
|
|
10753
|
+
],
|
|
10754
|
+
builder: [
|
|
10755
|
+
'key',
|
|
10756
|
+
'value',
|
|
10757
|
+
'typeAnnotation',
|
|
10758
|
+
'decorators',
|
|
10759
|
+
'computed',
|
|
10760
|
+
'static',
|
|
10761
|
+
],
|
|
10762
|
+
aliases: ['Property', 'Accessor'],
|
|
10763
|
+
...classMethodOrPropertyUnionShapeCommon(true),
|
|
10764
|
+
fields: {
|
|
10765
|
+
...classMethodOrPropertyCommon(),
|
|
10766
|
+
key: {
|
|
10767
|
+
validate: chain((function() {
|
|
10768
|
+
const normal = assertNodeType('Identifier', 'StringLiteral', 'NumericLiteral', 'BigIntLiteral', 'PrivateName');
|
|
10769
|
+
const computed = assertNodeType('Expression');
|
|
10770
|
+
|
|
10771
|
+
return function(node, key, val) {
|
|
10772
|
+
const validator = node.computed ? computed : normal;
|
|
10773
|
+
validator(node, key, val);
|
|
10774
|
+
};
|
|
10775
|
+
})(), assertNodeType('Identifier', 'StringLiteral', 'NumericLiteral', 'BigIntLiteral', 'Expression', 'PrivateName')),
|
|
10776
|
+
},
|
|
10777
|
+
value: {
|
|
10778
|
+
validate: assertNodeType('Expression'),
|
|
10779
|
+
optional: true,
|
|
10780
|
+
},
|
|
10781
|
+
definite: {
|
|
10782
|
+
validate: assertValueType('boolean'),
|
|
10783
|
+
optional: true,
|
|
10784
|
+
},
|
|
10785
|
+
typeAnnotation: {
|
|
10786
|
+
validate: assertNodeType('TypeAnnotation', 'TSTypeAnnotation'),
|
|
10787
|
+
optional: true,
|
|
10788
|
+
},
|
|
10789
|
+
decorators: {
|
|
10790
|
+
validate: arrayOfType('Decorator'),
|
|
10791
|
+
optional: true,
|
|
10792
|
+
},
|
|
10793
|
+
readonly: {
|
|
10794
|
+
validate: assertValueType('boolean'),
|
|
10795
|
+
optional: true,
|
|
10796
|
+
},
|
|
10797
|
+
declare: {
|
|
10798
|
+
validate: assertValueType('boolean'),
|
|
10799
|
+
optional: true,
|
|
10800
|
+
},
|
|
10801
|
+
variance: {
|
|
10802
|
+
validate: assertNodeType('Variance'),
|
|
10803
|
+
optional: true,
|
|
10804
|
+
},
|
|
10805
|
+
},
|
|
10806
|
+
});
|
|
10819
10807
|
defineType$5('Decorator', {
|
|
10820
10808
|
visitor: ['expression'],
|
|
10821
10809
|
fields: {
|
|
@@ -10859,29 +10847,6 @@ defineType$5('ModuleExpression', {
|
|
|
10859
10847
|
defineType$5('TopicReference', {
|
|
10860
10848
|
aliases: ['Expression'],
|
|
10861
10849
|
});
|
|
10862
|
-
defineType$5('PipelineTopicExpression', {
|
|
10863
|
-
builder: ['expression'],
|
|
10864
|
-
visitor: ['expression'],
|
|
10865
|
-
fields: {
|
|
10866
|
-
expression: {
|
|
10867
|
-
validate: assertNodeType('Expression'),
|
|
10868
|
-
},
|
|
10869
|
-
},
|
|
10870
|
-
aliases: ['Expression'],
|
|
10871
|
-
});
|
|
10872
|
-
defineType$5('PipelineBareFunction', {
|
|
10873
|
-
builder: ['callee'],
|
|
10874
|
-
visitor: ['callee'],
|
|
10875
|
-
fields: {
|
|
10876
|
-
callee: {
|
|
10877
|
-
validate: assertNodeType('Expression'),
|
|
10878
|
-
},
|
|
10879
|
-
},
|
|
10880
|
-
aliases: ['Expression'],
|
|
10881
|
-
});
|
|
10882
|
-
defineType$5('PipelinePrimaryTopicReference', {
|
|
10883
|
-
aliases: ['Expression'],
|
|
10884
|
-
});
|
|
10885
10850
|
defineType$5('VoidPattern', {
|
|
10886
10851
|
aliases: [
|
|
10887
10852
|
'Pattern',
|
|
@@ -11015,6 +10980,7 @@ defineType('TSMethodSignature', {
|
|
|
11015
10980
|
...namedTypeElementCommon(),
|
|
11016
10981
|
kind: {
|
|
11017
10982
|
validate: assertOneOf('method', 'get', 'set'),
|
|
10983
|
+
default: 'method',
|
|
11018
10984
|
},
|
|
11019
10985
|
},
|
|
11020
10986
|
});
|
|
@@ -11403,15 +11369,12 @@ defineType('TSModuleDeclaration', {
|
|
|
11403
11369
|
visitor: ['id', 'body'],
|
|
11404
11370
|
fields: {
|
|
11405
11371
|
kind: {
|
|
11406
|
-
validate: assertOneOf('global', '
|
|
11372
|
+
validate: assertOneOf('global', 'namespace'),
|
|
11373
|
+
default: 'namespace',
|
|
11407
11374
|
},
|
|
11408
11375
|
declare: validateOptional(bool),
|
|
11409
11376
|
id: {
|
|
11410
11377
|
validate: chain(assertNodeType('TSEntityName', 'StringLiteral'), Object.assign(function(node, key, val) {
|
|
11411
|
-
if (node.kind === 'module' && !is('StringLiteral', val)) {
|
|
11412
|
-
throw new TypeError(`TSModuleDeclaration of kind 'module' must have a StringLiteral id.`);
|
|
11413
|
-
}
|
|
11414
|
-
|
|
11415
11378
|
if (node.kind === 'namespace' && is('StringLiteral', val)) {
|
|
11416
11379
|
throw new TypeError(`TSModuleDeclaration of kind 'namespace' cannot have a StringLiteral id.`);
|
|
11417
11380
|
}
|
|
@@ -12331,7 +12294,7 @@ function arrowFunctionExpression(params, body, async = false) {
|
|
|
12331
12294
|
params,
|
|
12332
12295
|
body,
|
|
12333
12296
|
async,
|
|
12334
|
-
expression:
|
|
12297
|
+
expression: body.type !== 'BlockStatement',
|
|
12335
12298
|
};
|
|
12336
12299
|
|
|
12337
12300
|
const defs = NODE_FIELDS.ArrowFunctionExpression;
|
|
@@ -12386,15 +12349,16 @@ function classDeclaration(id = null, superClass = null, body, decorators = null)
|
|
|
12386
12349
|
return node;
|
|
12387
12350
|
}
|
|
12388
12351
|
|
|
12389
|
-
function exportAllDeclaration(source) {
|
|
12352
|
+
function exportAllDeclaration(source, attributes = null) {
|
|
12390
12353
|
const node = {
|
|
12391
12354
|
type: 'ExportAllDeclaration',
|
|
12392
12355
|
source,
|
|
12393
|
-
|
|
12356
|
+
attributes,
|
|
12394
12357
|
};
|
|
12395
12358
|
|
|
12396
12359
|
const defs = NODE_FIELDS.ExportAllDeclaration;
|
|
12397
12360
|
validate(defs.source, node, 'source', source, 1);
|
|
12361
|
+
validate(defs.attributes, node, 'attributes', attributes, 1);
|
|
12398
12362
|
return node;
|
|
12399
12363
|
}
|
|
12400
12364
|
|
|
@@ -12409,18 +12373,20 @@ function exportDefaultDeclaration(declaration) {
|
|
|
12409
12373
|
return node;
|
|
12410
12374
|
}
|
|
12411
12375
|
|
|
12412
|
-
function exportNamedDeclaration(declaration = null, specifiers = [], source = null) {
|
|
12376
|
+
function exportNamedDeclaration(declaration = null, specifiers = [], source = null, attributes = null) {
|
|
12413
12377
|
const node = {
|
|
12414
12378
|
type: 'ExportNamedDeclaration',
|
|
12415
12379
|
declaration,
|
|
12416
12380
|
specifiers,
|
|
12417
12381
|
source,
|
|
12382
|
+
attributes,
|
|
12418
12383
|
};
|
|
12419
12384
|
|
|
12420
12385
|
const defs = NODE_FIELDS.ExportNamedDeclaration;
|
|
12421
12386
|
validate(defs.declaration, node, 'declaration', declaration, 1);
|
|
12422
12387
|
validate(defs.specifiers, node, 'specifiers', specifiers, 1);
|
|
12423
12388
|
validate(defs.source, node, 'source', source, 1);
|
|
12389
|
+
validate(defs.attributes, node, 'attributes', attributes, 1);
|
|
12424
12390
|
return node;
|
|
12425
12391
|
}
|
|
12426
12392
|
|
|
@@ -12454,16 +12420,18 @@ function forOfStatement(left, right, body, _await = false) {
|
|
|
12454
12420
|
return node;
|
|
12455
12421
|
}
|
|
12456
12422
|
|
|
12457
|
-
function importDeclaration(specifiers, source) {
|
|
12423
|
+
function importDeclaration(specifiers, source, attributes = null) {
|
|
12458
12424
|
const node = {
|
|
12459
12425
|
type: 'ImportDeclaration',
|
|
12460
12426
|
specifiers,
|
|
12461
12427
|
source,
|
|
12428
|
+
attributes,
|
|
12462
12429
|
};
|
|
12463
12430
|
|
|
12464
12431
|
const defs = NODE_FIELDS.ImportDeclaration;
|
|
12465
12432
|
validate(defs.specifiers, node, 'specifiers', specifiers, 1);
|
|
12466
12433
|
validate(defs.source, node, 'source', source, 1);
|
|
12434
|
+
validate(defs.attributes, node, 'attributes', attributes, 1);
|
|
12467
12435
|
return node;
|
|
12468
12436
|
}
|
|
12469
12437
|
|
|
@@ -12725,27 +12693,6 @@ function classProperty(key, value = null, typeAnnotation2 = null, decorators = n
|
|
|
12725
12693
|
return node;
|
|
12726
12694
|
}
|
|
12727
12695
|
|
|
12728
|
-
function classAccessorProperty(key, value = null, typeAnnotation2 = null, decorators = null, computed = false, _static = false) {
|
|
12729
|
-
const node = {
|
|
12730
|
-
type: 'ClassAccessorProperty',
|
|
12731
|
-
key,
|
|
12732
|
-
value,
|
|
12733
|
-
typeAnnotation: typeAnnotation2,
|
|
12734
|
-
decorators,
|
|
12735
|
-
computed,
|
|
12736
|
-
static: _static,
|
|
12737
|
-
};
|
|
12738
|
-
|
|
12739
|
-
const defs = NODE_FIELDS.ClassAccessorProperty;
|
|
12740
|
-
validate(defs.key, node, 'key', key, 1);
|
|
12741
|
-
validate(defs.value, node, 'value', value, 1);
|
|
12742
|
-
validate(defs.typeAnnotation, node, 'typeAnnotation', typeAnnotation2, 1);
|
|
12743
|
-
validate(defs.decorators, node, 'decorators', decorators, 1);
|
|
12744
|
-
validate(defs.computed, node, 'computed', computed);
|
|
12745
|
-
validate(defs.static, node, 'static', _static);
|
|
12746
|
-
return node;
|
|
12747
|
-
}
|
|
12748
|
-
|
|
12749
12696
|
function classPrivateProperty(key, value = null, decorators = null, _static = false) {
|
|
12750
12697
|
const node = {
|
|
12751
12698
|
type: 'ClassPrivateProperty',
|
|
@@ -12771,6 +12718,9 @@ function classPrivateMethod(kind = 'method', key, params, body, _static = false)
|
|
|
12771
12718
|
params,
|
|
12772
12719
|
body,
|
|
12773
12720
|
static: _static,
|
|
12721
|
+
async: false,
|
|
12722
|
+
computed: false,
|
|
12723
|
+
generator: false,
|
|
12774
12724
|
};
|
|
12775
12725
|
|
|
12776
12726
|
const defs = NODE_FIELDS.ClassPrivateMethod;
|
|
@@ -13214,7 +13164,7 @@ function objectTypeCallProperty(value) {
|
|
|
13214
13164
|
const node = {
|
|
13215
13165
|
type: 'ObjectTypeCallProperty',
|
|
13216
13166
|
value,
|
|
13217
|
-
static:
|
|
13167
|
+
static: false,
|
|
13218
13168
|
};
|
|
13219
13169
|
|
|
13220
13170
|
const defs = NODE_FIELDS.ObjectTypeCallProperty;
|
|
@@ -13229,7 +13179,7 @@ function objectTypeIndexer(id = null, key, value, variance2 = null) {
|
|
|
13229
13179
|
key,
|
|
13230
13180
|
value,
|
|
13231
13181
|
variance: variance2,
|
|
13232
|
-
static:
|
|
13182
|
+
static: false,
|
|
13233
13183
|
};
|
|
13234
13184
|
|
|
13235
13185
|
const defs = NODE_FIELDS.ObjectTypeIndexer;
|
|
@@ -13246,11 +13196,11 @@ function objectTypeProperty(key, value, variance2 = null) {
|
|
|
13246
13196
|
key,
|
|
13247
13197
|
value,
|
|
13248
13198
|
variance: variance2,
|
|
13249
|
-
kind:
|
|
13250
|
-
method:
|
|
13251
|
-
optional:
|
|
13252
|
-
proto:
|
|
13253
|
-
static:
|
|
13199
|
+
kind: 'init',
|
|
13200
|
+
method: false,
|
|
13201
|
+
optional: false,
|
|
13202
|
+
proto: false,
|
|
13203
|
+
static: false,
|
|
13254
13204
|
};
|
|
13255
13205
|
|
|
13256
13206
|
const defs = NODE_FIELDS.ObjectTypeProperty;
|
|
@@ -13391,16 +13341,17 @@ function typeCastExpression(expression2, typeAnnotation2) {
|
|
|
13391
13341
|
return node;
|
|
13392
13342
|
}
|
|
13393
13343
|
|
|
13394
|
-
function typeParameter(bound = null, _default = null, variance2 = null) {
|
|
13344
|
+
function typeParameter(name, bound = null, _default = null, variance2 = null) {
|
|
13395
13345
|
const node = {
|
|
13396
13346
|
type: 'TypeParameter',
|
|
13347
|
+
name,
|
|
13397
13348
|
bound,
|
|
13398
13349
|
default: _default,
|
|
13399
13350
|
variance: variance2,
|
|
13400
|
-
name: null,
|
|
13401
13351
|
};
|
|
13402
13352
|
|
|
13403
13353
|
const defs = NODE_FIELDS.TypeParameter;
|
|
13354
|
+
validate(defs.name, node, 'name', name);
|
|
13404
13355
|
validate(defs.bound, node, 'bound', bound, 1);
|
|
13405
13356
|
validate(defs.default, node, 'default', _default, 1);
|
|
13406
13357
|
validate(defs.variance, node, 'variance', variance2, 1);
|
|
@@ -13474,8 +13425,8 @@ function enumBooleanBody(members) {
|
|
|
13474
13425
|
const node = {
|
|
13475
13426
|
type: 'EnumBooleanBody',
|
|
13476
13427
|
members,
|
|
13477
|
-
explicitType:
|
|
13478
|
-
hasUnknownMembers:
|
|
13428
|
+
explicitType: false,
|
|
13429
|
+
hasUnknownMembers: false,
|
|
13479
13430
|
};
|
|
13480
13431
|
|
|
13481
13432
|
const defs = NODE_FIELDS.EnumBooleanBody;
|
|
@@ -13487,8 +13438,8 @@ function enumNumberBody(members) {
|
|
|
13487
13438
|
const node = {
|
|
13488
13439
|
type: 'EnumNumberBody',
|
|
13489
13440
|
members,
|
|
13490
|
-
explicitType:
|
|
13491
|
-
hasUnknownMembers:
|
|
13441
|
+
explicitType: false,
|
|
13442
|
+
hasUnknownMembers: false,
|
|
13492
13443
|
};
|
|
13493
13444
|
|
|
13494
13445
|
const defs = NODE_FIELDS.EnumNumberBody;
|
|
@@ -13500,8 +13451,8 @@ function enumStringBody(members) {
|
|
|
13500
13451
|
const node = {
|
|
13501
13452
|
type: 'EnumStringBody',
|
|
13502
13453
|
members,
|
|
13503
|
-
explicitType:
|
|
13504
|
-
hasUnknownMembers:
|
|
13454
|
+
explicitType: false,
|
|
13455
|
+
hasUnknownMembers: false,
|
|
13505
13456
|
};
|
|
13506
13457
|
|
|
13507
13458
|
const defs = NODE_FIELDS.EnumStringBody;
|
|
@@ -13513,7 +13464,7 @@ function enumSymbolBody(members) {
|
|
|
13513
13464
|
const node = {
|
|
13514
13465
|
type: 'EnumSymbolBody',
|
|
13515
13466
|
members,
|
|
13516
|
-
hasUnknownMembers:
|
|
13467
|
+
hasUnknownMembers: false,
|
|
13517
13468
|
};
|
|
13518
13469
|
|
|
13519
13470
|
const defs = NODE_FIELDS.EnumSymbolBody;
|
|
@@ -13521,15 +13472,16 @@ function enumSymbolBody(members) {
|
|
|
13521
13472
|
return node;
|
|
13522
13473
|
}
|
|
13523
13474
|
|
|
13524
|
-
function enumBooleanMember(id) {
|
|
13475
|
+
function enumBooleanMember(id, init) {
|
|
13525
13476
|
const node = {
|
|
13526
13477
|
type: 'EnumBooleanMember',
|
|
13527
13478
|
id,
|
|
13528
|
-
init
|
|
13479
|
+
init,
|
|
13529
13480
|
};
|
|
13530
13481
|
|
|
13531
13482
|
const defs = NODE_FIELDS.EnumBooleanMember;
|
|
13532
13483
|
validate(defs.id, node, 'id', id, 1);
|
|
13484
|
+
validate(defs.init, node, 'init', init, 1);
|
|
13533
13485
|
return node;
|
|
13534
13486
|
}
|
|
13535
13487
|
|
|
@@ -13588,7 +13540,7 @@ function optionalIndexedAccessType(objectType, indexType) {
|
|
|
13588
13540
|
type: 'OptionalIndexedAccessType',
|
|
13589
13541
|
objectType,
|
|
13590
13542
|
indexType,
|
|
13591
|
-
optional:
|
|
13543
|
+
optional: false,
|
|
13592
13544
|
};
|
|
13593
13545
|
|
|
13594
13546
|
const defs = NODE_FIELDS.OptionalIndexedAccessType;
|
|
@@ -13808,6 +13760,27 @@ function bindExpression(object, callee) {
|
|
|
13808
13760
|
return node;
|
|
13809
13761
|
}
|
|
13810
13762
|
|
|
13763
|
+
function classAccessorProperty(key, value = null, typeAnnotation2 = null, decorators = null, computed = false, _static = false) {
|
|
13764
|
+
const node = {
|
|
13765
|
+
type: 'ClassAccessorProperty',
|
|
13766
|
+
key,
|
|
13767
|
+
value,
|
|
13768
|
+
typeAnnotation: typeAnnotation2,
|
|
13769
|
+
decorators,
|
|
13770
|
+
computed,
|
|
13771
|
+
static: _static,
|
|
13772
|
+
};
|
|
13773
|
+
|
|
13774
|
+
const defs = NODE_FIELDS.ClassAccessorProperty;
|
|
13775
|
+
validate(defs.key, node, 'key', key, 1);
|
|
13776
|
+
validate(defs.value, node, 'value', value, 1);
|
|
13777
|
+
validate(defs.typeAnnotation, node, 'typeAnnotation', typeAnnotation2, 1);
|
|
13778
|
+
validate(defs.decorators, node, 'decorators', decorators, 1);
|
|
13779
|
+
validate(defs.computed, node, 'computed', computed);
|
|
13780
|
+
validate(defs.static, node, 'static', _static);
|
|
13781
|
+
return node;
|
|
13782
|
+
}
|
|
13783
|
+
|
|
13811
13784
|
function decorator(expression2) {
|
|
13812
13785
|
const node = {
|
|
13813
13786
|
type: 'Decorator',
|
|
@@ -13860,34 +13833,6 @@ function topicReference() {
|
|
|
13860
13833
|
};
|
|
13861
13834
|
}
|
|
13862
13835
|
|
|
13863
|
-
function pipelineTopicExpression(expression2) {
|
|
13864
|
-
const node = {
|
|
13865
|
-
type: 'PipelineTopicExpression',
|
|
13866
|
-
expression: expression2,
|
|
13867
|
-
};
|
|
13868
|
-
|
|
13869
|
-
const defs = NODE_FIELDS.PipelineTopicExpression;
|
|
13870
|
-
validate(defs.expression, node, 'expression', expression2, 1);
|
|
13871
|
-
return node;
|
|
13872
|
-
}
|
|
13873
|
-
|
|
13874
|
-
function pipelineBareFunction(callee) {
|
|
13875
|
-
const node = {
|
|
13876
|
-
type: 'PipelineBareFunction',
|
|
13877
|
-
callee,
|
|
13878
|
-
};
|
|
13879
|
-
|
|
13880
|
-
const defs = NODE_FIELDS.PipelineBareFunction;
|
|
13881
|
-
validate(defs.callee, node, 'callee', callee, 1);
|
|
13882
|
-
return node;
|
|
13883
|
-
}
|
|
13884
|
-
|
|
13885
|
-
function pipelinePrimaryTopicReference() {
|
|
13886
|
-
return {
|
|
13887
|
-
type: 'PipelinePrimaryTopicReference',
|
|
13888
|
-
};
|
|
13889
|
-
}
|
|
13890
|
-
|
|
13891
13836
|
function voidPattern() {
|
|
13892
13837
|
return {
|
|
13893
13838
|
type: 'VoidPattern',
|
|
@@ -13912,6 +13857,8 @@ function tsDeclareFunction(id = null, typeParameters = null, params, returnType
|
|
|
13912
13857
|
typeParameters,
|
|
13913
13858
|
params,
|
|
13914
13859
|
returnType,
|
|
13860
|
+
async: false,
|
|
13861
|
+
generator: false,
|
|
13915
13862
|
};
|
|
13916
13863
|
|
|
13917
13864
|
const defs = NODE_FIELDS.TSDeclareFunction;
|
|
@@ -13930,6 +13877,11 @@ function tsDeclareMethod(decorators = null, key, typeParameters = null, params,
|
|
|
13930
13877
|
typeParameters,
|
|
13931
13878
|
params,
|
|
13932
13879
|
returnType,
|
|
13880
|
+
async: false,
|
|
13881
|
+
computed: false,
|
|
13882
|
+
generator: false,
|
|
13883
|
+
kind: 'method',
|
|
13884
|
+
static: false,
|
|
13933
13885
|
};
|
|
13934
13886
|
|
|
13935
13887
|
const defs = NODE_FIELDS.TSDeclareMethod;
|
|
@@ -13989,6 +13941,7 @@ function tsPropertySignature(key, typeAnnotation2 = null) {
|
|
|
13989
13941
|
type: 'TSPropertySignature',
|
|
13990
13942
|
key,
|
|
13991
13943
|
typeAnnotation: typeAnnotation2,
|
|
13944
|
+
computed: false,
|
|
13992
13945
|
};
|
|
13993
13946
|
|
|
13994
13947
|
const defs = NODE_FIELDS.TSPropertySignature;
|
|
@@ -14004,7 +13957,8 @@ function tsMethodSignature(key, typeParameters = null, params, returnType = null
|
|
|
14004
13957
|
typeParameters,
|
|
14005
13958
|
params,
|
|
14006
13959
|
returnType,
|
|
14007
|
-
|
|
13960
|
+
computed: false,
|
|
13961
|
+
kind: 'method',
|
|
14008
13962
|
};
|
|
14009
13963
|
|
|
14010
13964
|
const defs = NODE_FIELDS.TSMethodSignature;
|
|
@@ -14544,7 +14498,7 @@ function tsModuleDeclaration(id, body) {
|
|
|
14544
14498
|
type: 'TSModuleDeclaration',
|
|
14545
14499
|
id,
|
|
14546
14500
|
body,
|
|
14547
|
-
kind:
|
|
14501
|
+
kind: 'namespace',
|
|
14548
14502
|
};
|
|
14549
14503
|
|
|
14550
14504
|
const defs = NODE_FIELDS.TSModuleDeclaration;
|
|
@@ -14841,9 +14795,6 @@ var b = /* @__PURE__ */Object.freeze({
|
|
|
14841
14795
|
optionalIndexedAccessType,
|
|
14842
14796
|
optionalMemberExpression,
|
|
14843
14797
|
parenthesizedExpression,
|
|
14844
|
-
pipelineBareFunction,
|
|
14845
|
-
pipelinePrimaryTopicReference,
|
|
14846
|
-
pipelineTopicExpression,
|
|
14847
14798
|
placeholder,
|
|
14848
14799
|
privateName,
|
|
14849
14800
|
program,
|
|
@@ -15052,7 +15003,6 @@ var ExportNamespaceSpecifier = alias('exportNamespaceSpecifier');
|
|
|
15052
15003
|
var OptionalMemberExpression = alias('optionalMemberExpression');
|
|
15053
15004
|
var OptionalCallExpression = alias('optionalCallExpression');
|
|
15054
15005
|
var ClassProperty = alias('classProperty');
|
|
15055
|
-
var ClassAccessorProperty = alias('classAccessorProperty');
|
|
15056
15006
|
var ClassPrivateProperty = alias('classPrivateProperty');
|
|
15057
15007
|
var ClassPrivateMethod = alias('classPrivateMethod');
|
|
15058
15008
|
var PrivateName = alias('privateName');
|
|
@@ -15142,14 +15092,12 @@ var Placeholder = alias('placeholder');
|
|
|
15142
15092
|
var V8IntrinsicIdentifier = alias('v8IntrinsicIdentifier');
|
|
15143
15093
|
var ArgumentPlaceholder = alias('argumentPlaceholder');
|
|
15144
15094
|
var BindExpression = alias('bindExpression');
|
|
15095
|
+
var ClassAccessorProperty = alias('classAccessorProperty');
|
|
15145
15096
|
var Decorator = alias('decorator');
|
|
15146
15097
|
var DoExpression = alias('doExpression');
|
|
15147
15098
|
var ExportDefaultSpecifier = alias('exportDefaultSpecifier');
|
|
15148
15099
|
var ModuleExpression = alias('moduleExpression');
|
|
15149
15100
|
var TopicReference = alias('topicReference');
|
|
15150
|
-
var PipelineTopicExpression = alias('pipelineTopicExpression');
|
|
15151
|
-
var PipelineBareFunction = alias('pipelineBareFunction');
|
|
15152
|
-
var PipelinePrimaryTopicReference = alias('pipelinePrimaryTopicReference');
|
|
15153
15101
|
var VoidPattern = alias('voidPattern');
|
|
15154
15102
|
var TSParameterProperty = alias('tsParameterProperty');
|
|
15155
15103
|
var TSDeclareFunction = alias('tsDeclareFunction');
|
|
@@ -15632,10 +15580,6 @@ function assertClassProperty(node, opts) {
|
|
|
15632
15580
|
assert('ClassProperty', node, opts);
|
|
15633
15581
|
}
|
|
15634
15582
|
|
|
15635
|
-
function assertClassAccessorProperty(node, opts) {
|
|
15636
|
-
assert('ClassAccessorProperty', node, opts);
|
|
15637
|
-
}
|
|
15638
|
-
|
|
15639
15583
|
function assertClassPrivateProperty(node, opts) {
|
|
15640
15584
|
assert('ClassPrivateProperty', node, opts);
|
|
15641
15585
|
}
|
|
@@ -15992,6 +15936,10 @@ function assertBindExpression(node, opts) {
|
|
|
15992
15936
|
assert('BindExpression', node, opts);
|
|
15993
15937
|
}
|
|
15994
15938
|
|
|
15939
|
+
function assertClassAccessorProperty(node, opts) {
|
|
15940
|
+
assert('ClassAccessorProperty', node, opts);
|
|
15941
|
+
}
|
|
15942
|
+
|
|
15995
15943
|
function assertDecorator(node, opts) {
|
|
15996
15944
|
assert('Decorator', node, opts);
|
|
15997
15945
|
}
|
|
@@ -16012,18 +15960,6 @@ function assertTopicReference(node, opts) {
|
|
|
16012
15960
|
assert('TopicReference', node, opts);
|
|
16013
15961
|
}
|
|
16014
15962
|
|
|
16015
|
-
function assertPipelineTopicExpression(node, opts) {
|
|
16016
|
-
assert('PipelineTopicExpression', node, opts);
|
|
16017
|
-
}
|
|
16018
|
-
|
|
16019
|
-
function assertPipelineBareFunction(node, opts) {
|
|
16020
|
-
assert('PipelineBareFunction', node, opts);
|
|
16021
|
-
}
|
|
16022
|
-
|
|
16023
|
-
function assertPipelinePrimaryTopicReference(node, opts) {
|
|
16024
|
-
assert('PipelinePrimaryTopicReference', node, opts);
|
|
16025
|
-
}
|
|
16026
|
-
|
|
16027
15963
|
function assertVoidPattern(node, opts) {
|
|
16028
15964
|
assert('VoidPattern', node, opts);
|
|
16029
15965
|
}
|
|
@@ -16440,10 +16376,6 @@ function assertModuleSpecifier(node, opts) {
|
|
|
16440
16376
|
assert('ModuleSpecifier', node, opts);
|
|
16441
16377
|
}
|
|
16442
16378
|
|
|
16443
|
-
function assertAccessor(node, opts) {
|
|
16444
|
-
assert('Accessor', node, opts);
|
|
16445
|
-
}
|
|
16446
|
-
|
|
16447
16379
|
function assertPrivate(node, opts) {
|
|
16448
16380
|
assert('Private', node, opts);
|
|
16449
16381
|
}
|
|
@@ -16484,6 +16416,10 @@ function assertMiscellaneous(node, opts) {
|
|
|
16484
16416
|
assert('Miscellaneous', node, opts);
|
|
16485
16417
|
}
|
|
16486
16418
|
|
|
16419
|
+
function assertAccessor(node, opts) {
|
|
16420
|
+
assert('Accessor', node, opts);
|
|
16421
|
+
}
|
|
16422
|
+
|
|
16487
16423
|
function assertTypeScript(node, opts) {
|
|
16488
16424
|
assert('TypeScript', node, opts);
|
|
16489
16425
|
}
|
|
@@ -16846,7 +16782,7 @@ function maybeCloneComments(comments, deep, withoutLoc, commentsCache) {
|
|
|
16846
16782
|
};
|
|
16847
16783
|
|
|
16848
16784
|
if (withoutLoc) {
|
|
16849
|
-
ret.loc =
|
|
16785
|
+
ret.loc = void 0;
|
|
16850
16786
|
}
|
|
16851
16787
|
|
|
16852
16788
|
commentsCache.set(comment, ret);
|
|
@@ -16965,7 +16901,6 @@ var CLASS_TYPES = FLIPPED_ALIAS_KEYS['Class'];
|
|
|
16965
16901
|
var IMPORTOREXPORTDECLARATION_TYPES = FLIPPED_ALIAS_KEYS['ImportOrExportDeclaration'];
|
|
16966
16902
|
var EXPORTDECLARATION_TYPES = FLIPPED_ALIAS_KEYS['ExportDeclaration'];
|
|
16967
16903
|
var MODULESPECIFIER_TYPES = FLIPPED_ALIAS_KEYS['ModuleSpecifier'];
|
|
16968
|
-
var ACCESSOR_TYPES = FLIPPED_ALIAS_KEYS['Accessor'];
|
|
16969
16904
|
var PRIVATE_TYPES = FLIPPED_ALIAS_KEYS['Private'];
|
|
16970
16905
|
var FLOW_TYPES = FLIPPED_ALIAS_KEYS['Flow'];
|
|
16971
16906
|
var FLOWTYPE_TYPES = FLIPPED_ALIAS_KEYS['FlowType'];
|
|
@@ -16976,6 +16911,7 @@ var ENUMBODY_TYPES = FLIPPED_ALIAS_KEYS['EnumBody'];
|
|
|
16976
16911
|
var ENUMMEMBER_TYPES = FLIPPED_ALIAS_KEYS['EnumMember'];
|
|
16977
16912
|
var JSX_TYPES = FLIPPED_ALIAS_KEYS['JSX'];
|
|
16978
16913
|
var MISCELLANEOUS_TYPES = FLIPPED_ALIAS_KEYS['Miscellaneous'];
|
|
16914
|
+
var ACCESSOR_TYPES = FLIPPED_ALIAS_KEYS['Accessor'];
|
|
16979
16915
|
var TYPESCRIPT_TYPES = FLIPPED_ALIAS_KEYS['TypeScript'];
|
|
16980
16916
|
var TSTYPEELEMENT_TYPES = FLIPPED_ALIAS_KEYS['TSTypeElement'];
|
|
16981
16917
|
var TSTYPE_TYPES = FLIPPED_ALIAS_KEYS['TSType'];
|
|
@@ -17558,6 +17494,8 @@ function getObjectMemberKey(node) {
|
|
|
17558
17494
|
if (!node.computed || isLiteral(node.key)) {
|
|
17559
17495
|
return node.key;
|
|
17560
17496
|
}
|
|
17497
|
+
|
|
17498
|
+
return null;
|
|
17561
17499
|
}
|
|
17562
17500
|
|
|
17563
17501
|
function getFunctionName(node, parent) {
|
|
@@ -17580,7 +17518,7 @@ function getFunctionName(node, parent) {
|
|
|
17580
17518
|
prefix2 = 'get ';
|
|
17581
17519
|
else if (node.kind === 'set')
|
|
17582
17520
|
prefix2 = 'set ';
|
|
17583
|
-
} else if (isVariableDeclarator(parent
|
|
17521
|
+
} else if (isVariableDeclarator(parent) && parent.init === node) {
|
|
17584
17522
|
id = parent.id;
|
|
17585
17523
|
} else if (isAssignmentExpression(parent, {operator: '=', right: node})) {
|
|
17586
17524
|
id = parent.left;
|
|
@@ -21060,7 +20998,7 @@ function isWhitespace(code2) {
|
|
|
21060
20998
|
}
|
|
21061
20999
|
}
|
|
21062
21000
|
|
|
21063
|
-
var
|
|
21001
|
+
var JsxErrorTemplates = {
|
|
21064
21002
|
AttributeIsEmpty: 'JSX attributes must only be assigned a non-empty expression.',
|
|
21065
21003
|
MissingClosingTagElement: ({openingTagName}) => `Expected corresponding JSX closing tag for <${openingTagName}>.`,
|
|
21066
21004
|
MissingClosingTagFragment: 'Expected corresponding JSX closing tag for <>.',
|
|
@@ -21069,7 +21007,9 @@ var JsxErrors = ParseErrorEnum`jsx`({
|
|
|
21069
21007
|
UnsupportedJsxValue: 'JSX value should be either an expression or a quoted JSX text.',
|
|
21070
21008
|
UnterminatedJsxContent: 'Unterminated JSX contents.',
|
|
21071
21009
|
UnwrappedAdjacentJSXElements: 'Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?',
|
|
21072
|
-
}
|
|
21010
|
+
};
|
|
21011
|
+
|
|
21012
|
+
var JsxErrors = ParseErrorEnum`jsx`(JsxErrorTemplates);
|
|
21073
21013
|
|
|
21074
21014
|
function isFragment(object) {
|
|
21075
21015
|
return object ? object.type === 'JSXOpeningFragment' || object.type === 'JSXClosingFragment' : false;
|
|
@@ -25000,7 +24940,7 @@ function assert2(x) {
|
|
|
25000
24940
|
}
|
|
25001
24941
|
}
|
|
25002
24942
|
|
|
25003
|
-
var
|
|
24943
|
+
var TSErrorTemplates = {
|
|
25004
24944
|
AbstractMethodHasImplementation: ({methodName}) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`,
|
|
25005
24945
|
AbstractPropertyHasInitializer: ({propertyName}) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,
|
|
25006
24946
|
AccessorCannotBeOptional: 'An \'accessor\' property cannot be declared optional.',
|
|
@@ -25066,7 +25006,9 @@ var TSErrors = ParseErrorEnum`typescript`({
|
|
|
25066
25006
|
UnsupportedParameterPropertyKind: 'A parameter property may not be declared using a binding pattern.',
|
|
25067
25007
|
UnsupportedSignatureParameterKind: ({type}) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`,
|
|
25068
25008
|
UsingDeclarationInAmbientContext: (kind) => `'${kind}' declarations are not allowed in ambient contexts.`,
|
|
25069
|
-
}
|
|
25009
|
+
};
|
|
25010
|
+
|
|
25011
|
+
var TSErrors = ParseErrorEnum`typescript`(TSErrorTemplates);
|
|
25070
25012
|
|
|
25071
25013
|
function keywordTypeFromName(value) {
|
|
25072
25014
|
switch(value) {
|
|
@@ -27759,8 +27701,18 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27759
27701
|
parseClassSuper(node) {
|
|
27760
27702
|
super.parseClassSuper(node);
|
|
27761
27703
|
|
|
27762
|
-
if (node.superClass
|
|
27763
|
-
node.
|
|
27704
|
+
if (node.superClass) {
|
|
27705
|
+
if (node.superClass.type === 'TSInstantiationExpression') {
|
|
27706
|
+
const tsInstantiationExpression2 = node.superClass;
|
|
27707
|
+
const superClass2 = tsInstantiationExpression2.expression;
|
|
27708
|
+
this.takeSurroundingComments(superClass2, superClass2.start, superClass2.end);
|
|
27709
|
+
const superTypeArguments = tsInstantiationExpression2.typeArguments;
|
|
27710
|
+
this.takeSurroundingComments(superTypeArguments, superTypeArguments.start, superTypeArguments.end);
|
|
27711
|
+
node.superClass = superClass2;
|
|
27712
|
+
node.superTypeArguments = superTypeArguments;
|
|
27713
|
+
} else if (this.match(43) || this.match(47)) {
|
|
27714
|
+
node.superTypeArguments = this.tsParseTypeArgumentsInExpression();
|
|
27715
|
+
}
|
|
27764
27716
|
}
|
|
27765
27717
|
|
|
27766
27718
|
if (this.eatContextual(109)) {
|
|
@@ -27801,12 +27753,12 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27801
27753
|
}
|
|
27802
27754
|
}
|
|
27803
27755
|
|
|
27804
|
-
parseAsyncArrowFromCallExpression(node,
|
|
27756
|
+
parseAsyncArrowFromCallExpression(node, call) {
|
|
27805
27757
|
if (this.match(10)) {
|
|
27806
27758
|
node.returnType = this.tsParseTypeAnnotation();
|
|
27807
27759
|
}
|
|
27808
27760
|
|
|
27809
|
-
return super.parseAsyncArrowFromCallExpression(node,
|
|
27761
|
+
return super.parseAsyncArrowFromCallExpression(node, call);
|
|
27810
27762
|
}
|
|
27811
27763
|
|
|
27812
27764
|
parseMaybeAssign(refExpressionErrors, afterLeftParse) {
|
|
@@ -28064,10 +28016,10 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28064
28016
|
const typeArguments = this.tsParseTypeArgumentsInExpression();
|
|
28065
28017
|
|
|
28066
28018
|
if (this.match(6)) {
|
|
28067
|
-
const
|
|
28019
|
+
const call = super.parseMaybeDecoratorArguments(expr, startLoc);
|
|
28068
28020
|
|
|
28069
|
-
|
|
28070
|
-
return
|
|
28021
|
+
call.typeArguments = typeArguments;
|
|
28022
|
+
return call;
|
|
28071
28023
|
}
|
|
28072
28024
|
|
|
28073
28025
|
this.unexpected(null, 6);
|
|
@@ -28627,10 +28579,12 @@ function isUncomputedMemberExpressionChain(expression2) {
|
|
|
28627
28579
|
return isUncomputedMemberExpressionChain(expression2.object);
|
|
28628
28580
|
}
|
|
28629
28581
|
|
|
28630
|
-
var
|
|
28582
|
+
var PlaceholderErrorTemplates = {
|
|
28631
28583
|
ClassNameIsRequired: 'A class name is required.',
|
|
28632
28584
|
UnexpectedSpace: 'Unexpected space in placeholder.',
|
|
28633
|
-
}
|
|
28585
|
+
};
|
|
28586
|
+
|
|
28587
|
+
var PlaceholderErrors = ParseErrorEnum`placeholders`(PlaceholderErrorTemplates);
|
|
28634
28588
|
|
|
28635
28589
|
var placeholders = (superClass) => class PlaceholdersParserMixin extends superClass {
|
|
28636
28590
|
parsePlaceholder(expectedNode) {
|
|
@@ -29688,17 +29642,17 @@ var ExpressionParser = class extends LValParser {
|
|
|
29688
29642
|
return this.match(15) && !this.canInsertSemicolon();
|
|
29689
29643
|
}
|
|
29690
29644
|
|
|
29691
|
-
parseAsyncArrowFromCallExpression(node,
|
|
29692
|
-
this.resetPreviousNodeTrailingComments(
|
|
29645
|
+
parseAsyncArrowFromCallExpression(node, call) {
|
|
29646
|
+
this.resetPreviousNodeTrailingComments(call);
|
|
29693
29647
|
this.expect(15);
|
|
29694
|
-
this.parseArrowExpression(node,
|
|
29648
|
+
this.parseArrowExpression(node, call.arguments, true, call.extra?.trailingCommaLoc);
|
|
29695
29649
|
|
|
29696
|
-
if (
|
|
29697
|
-
setInnerComments(node,
|
|
29650
|
+
if (call.innerComments) {
|
|
29651
|
+
setInnerComments(node, call.innerComments);
|
|
29698
29652
|
}
|
|
29699
29653
|
|
|
29700
|
-
if (
|
|
29701
|
-
setInnerComments(node,
|
|
29654
|
+
if (call.callee.trailingComments) {
|
|
29655
|
+
setInnerComments(node, call.callee.trailingComments);
|
|
29702
29656
|
}
|
|
29703
29657
|
|
|
29704
29658
|
return node;
|
|
@@ -33395,7 +33349,7 @@ var Parser = class extends StatementParser {
|
|
|
33395
33349
|
const program3 = this.startNode();
|
|
33396
33350
|
|
|
33397
33351
|
this.nextToken();
|
|
33398
|
-
file2.errors =
|
|
33352
|
+
file2.errors = [];
|
|
33399
33353
|
const result = this.parseTopLevel(file2, program3);
|
|
33400
33354
|
|
|
33401
33355
|
result.errors = this.state.errors;
|
|
@@ -34207,7 +34161,7 @@ function highlight(text) {
|
|
|
34207
34161
|
|
|
34208
34162
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
34209
34163
|
|
|
34210
|
-
function getMarkerLines(loc, source, opts) {
|
|
34164
|
+
function getMarkerLines(loc, source, opts, startLineBaseZero) {
|
|
34211
34165
|
const startLoc = {
|
|
34212
34166
|
column: 0,
|
|
34213
34167
|
line: -1,
|
|
@@ -34221,9 +34175,9 @@ function getMarkerLines(loc, source, opts) {
|
|
|
34221
34175
|
|
|
34222
34176
|
const {linesAbove = 2, linesBelow = 3} = opts || {};
|
|
34223
34177
|
|
|
34224
|
-
const startLine = startLoc.line;
|
|
34178
|
+
const startLine = startLoc.line - startLineBaseZero;
|
|
34225
34179
|
const startColumn = startLoc.column;
|
|
34226
|
-
const endLine = endLoc.line;
|
|
34180
|
+
const endLine = endLoc.line - startLineBaseZero;
|
|
34227
34181
|
const endColumn = endLoc.column;
|
|
34228
34182
|
let start = Math.max(startLine - (linesAbove + 1), 0);
|
|
34229
34183
|
let end = Math.min(source.length, endLine + linesBelow);
|
|
@@ -34283,6 +34237,7 @@ function getMarkerLines(loc, source, opts) {
|
|
|
34283
34237
|
|
|
34284
34238
|
function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
34285
34239
|
const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
|
|
34240
|
+
const startLineBaseZero = (opts.startLine || 1) - 1;
|
|
34286
34241
|
const defs = getDefs(shouldHighlight);
|
|
34287
34242
|
const lines = rawLines.split(NEWLINE);
|
|
34288
34243
|
|
|
@@ -34290,10 +34245,10 @@ function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
|
34290
34245
|
start,
|
|
34291
34246
|
end,
|
|
34292
34247
|
markerLines,
|
|
34293
|
-
} = getMarkerLines(loc, lines, opts);
|
|
34248
|
+
} = getMarkerLines(loc, lines, opts, startLineBaseZero);
|
|
34294
34249
|
|
|
34295
34250
|
const hasColumns = loc.start && typeof loc.start.column === 'number';
|
|
34296
|
-
const numberMaxWidth = String(end).length;
|
|
34251
|
+
const numberMaxWidth = String(end + startLineBaseZero).length;
|
|
34297
34252
|
const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
|
|
34298
34253
|
|
|
34299
34254
|
let frame = highlightedLines
|
|
@@ -34301,7 +34256,7 @@ function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
|
34301
34256
|
.slice(start, end)
|
|
34302
34257
|
.map((line, index3) => {
|
|
34303
34258
|
const number = start + 1 + index3;
|
|
34304
|
-
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
|
34259
|
+
const paddedNumber = ` ${number + startLineBaseZero}`.slice(-numberMaxWidth);
|
|
34305
34260
|
const gutter = ` ${paddedNumber} |`;
|
|
34306
34261
|
const hasMarker = markerLines[number];
|
|
34307
34262
|
const lastMarkerLine = !markerLines[number + 1];
|
|
@@ -34961,28 +34916,18 @@ function createTemplateBuilder(formatter, defaultOpts) {
|
|
|
34961
34916
|
}
|
|
34962
34917
|
|
|
34963
34918
|
function extendedTrace(fn) {
|
|
34964
|
-
|
|
34919
|
+
const rootErr = new Error();
|
|
34965
34920
|
|
|
34966
|
-
try {
|
|
34967
|
-
throw new Error();
|
|
34968
|
-
} catch(error) {
|
|
34969
|
-
if (error.stack) {
|
|
34970
|
-
rootStack = error.stack
|
|
34971
|
-
.split('\n')
|
|
34972
|
-
.slice(3)
|
|
34973
|
-
.join('\n');
|
|
34974
|
-
}
|
|
34975
|
-
}
|
|
34976
|
-
|
|
34977
|
-
|
|
34978
|
-
|
|
34979
34921
|
return (arg) => {
|
|
34980
34922
|
try {
|
|
34981
34923
|
return fn(arg);
|
|
34982
34924
|
} catch(err) {
|
|
34983
34925
|
err.stack += `
|
|
34984
34926
|
=============
|
|
34985
|
-
${
|
|
34927
|
+
${rootErr.stack
|
|
34928
|
+
.split('\n')
|
|
34929
|
+
.slice(3)
|
|
34930
|
+
.join('\n')}`;
|
|
34986
34931
|
throw err;
|
|
34987
34932
|
}
|
|
34988
34933
|
};
|
|
@@ -36438,7 +36383,7 @@ var PRECEDENCE = /* @__PURE__ */new Map([
|
|
|
36438
36383
|
]);
|
|
36439
36384
|
|
|
36440
36385
|
function isTSTypeExpression(nodeId) {
|
|
36441
|
-
return nodeId ===
|
|
36386
|
+
return nodeId === 153 || nodeId === 198 || nodeId === 206;
|
|
36442
36387
|
}
|
|
36443
36388
|
|
|
36444
36389
|
var isClassExtendsClause = (node, parent, parentId) => {
|
|
@@ -36456,10 +36401,10 @@ var hasPostfixPart = (node, parent, parentId) => {
|
|
|
36456
36401
|
case 112:
|
|
36457
36402
|
return parent.callee === node;
|
|
36458
36403
|
|
|
36459
|
-
case
|
|
36404
|
+
case 219:
|
|
36460
36405
|
return parent.tag === node;
|
|
36461
36406
|
|
|
36462
|
-
case
|
|
36407
|
+
case 188:
|
|
36463
36408
|
return true;
|
|
36464
36409
|
}
|
|
36465
36410
|
|
|
@@ -36471,7 +36416,7 @@ function NullableTypeAnnotation$1(node, parent, parentId) {
|
|
|
36471
36416
|
}
|
|
36472
36417
|
|
|
36473
36418
|
function FunctionTypeAnnotation$1(node, parent, parentId, tokenContext) {
|
|
36474
|
-
return parentId ===
|
|
36419
|
+
return parentId === 236
|
|
36475
36420
|
|| parentId === 90
|
|
36476
36421
|
|| parentId === 4
|
|
36477
36422
|
|| (tokenContext & 8) > 0;
|
|
@@ -36498,7 +36443,7 @@ function BinaryLike(node, parent, parentId, nodeType) {
|
|
|
36498
36443
|
return true;
|
|
36499
36444
|
}
|
|
36500
36445
|
|
|
36501
|
-
if (hasPostfixPart(node, parent, parentId) || parentId ===
|
|
36446
|
+
if (hasPostfixPart(node, parent, parentId) || parentId === 235 || parentId === 142 || parentId === 8) {
|
|
36502
36447
|
return true;
|
|
36503
36448
|
}
|
|
36504
36449
|
|
|
@@ -36510,8 +36455,8 @@ function BinaryLike(node, parent, parentId, nodeType) {
|
|
|
36510
36455
|
parentPos = PRECEDENCE.get(parent.operator);
|
|
36511
36456
|
break;
|
|
36512
36457
|
|
|
36513
|
-
case
|
|
36514
|
-
case
|
|
36458
|
+
case 153:
|
|
36459
|
+
case 198:
|
|
36515
36460
|
parentPos = 7;
|
|
36516
36461
|
}
|
|
36517
36462
|
|
|
@@ -36538,7 +36483,7 @@ function UnionTypeAnnotation$1(node, parent, parentId) {
|
|
|
36538
36483
|
case 4:
|
|
36539
36484
|
case 115:
|
|
36540
36485
|
case 90:
|
|
36541
|
-
case
|
|
36486
|
+
case 236:
|
|
36542
36487
|
return true;
|
|
36543
36488
|
}
|
|
36544
36489
|
|
|
@@ -36563,18 +36508,18 @@ function TSAsExpression$1(node, parent, parentId) {
|
|
|
36563
36508
|
|
|
36564
36509
|
function TSConditionalType$1(node, parent, parentId) {
|
|
36565
36510
|
switch(parentId) {
|
|
36566
|
-
case
|
|
36567
|
-
case
|
|
36568
|
-
case
|
|
36569
|
-
case
|
|
36570
|
-
case
|
|
36571
|
-
case
|
|
36511
|
+
case 152:
|
|
36512
|
+
case 192:
|
|
36513
|
+
case 208:
|
|
36514
|
+
case 209:
|
|
36515
|
+
case 178:
|
|
36516
|
+
case 216:
|
|
36572
36517
|
return true;
|
|
36573
36518
|
|
|
36574
|
-
case
|
|
36519
|
+
case 172:
|
|
36575
36520
|
return parent.objectType === node;
|
|
36576
36521
|
|
|
36577
|
-
case
|
|
36522
|
+
case 158:
|
|
36578
36523
|
return parent.checkType === node || parent.extendsType === node;
|
|
36579
36524
|
}
|
|
36580
36525
|
|
|
@@ -36583,13 +36528,13 @@ function TSConditionalType$1(node, parent, parentId) {
|
|
|
36583
36528
|
|
|
36584
36529
|
function TSUnionType$1(node, parent, parentId) {
|
|
36585
36530
|
switch(parentId) {
|
|
36586
|
-
case
|
|
36587
|
-
case
|
|
36588
|
-
case
|
|
36589
|
-
case
|
|
36531
|
+
case 178:
|
|
36532
|
+
case 208:
|
|
36533
|
+
case 152:
|
|
36534
|
+
case 192:
|
|
36590
36535
|
return true;
|
|
36591
36536
|
|
|
36592
|
-
case
|
|
36537
|
+
case 172:
|
|
36593
36538
|
return parent.objectType === node;
|
|
36594
36539
|
}
|
|
36595
36540
|
|
|
@@ -36597,7 +36542,7 @@ function TSUnionType$1(node, parent, parentId) {
|
|
|
36597
36542
|
}
|
|
36598
36543
|
|
|
36599
36544
|
function TSIntersectionType$1(node, parent, parentId) {
|
|
36600
|
-
return parentId ===
|
|
36545
|
+
return parentId === 208 || TSTypeOperator$1(node, parent, parentId);
|
|
36601
36546
|
}
|
|
36602
36547
|
|
|
36603
36548
|
function TSInferType$1(node, parent, parentId) {
|
|
@@ -36605,7 +36550,7 @@ function TSInferType$1(node, parent, parentId) {
|
|
|
36605
36550
|
return true;
|
|
36606
36551
|
}
|
|
36607
36552
|
|
|
36608
|
-
if ((parentId ===
|
|
36553
|
+
if ((parentId === 178 || parentId === 216) && node.typeParameter.constraint != null) {
|
|
36609
36554
|
return true;
|
|
36610
36555
|
}
|
|
36611
36556
|
|
|
@@ -36614,11 +36559,11 @@ function TSInferType$1(node, parent, parentId) {
|
|
|
36614
36559
|
|
|
36615
36560
|
function TSTypeOperator$1(node, parent, parentId) {
|
|
36616
36561
|
switch(parentId) {
|
|
36617
|
-
case
|
|
36618
|
-
case
|
|
36562
|
+
case 152:
|
|
36563
|
+
case 192:
|
|
36619
36564
|
return true;
|
|
36620
36565
|
|
|
36621
|
-
case
|
|
36566
|
+
case 172:
|
|
36622
36567
|
if (parent.objectType === node) {
|
|
36623
36568
|
return true;
|
|
36624
36569
|
}
|
|
@@ -36632,7 +36577,7 @@ function TSInstantiationExpression$1(node, parent, parentId) {
|
|
|
36632
36577
|
case 17:
|
|
36633
36578
|
case 130:
|
|
36634
36579
|
case 112:
|
|
36635
|
-
case
|
|
36580
|
+
case 174:
|
|
36636
36581
|
return parent.typeArguments != null;
|
|
36637
36582
|
}
|
|
36638
36583
|
|
|
@@ -36643,8 +36588,8 @@ function TSFunctionType$1(node, parent, parentId) {
|
|
|
36643
36588
|
if (TSUnionType$1(node, parent, parentId))
|
|
36644
36589
|
return true;
|
|
36645
36590
|
|
|
36646
|
-
return parentId ===
|
|
36647
|
-
|| parentId ===
|
|
36591
|
+
return parentId === 216
|
|
36592
|
+
|| parentId === 158
|
|
36648
36593
|
&& (parent.checkType === node
|
|
36649
36594
|
|| parent.extendsType === node);
|
|
36650
36595
|
}
|
|
@@ -36661,7 +36606,7 @@ function LogicalExpression2(node, parent, parentId) {
|
|
|
36661
36606
|
}
|
|
36662
36607
|
|
|
36663
36608
|
function SequenceExpression$1(node, parent, parentId) {
|
|
36664
|
-
if (parentId ===
|
|
36609
|
+
if (parentId === 141 || parentId === 133 || parentId === 108 && parent.property === node || parentId === 132 && parent.property === node || parentId === 221) {
|
|
36665
36610
|
return false;
|
|
36666
36611
|
}
|
|
36667
36612
|
|
|
@@ -36683,8 +36628,8 @@ function SequenceExpression$1(node, parent, parentId) {
|
|
|
36683
36628
|
function YieldExpression$1(node, parent, parentId) {
|
|
36684
36629
|
return parentId === 10
|
|
36685
36630
|
|| parentId === 107
|
|
36686
|
-
|| parentId ===
|
|
36687
|
-
|| parentId ===
|
|
36631
|
+
|| parentId === 235
|
|
36632
|
+
|| parentId === 142
|
|
36688
36633
|
|| hasPostfixPart(node, parent, parentId)
|
|
36689
36634
|
|| parentId === 8
|
|
36690
36635
|
&& isYieldExpression2(node)
|
|
@@ -36712,8 +36657,8 @@ function FunctionExpression$1(node, parent, parentId, tokenContext) {
|
|
|
36712
36657
|
|
|
36713
36658
|
function ConditionalExpression$1(node, parent, parentId) {
|
|
36714
36659
|
switch(parentId) {
|
|
36715
|
-
case
|
|
36716
|
-
case
|
|
36660
|
+
case 235:
|
|
36661
|
+
case 142:
|
|
36717
36662
|
case 10:
|
|
36718
36663
|
case 107:
|
|
36719
36664
|
case 8:
|
|
@@ -38968,18 +38913,6 @@ function TopicReference2() {
|
|
|
38968
38913
|
}
|
|
38969
38914
|
}
|
|
38970
38915
|
|
|
38971
|
-
function PipelineTopicExpression2(node) {
|
|
38972
|
-
this.print(node.expression);
|
|
38973
|
-
}
|
|
38974
|
-
|
|
38975
|
-
function PipelineBareFunction2(node) {
|
|
38976
|
-
this.print(node.callee);
|
|
38977
|
-
}
|
|
38978
|
-
|
|
38979
|
-
function PipelinePrimaryTopicReference2() {
|
|
38980
|
-
this.tokenChar(35);
|
|
38981
|
-
}
|
|
38982
|
-
|
|
38983
38916
|
function VoidPattern2() {
|
|
38984
38917
|
this.word('void');
|
|
38985
38918
|
}
|
|
@@ -40251,9 +40184,6 @@ var generatorFunctions = /* @__PURE__ */Object.freeze({
|
|
|
40251
40184
|
OptionalIndexedAccessType: OptionalIndexedAccessType2,
|
|
40252
40185
|
OptionalMemberExpression: OptionalMemberExpression2,
|
|
40253
40186
|
ParenthesizedExpression: ParenthesizedExpression2,
|
|
40254
|
-
PipelineBareFunction: PipelineBareFunction2,
|
|
40255
|
-
PipelinePrimaryTopicReference: PipelinePrimaryTopicReference2,
|
|
40256
|
-
PipelineTopicExpression: PipelineTopicExpression2,
|
|
40257
40187
|
Placeholder: Placeholder2,
|
|
40258
40188
|
PrivateName: PrivateName2,
|
|
40259
40189
|
Program: Program2,
|
|
@@ -41241,9 +41171,9 @@ var Printer = class {
|
|
|
41241
41171
|
if (!shouldPrintParens && parenthesized && node.leadingComments?.length && node.leadingComments[0].type === 'CommentBlock') {
|
|
41242
41172
|
switch(parentId) {
|
|
41243
41173
|
case 65:
|
|
41244
|
-
case
|
|
41174
|
+
case 240:
|
|
41245
41175
|
case 6:
|
|
41246
|
-
case
|
|
41176
|
+
case 140:
|
|
41247
41177
|
break;
|
|
41248
41178
|
|
|
41249
41179
|
case 17:
|
|
@@ -41301,7 +41231,7 @@ var Printer = class {
|
|
|
41301
41231
|
}
|
|
41302
41232
|
|
|
41303
41233
|
this._printLeadingComments(node, parent);
|
|
41304
|
-
this.exactSource(nodeId ===
|
|
41234
|
+
this.exactSource(nodeId === 136 || nodeId === 66 ? null : loc, printMethod.bind(this, node, parent));
|
|
41305
41235
|
|
|
41306
41236
|
if (shouldPrintParens) {
|
|
41307
41237
|
this._printTrailingComments(node, parent);
|
|
@@ -42120,6 +42050,180 @@ var virtualTypes = /* @__PURE__ */Object.freeze({
|
|
|
42120
42050
|
Var,
|
|
42121
42051
|
});
|
|
42122
42052
|
|
|
42053
|
+
var TraversalContext = class {
|
|
42054
|
+
constructor(opts, state) {
|
|
42055
|
+
this.state = state;
|
|
42056
|
+
this.opts = opts;
|
|
42057
|
+
}
|
|
42058
|
+
|
|
42059
|
+
queue = null;
|
|
42060
|
+
priorityQueue = null;
|
|
42061
|
+
maybeQueue(path, notPriority) {
|
|
42062
|
+
if (this.queue) {
|
|
42063
|
+
if (notPriority) {
|
|
42064
|
+
this.queue.push(path);
|
|
42065
|
+
} else {
|
|
42066
|
+
this.priorityQueue.push(path);
|
|
42067
|
+
}
|
|
42068
|
+
}
|
|
42069
|
+
}
|
|
42070
|
+
};
|
|
42071
|
+
|
|
42072
|
+
var {VISITOR_KEYS: VISITOR_KEYS$4} = lib_exports;
|
|
42073
|
+
|
|
42074
|
+
function _visitPaths(ctx, paths) {
|
|
42075
|
+
ctx.queue = paths;
|
|
42076
|
+
ctx.priorityQueue = [];
|
|
42077
|
+
const visited = /* @__PURE__ */new Set();
|
|
42078
|
+
let stop2 = false;
|
|
42079
|
+
let visitIndex = 0;
|
|
42080
|
+
|
|
42081
|
+
for (; visitIndex < paths.length;) {
|
|
42082
|
+
const path = paths[visitIndex];
|
|
42083
|
+
visitIndex++;
|
|
42084
|
+
resync.call(path);
|
|
42085
|
+
|
|
42086
|
+
if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== ctx) {
|
|
42087
|
+
pushContext.call(path, ctx);
|
|
42088
|
+
}
|
|
42089
|
+
|
|
42090
|
+
if (path.key === null)
|
|
42091
|
+
continue;
|
|
42092
|
+
|
|
42093
|
+
const {node} = path;
|
|
42094
|
+
|
|
42095
|
+
if (visited.has(node))
|
|
42096
|
+
continue;
|
|
42097
|
+
|
|
42098
|
+
if (node)
|
|
42099
|
+
visited.add(node);
|
|
42100
|
+
|
|
42101
|
+
if (_visit(ctx, path)) {
|
|
42102
|
+
stop2 = true;
|
|
42103
|
+
break;
|
|
42104
|
+
}
|
|
42105
|
+
|
|
42106
|
+
if (ctx.priorityQueue.length) {
|
|
42107
|
+
stop2 = _visitPaths(ctx, ctx.priorityQueue);
|
|
42108
|
+
ctx.priorityQueue = [];
|
|
42109
|
+
ctx.queue = paths;
|
|
42110
|
+
|
|
42111
|
+
if (stop2)
|
|
42112
|
+
break;
|
|
42113
|
+
}
|
|
42114
|
+
}
|
|
42115
|
+
|
|
42116
|
+
for (let i = 0; i < visitIndex; i++) {
|
|
42117
|
+
popContext.call(paths[i]);
|
|
42118
|
+
}
|
|
42119
|
+
|
|
42120
|
+
ctx.queue = null;
|
|
42121
|
+
|
|
42122
|
+
return stop2;
|
|
42123
|
+
}
|
|
42124
|
+
|
|
42125
|
+
function _visit(ctx, path) {
|
|
42126
|
+
const node = path.node;
|
|
42127
|
+
|
|
42128
|
+
if (!node) {
|
|
42129
|
+
return false;
|
|
42130
|
+
}
|
|
42131
|
+
|
|
42132
|
+
const opts = ctx.opts;
|
|
42133
|
+
const denylist = opts.denylist;
|
|
42134
|
+
|
|
42135
|
+
if (denylist?.includes(node.type)) {
|
|
42136
|
+
return false;
|
|
42137
|
+
}
|
|
42138
|
+
|
|
42139
|
+
if (opts.shouldSkip?.(path)) {
|
|
42140
|
+
return false;
|
|
42141
|
+
}
|
|
42142
|
+
|
|
42143
|
+
if (path.shouldSkip)
|
|
42144
|
+
return path.shouldStop;
|
|
42145
|
+
|
|
42146
|
+
if (_call.call(path, opts.enter))
|
|
42147
|
+
return path.shouldStop;
|
|
42148
|
+
|
|
42149
|
+
if (path.node) {
|
|
42150
|
+
if (_call.call(path, opts[node.type]?.enter))
|
|
42151
|
+
return path.shouldStop;
|
|
42152
|
+
}
|
|
42153
|
+
|
|
42154
|
+
path.shouldStop = traverseNode(path.node, opts, path.scope, ctx.state, path, path.skipKeys);
|
|
42155
|
+
|
|
42156
|
+
if (path.node) {
|
|
42157
|
+
if (_call.call(path, opts.exit))
|
|
42158
|
+
return true;
|
|
42159
|
+
}
|
|
42160
|
+
|
|
42161
|
+
if (path.node) {
|
|
42162
|
+
_call.call(path, opts[node.type]?.exit);
|
|
42163
|
+
}
|
|
42164
|
+
|
|
42165
|
+
return path.shouldStop;
|
|
42166
|
+
}
|
|
42167
|
+
|
|
42168
|
+
function traverseNode(node, opts, scope2, state, path, skipKeys, visitSelf) {
|
|
42169
|
+
const keys2 = VISITOR_KEYS$4[node.type];
|
|
42170
|
+
|
|
42171
|
+
if (!keys2?.length)
|
|
42172
|
+
return false;
|
|
42173
|
+
|
|
42174
|
+
const ctx = new TraversalContext(opts, state);
|
|
42175
|
+
|
|
42176
|
+
if (visitSelf) {
|
|
42177
|
+
if (skipKeys?.[path.parentKey])
|
|
42178
|
+
return false;
|
|
42179
|
+
|
|
42180
|
+
return _visitPaths(ctx, [path]);
|
|
42181
|
+
}
|
|
42182
|
+
|
|
42183
|
+
const hub = path == null ? node.type === 'Program' || node.type === 'File' ? new Hub() : void 0 : path.hub;
|
|
42184
|
+
|
|
42185
|
+
for (const key of keys2) {
|
|
42186
|
+
if (skipKeys?.[key])
|
|
42187
|
+
continue;
|
|
42188
|
+
|
|
42189
|
+
const prop = node[key];
|
|
42190
|
+
|
|
42191
|
+
if (!prop)
|
|
42192
|
+
continue;
|
|
42193
|
+
|
|
42194
|
+
if (Array.isArray(prop)) {
|
|
42195
|
+
if (!prop.length)
|
|
42196
|
+
continue;
|
|
42197
|
+
|
|
42198
|
+
const paths = [];
|
|
42199
|
+
|
|
42200
|
+
for (let i = 0; i < prop.length; i++) {
|
|
42201
|
+
const childPath = NodePath_Final.get({
|
|
42202
|
+
parentPath: path,
|
|
42203
|
+
parent: node,
|
|
42204
|
+
container: prop,
|
|
42205
|
+
key: i,
|
|
42206
|
+
listKey: key,
|
|
42207
|
+
hub,
|
|
42208
|
+
});
|
|
42209
|
+
|
|
42210
|
+
paths.push(childPath);
|
|
42211
|
+
}
|
|
42212
|
+
|
|
42213
|
+
if (_visitPaths(ctx, paths))
|
|
42214
|
+
return true;
|
|
42215
|
+
} else {
|
|
42216
|
+
if (_visitPaths(ctx, [
|
|
42217
|
+
NodePath_Final.get({parentPath: path, parent: node, container: node, key, listKey: null, hub}),
|
|
42218
|
+
])) {
|
|
42219
|
+
return true;
|
|
42220
|
+
}
|
|
42221
|
+
}
|
|
42222
|
+
}
|
|
42223
|
+
|
|
42224
|
+
return false;
|
|
42225
|
+
}
|
|
42226
|
+
|
|
42123
42227
|
var {
|
|
42124
42228
|
isBinding: isBinding2,
|
|
42125
42229
|
isBlockScoped: nodeIsBlockScoped,
|
|
@@ -42724,7 +42828,7 @@ var Renamer = class {
|
|
|
42724
42828
|
}
|
|
42725
42829
|
};
|
|
42726
42830
|
|
|
42727
|
-
var {VISITOR_KEYS: VISITOR_KEYS$
|
|
42831
|
+
var {VISITOR_KEYS: VISITOR_KEYS$3} = lib_exports;
|
|
42728
42832
|
|
|
42729
42833
|
function traverseForScope(path, visitors2, state) {
|
|
42730
42834
|
const exploded = explode$1(visitors2);
|
|
@@ -42752,8 +42856,8 @@ function traverseForScope(path, visitors2, state) {
|
|
|
42752
42856
|
const visitor = exploded[node.type];
|
|
42753
42857
|
|
|
42754
42858
|
if (visitor?.enter) {
|
|
42755
|
-
for (const
|
|
42756
|
-
|
|
42859
|
+
for (const visit of visitor.enter) {
|
|
42860
|
+
visit.call(state, path2, state);
|
|
42757
42861
|
}
|
|
42758
42862
|
}
|
|
42759
42863
|
|
|
@@ -42761,7 +42865,7 @@ function traverseForScope(path, visitors2, state) {
|
|
|
42761
42865
|
return;
|
|
42762
42866
|
}
|
|
42763
42867
|
|
|
42764
|
-
const keys2 = VISITOR_KEYS$
|
|
42868
|
+
const keys2 = VISITOR_KEYS$3[node.type];
|
|
42765
42869
|
|
|
42766
42870
|
if (!keys2?.length) {
|
|
42767
42871
|
return;
|
|
@@ -42784,8 +42888,8 @@ function traverseForScope(path, visitors2, state) {
|
|
|
42784
42888
|
}
|
|
42785
42889
|
|
|
42786
42890
|
if (visitor?.exit) {
|
|
42787
|
-
for (const
|
|
42788
|
-
|
|
42891
|
+
for (const visit of visitor.exit) {
|
|
42892
|
+
visit.call(state, path2, state);
|
|
42789
42893
|
}
|
|
42790
42894
|
}
|
|
42791
42895
|
}
|
|
@@ -43798,8 +43902,8 @@ collectorVisitor]);
|
|
|
43798
43902
|
const typeVisitors = scopeVisitor[path.type];
|
|
43799
43903
|
|
|
43800
43904
|
if (typeVisitors) {
|
|
43801
|
-
for (const
|
|
43802
|
-
|
|
43905
|
+
for (const visit of typeVisitors.enter) {
|
|
43906
|
+
visit.call(state, path, state);
|
|
43803
43907
|
}
|
|
43804
43908
|
}
|
|
43805
43909
|
}
|
|
@@ -44111,7 +44215,7 @@ collectorVisitor]);
|
|
|
44111
44215
|
}
|
|
44112
44216
|
};
|
|
44113
44217
|
|
|
44114
|
-
var {VISITOR_KEYS: VISITOR_KEYS$
|
|
44218
|
+
var {VISITOR_KEYS: VISITOR_KEYS$2} = lib_exports;
|
|
44115
44219
|
|
|
44116
44220
|
function findParent(callback) {
|
|
44117
44221
|
let path = this;
|
|
@@ -44159,7 +44263,7 @@ function getStatementParent() {
|
|
|
44159
44263
|
function getEarliestCommonAncestorFrom(paths) {
|
|
44160
44264
|
return this.getDeepestCommonAncestorFrom(paths, function(deepest, i, ancestries) {
|
|
44161
44265
|
let earliest;
|
|
44162
|
-
const keys2 = VISITOR_KEYS$
|
|
44266
|
+
const keys2 = VISITOR_KEYS$2[deepest.type];
|
|
44163
44267
|
|
|
44164
44268
|
for (const ancestry of ancestries) {
|
|
44165
44269
|
const path = ancestry[i + 1];
|
|
@@ -46020,7 +46124,7 @@ function _evaluate(path, state) {
|
|
|
46020
46124
|
const object = callee.get('object');
|
|
46021
46125
|
const property = callee.get('property');
|
|
46022
46126
|
|
|
46023
|
-
if (object.isIdentifier() && property.isIdentifier() && isValidObjectCallee(object.node.name) && !isInvalidMethod(property.node.name)) {
|
|
46127
|
+
if (object.isIdentifier() && property.isIdentifier() && isValidObjectCallee(object.node.name) && !isInvalidMethod(property.node.name) && !path.scope.getBinding(object.node.name)) {
|
|
46024
46128
|
context = global[object.node.name];
|
|
46025
46129
|
const key = property.node.name;
|
|
46026
46130
|
|
|
@@ -46381,20 +46485,20 @@ function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow =
|
|
|
46381
46485
|
args.push(value);
|
|
46382
46486
|
}
|
|
46383
46487
|
|
|
46384
|
-
const
|
|
46488
|
+
const call = callExpression2(identifier3(superBinding), args);
|
|
46385
46489
|
|
|
46386
46490
|
if (isCall) {
|
|
46387
46491
|
superParentPath.unshiftContainer('arguments', thisExpression2());
|
|
46388
|
-
superProp.replaceWith(memberExpression2(
|
|
46492
|
+
superProp.replaceWith(memberExpression2(call, identifier3('call')));
|
|
46389
46493
|
thisPaths.push(superParentPath.get('arguments.0'));
|
|
46390
46494
|
} else if (isAssignment) {
|
|
46391
|
-
superParentPath.replaceWith(
|
|
46495
|
+
superParentPath.replaceWith(call);
|
|
46392
46496
|
} else if (isTaggedTemplate) {
|
|
46393
46497
|
thisPaths.push(superProp
|
|
46394
|
-
.replaceWith(callExpression2(memberExpression2(
|
|
46498
|
+
.replaceWith(callExpression2(memberExpression2(call, identifier3('bind'), false), [thisExpression2()]))[0]
|
|
46395
46499
|
.get('arguments.0'));
|
|
46396
46500
|
} else {
|
|
46397
|
-
superProp.replaceWith(
|
|
46501
|
+
superProp.replaceWith(call);
|
|
46398
46502
|
}
|
|
46399
46503
|
|
|
46400
46504
|
});
|
|
@@ -46784,7 +46888,7 @@ function ensureFunctionName(supportUnicodeId) {
|
|
|
46784
46888
|
params.push(scope2.generateUidIdentifier('x'));
|
|
46785
46889
|
}
|
|
46786
46890
|
|
|
46787
|
-
const
|
|
46891
|
+
const call = index.expression.ast`
|
|
46788
46892
|
(function (${key}) {
|
|
46789
46893
|
function ${id}(${params}) {
|
|
46790
46894
|
return ${cloneNode3(key)}.apply(this, arguments);
|
|
@@ -46799,7 +46903,7 @@ function ensureFunctionName(supportUnicodeId) {
|
|
|
46799
46903
|
`;
|
|
46800
46904
|
|
|
46801
46905
|
return this
|
|
46802
|
-
.replaceWith(
|
|
46906
|
+
.replaceWith(call)[0]
|
|
46803
46907
|
.get('arguments.0');
|
|
46804
46908
|
}
|
|
46805
46909
|
|
|
@@ -46810,7 +46914,7 @@ function getFunctionArity(node) {
|
|
|
46810
46914
|
|
|
46811
46915
|
var {
|
|
46812
46916
|
STATEMENT_OR_BLOCK_KEYS: STATEMENT_OR_BLOCK_KEYS2,
|
|
46813
|
-
VISITOR_KEYS: VISITOR_KEYS$
|
|
46917
|
+
VISITOR_KEYS: VISITOR_KEYS$12,
|
|
46814
46918
|
isBlockStatement: isBlockStatement2,
|
|
46815
46919
|
isExpression: isExpression3,
|
|
46816
46920
|
isIdentifier: isIdentifier4,
|
|
@@ -47056,7 +47160,7 @@ function _guessExecutionStatusRelativeToCached(base, target, cache2) {
|
|
|
47056
47160
|
return divergence.target.key > divergence.this.key ? 'before' : 'after';
|
|
47057
47161
|
}
|
|
47058
47162
|
|
|
47059
|
-
const keys2 = VISITOR_KEYS$
|
|
47163
|
+
const keys2 = VISITOR_KEYS$12[commonPath.type];
|
|
47060
47164
|
|
|
47061
47165
|
const keyPosition = {
|
|
47062
47166
|
this: keys2.indexOf(divergence.this.parentKey),
|
|
@@ -47994,7 +48098,6 @@ var methods = {
|
|
|
47994
48098
|
isConstantExpression,
|
|
47995
48099
|
isInStrictMode,
|
|
47996
48100
|
isDenylisted,
|
|
47997
|
-
visit,
|
|
47998
48101
|
skip,
|
|
47999
48102
|
skipKey,
|
|
48000
48103
|
stop,
|
|
@@ -48048,325 +48151,6 @@ for (const type of Object.keys(virtualTypes)) {
|
|
|
48048
48151
|
TYPES.push(type);
|
|
48049
48152
|
}
|
|
48050
48153
|
|
|
48051
|
-
var {VISITOR_KEYS: VISITOR_KEYS$2} = lib_exports;
|
|
48052
|
-
|
|
48053
|
-
var TraversalContext = class {
|
|
48054
|
-
constructor(scope2, opts, state, parentPath) {
|
|
48055
|
-
this.parentPath = parentPath;
|
|
48056
|
-
this.scope = scope2;
|
|
48057
|
-
this.state = state;
|
|
48058
|
-
this.opts = opts;
|
|
48059
|
-
}
|
|
48060
|
-
|
|
48061
|
-
queue = null;
|
|
48062
|
-
priorityQueue = null;
|
|
48063
|
-
shouldVisit(node) {
|
|
48064
|
-
const opts = this.opts;
|
|
48065
|
-
|
|
48066
|
-
if (opts.enter || opts.exit)
|
|
48067
|
-
return true;
|
|
48068
|
-
|
|
48069
|
-
if (opts[node.type])
|
|
48070
|
-
return true;
|
|
48071
|
-
|
|
48072
|
-
const keys2 = VISITOR_KEYS$2[node.type];
|
|
48073
|
-
|
|
48074
|
-
if (!keys2?.length)
|
|
48075
|
-
return false;
|
|
48076
|
-
|
|
48077
|
-
for (const key of keys2) {
|
|
48078
|
-
if (node[key]) {
|
|
48079
|
-
return true;
|
|
48080
|
-
}
|
|
48081
|
-
}
|
|
48082
|
-
|
|
48083
|
-
return false;
|
|
48084
|
-
}
|
|
48085
|
-
|
|
48086
|
-
create(node, container, key, listKey) {
|
|
48087
|
-
return NodePath_Final.get({
|
|
48088
|
-
parentPath: this.parentPath,
|
|
48089
|
-
parent: node,
|
|
48090
|
-
container,
|
|
48091
|
-
key,
|
|
48092
|
-
listKey,
|
|
48093
|
-
});
|
|
48094
|
-
}
|
|
48095
|
-
|
|
48096
|
-
maybeQueue(path, notPriority) {
|
|
48097
|
-
if (this.queue) {
|
|
48098
|
-
if (notPriority) {
|
|
48099
|
-
this.queue.push(path);
|
|
48100
|
-
} else {
|
|
48101
|
-
this.priorityQueue.push(path);
|
|
48102
|
-
}
|
|
48103
|
-
}
|
|
48104
|
-
}
|
|
48105
|
-
|
|
48106
|
-
visitMultiple(container, parent, listKey) {
|
|
48107
|
-
if (container.length === 0)
|
|
48108
|
-
return false;
|
|
48109
|
-
|
|
48110
|
-
const queue = [];
|
|
48111
|
-
|
|
48112
|
-
for (let key = 0; key < container.length; key++) {
|
|
48113
|
-
const node = container[key];
|
|
48114
|
-
|
|
48115
|
-
if (node && this.shouldVisit(node)) {
|
|
48116
|
-
queue.push(this.create(parent, container, key, listKey));
|
|
48117
|
-
}
|
|
48118
|
-
}
|
|
48119
|
-
|
|
48120
|
-
return this.visitQueue(queue);
|
|
48121
|
-
}
|
|
48122
|
-
|
|
48123
|
-
visitSingle(node, key) {
|
|
48124
|
-
if (this.shouldVisit(node[key])) {
|
|
48125
|
-
return this.visitQueue([this.create(node, node, key)]);
|
|
48126
|
-
} else {
|
|
48127
|
-
return false;
|
|
48128
|
-
}
|
|
48129
|
-
}
|
|
48130
|
-
|
|
48131
|
-
visitQueue(queue) {
|
|
48132
|
-
this.queue = queue;
|
|
48133
|
-
this.priorityQueue = [];
|
|
48134
|
-
const visited = /* @__PURE__ */new WeakSet();
|
|
48135
|
-
let stop2 = false;
|
|
48136
|
-
let visitIndex = 0;
|
|
48137
|
-
|
|
48138
|
-
for (; visitIndex < queue.length;) {
|
|
48139
|
-
const path = queue[visitIndex];
|
|
48140
|
-
visitIndex++;
|
|
48141
|
-
resync.call(path);
|
|
48142
|
-
|
|
48143
|
-
if (path.key === null)
|
|
48144
|
-
continue;
|
|
48145
|
-
|
|
48146
|
-
if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {
|
|
48147
|
-
pushContext.call(path, this);
|
|
48148
|
-
}
|
|
48149
|
-
|
|
48150
|
-
const {node} = path;
|
|
48151
|
-
|
|
48152
|
-
if (visited.has(node))
|
|
48153
|
-
continue;
|
|
48154
|
-
|
|
48155
|
-
if (node)
|
|
48156
|
-
visited.add(node);
|
|
48157
|
-
|
|
48158
|
-
if (path.visit()) {
|
|
48159
|
-
stop2 = true;
|
|
48160
|
-
break;
|
|
48161
|
-
}
|
|
48162
|
-
|
|
48163
|
-
if (this.priorityQueue.length) {
|
|
48164
|
-
stop2 = this.visitQueue(this.priorityQueue);
|
|
48165
|
-
this.priorityQueue = [];
|
|
48166
|
-
this.queue = queue;
|
|
48167
|
-
|
|
48168
|
-
if (stop2)
|
|
48169
|
-
break;
|
|
48170
|
-
}
|
|
48171
|
-
}
|
|
48172
|
-
|
|
48173
|
-
for (let i = 0; i < visitIndex; i++) {
|
|
48174
|
-
if (queue[i].key === null)
|
|
48175
|
-
continue;
|
|
48176
|
-
|
|
48177
|
-
popContext.call(queue[i]);
|
|
48178
|
-
}
|
|
48179
|
-
|
|
48180
|
-
this.queue = null;
|
|
48181
|
-
|
|
48182
|
-
return stop2;
|
|
48183
|
-
}
|
|
48184
|
-
|
|
48185
|
-
visit(node, key) {
|
|
48186
|
-
const nodes = node[key];
|
|
48187
|
-
|
|
48188
|
-
if (!nodes)
|
|
48189
|
-
return false;
|
|
48190
|
-
|
|
48191
|
-
if (Array.isArray(nodes)) {
|
|
48192
|
-
return this.visitMultiple(nodes, node, key);
|
|
48193
|
-
} else {
|
|
48194
|
-
return this.visitSingle(node, key);
|
|
48195
|
-
}
|
|
48196
|
-
}
|
|
48197
|
-
};
|
|
48198
|
-
|
|
48199
|
-
var {VISITOR_KEYS: VISITOR_KEYS$12} = lib_exports;
|
|
48200
|
-
|
|
48201
|
-
function _visitPaths(ctx, paths) {
|
|
48202
|
-
ctx.queue = paths;
|
|
48203
|
-
ctx.priorityQueue = [];
|
|
48204
|
-
const visited = /* @__PURE__ */new Set();
|
|
48205
|
-
let stop2 = false;
|
|
48206
|
-
let visitIndex = 0;
|
|
48207
|
-
|
|
48208
|
-
for (; visitIndex < paths.length;) {
|
|
48209
|
-
const path = paths[visitIndex];
|
|
48210
|
-
visitIndex++;
|
|
48211
|
-
resync.call(path);
|
|
48212
|
-
|
|
48213
|
-
if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== ctx) {
|
|
48214
|
-
pushContext.call(path, ctx);
|
|
48215
|
-
}
|
|
48216
|
-
|
|
48217
|
-
if (path.key === null)
|
|
48218
|
-
continue;
|
|
48219
|
-
|
|
48220
|
-
const {node} = path;
|
|
48221
|
-
|
|
48222
|
-
if (visited.has(node))
|
|
48223
|
-
continue;
|
|
48224
|
-
|
|
48225
|
-
if (node)
|
|
48226
|
-
visited.add(node);
|
|
48227
|
-
|
|
48228
|
-
if (_visit(ctx, path)) {
|
|
48229
|
-
stop2 = true;
|
|
48230
|
-
break;
|
|
48231
|
-
}
|
|
48232
|
-
|
|
48233
|
-
if (ctx.priorityQueue.length) {
|
|
48234
|
-
stop2 = _visitPaths(ctx, ctx.priorityQueue);
|
|
48235
|
-
ctx.priorityQueue = [];
|
|
48236
|
-
ctx.queue = paths;
|
|
48237
|
-
|
|
48238
|
-
if (stop2)
|
|
48239
|
-
break;
|
|
48240
|
-
}
|
|
48241
|
-
}
|
|
48242
|
-
|
|
48243
|
-
for (let i = 0; i < visitIndex; i++) {
|
|
48244
|
-
popContext.call(paths[i]);
|
|
48245
|
-
}
|
|
48246
|
-
|
|
48247
|
-
ctx.queue = null;
|
|
48248
|
-
|
|
48249
|
-
return stop2;
|
|
48250
|
-
}
|
|
48251
|
-
|
|
48252
|
-
function _visit(ctx, path) {
|
|
48253
|
-
const node = path.node;
|
|
48254
|
-
|
|
48255
|
-
if (!node) {
|
|
48256
|
-
return false;
|
|
48257
|
-
}
|
|
48258
|
-
|
|
48259
|
-
const opts = ctx.opts;
|
|
48260
|
-
const denylist = opts.denylist;
|
|
48261
|
-
|
|
48262
|
-
if (denylist?.includes(node.type)) {
|
|
48263
|
-
return false;
|
|
48264
|
-
}
|
|
48265
|
-
|
|
48266
|
-
if (opts.shouldSkip?.(path)) {
|
|
48267
|
-
return false;
|
|
48268
|
-
}
|
|
48269
|
-
|
|
48270
|
-
if (path.shouldSkip)
|
|
48271
|
-
return path.shouldStop;
|
|
48272
|
-
|
|
48273
|
-
if (_call.call(path, opts.enter))
|
|
48274
|
-
return path.shouldStop;
|
|
48275
|
-
|
|
48276
|
-
if (path.node) {
|
|
48277
|
-
if (_call.call(path, opts[node.type]?.enter))
|
|
48278
|
-
return path.shouldStop;
|
|
48279
|
-
}
|
|
48280
|
-
|
|
48281
|
-
path.shouldStop = traverseNode(path.node, opts, path.scope, ctx.state, path, path.skipKeys);
|
|
48282
|
-
|
|
48283
|
-
if (path.node) {
|
|
48284
|
-
if (_call.call(path, opts.exit))
|
|
48285
|
-
return true;
|
|
48286
|
-
}
|
|
48287
|
-
|
|
48288
|
-
if (path.node) {
|
|
48289
|
-
_call.call(path, opts[node.type]?.exit);
|
|
48290
|
-
}
|
|
48291
|
-
|
|
48292
|
-
return path.shouldStop;
|
|
48293
|
-
}
|
|
48294
|
-
|
|
48295
|
-
function traverseNode(node, opts, scope2, state, path, skipKeys, visitSelf) {
|
|
48296
|
-
const keys2 = VISITOR_KEYS$12[node.type];
|
|
48297
|
-
|
|
48298
|
-
if (!keys2?.length)
|
|
48299
|
-
return false;
|
|
48300
|
-
|
|
48301
|
-
const ctx = new TraversalContext(scope2, opts, state, path);
|
|
48302
|
-
|
|
48303
|
-
if (visitSelf) {
|
|
48304
|
-
if (skipKeys?.[path.parentKey])
|
|
48305
|
-
return false;
|
|
48306
|
-
|
|
48307
|
-
return _visitPaths(ctx, [path]);
|
|
48308
|
-
}
|
|
48309
|
-
|
|
48310
|
-
const hub = path == null ? node.type === 'Program' || node.type === 'File' ? new Hub() : void 0 : path.hub;
|
|
48311
|
-
|
|
48312
|
-
for (const key of keys2) {
|
|
48313
|
-
if (skipKeys?.[key])
|
|
48314
|
-
continue;
|
|
48315
|
-
|
|
48316
|
-
const prop = node[key];
|
|
48317
|
-
|
|
48318
|
-
if (!prop)
|
|
48319
|
-
continue;
|
|
48320
|
-
|
|
48321
|
-
if (Array.isArray(prop)) {
|
|
48322
|
-
if (!prop.length)
|
|
48323
|
-
continue;
|
|
48324
|
-
|
|
48325
|
-
const paths = [];
|
|
48326
|
-
|
|
48327
|
-
for (let i = 0; i < prop.length; i++) {
|
|
48328
|
-
const childPath = NodePath_Final.get({
|
|
48329
|
-
parentPath: path,
|
|
48330
|
-
parent: node,
|
|
48331
|
-
container: prop,
|
|
48332
|
-
key: i,
|
|
48333
|
-
listKey: key,
|
|
48334
|
-
hub,
|
|
48335
|
-
});
|
|
48336
|
-
|
|
48337
|
-
paths.push(childPath);
|
|
48338
|
-
}
|
|
48339
|
-
|
|
48340
|
-
if (_visitPaths(ctx, paths))
|
|
48341
|
-
return true;
|
|
48342
|
-
} else {
|
|
48343
|
-
if (_visitPaths(ctx, [
|
|
48344
|
-
NodePath_Final.get({parentPath: path, parent: node, container: node, key, listKey: null, hub}),
|
|
48345
|
-
])) {
|
|
48346
|
-
return true;
|
|
48347
|
-
}
|
|
48348
|
-
}
|
|
48349
|
-
}
|
|
48350
|
-
|
|
48351
|
-
return false;
|
|
48352
|
-
}
|
|
48353
|
-
|
|
48354
|
-
function call(key) {
|
|
48355
|
-
const opts = this.opts;
|
|
48356
|
-
this.debug(key);
|
|
48357
|
-
|
|
48358
|
-
if (this.node) {
|
|
48359
|
-
if (_call.call(this, opts[key]))
|
|
48360
|
-
return true;
|
|
48361
|
-
}
|
|
48362
|
-
|
|
48363
|
-
if (this.node) {
|
|
48364
|
-
return _call.call(this, opts[this.node.type]?.[key]);
|
|
48365
|
-
}
|
|
48366
|
-
|
|
48367
|
-
return false;
|
|
48368
|
-
}
|
|
48369
|
-
|
|
48370
48154
|
function _call(fns) {
|
|
48371
48155
|
if (!fns)
|
|
48372
48156
|
return false;
|
|
@@ -48404,42 +48188,6 @@ function isDenylisted() {
|
|
|
48404
48188
|
return !!this.opts.denylist?.includes(this.node.type);
|
|
48405
48189
|
}
|
|
48406
48190
|
|
|
48407
|
-
function restoreContext(path, context) {
|
|
48408
|
-
if (path.context !== context) {
|
|
48409
|
-
path.context = context;
|
|
48410
|
-
path.state = context.state;
|
|
48411
|
-
path.opts = context.opts;
|
|
48412
|
-
}
|
|
48413
|
-
}
|
|
48414
|
-
|
|
48415
|
-
function visit() {
|
|
48416
|
-
if (!this.node) {
|
|
48417
|
-
return false;
|
|
48418
|
-
}
|
|
48419
|
-
|
|
48420
|
-
if (this.isDenylisted()) {
|
|
48421
|
-
return false;
|
|
48422
|
-
}
|
|
48423
|
-
|
|
48424
|
-
if (this.opts.shouldSkip?.(this)) {
|
|
48425
|
-
return false;
|
|
48426
|
-
}
|
|
48427
|
-
|
|
48428
|
-
const currentContext = this.context;
|
|
48429
|
-
|
|
48430
|
-
if (this.shouldSkip || call.call(this, 'enter')) {
|
|
48431
|
-
this.debug('Skip...');
|
|
48432
|
-
return this.shouldStop;
|
|
48433
|
-
}
|
|
48434
|
-
|
|
48435
|
-
restoreContext(this, currentContext);
|
|
48436
|
-
this.debug('Recursing into...');
|
|
48437
|
-
this.shouldStop = traverseNode(this.node, this.opts, this.scope, this.state, this, this.skipKeys);
|
|
48438
|
-
restoreContext(this, currentContext);
|
|
48439
|
-
call.call(this, 'exit');
|
|
48440
|
-
return this.shouldStop;
|
|
48441
|
-
}
|
|
48442
|
-
|
|
48443
48191
|
function skip() {
|
|
48444
48192
|
this.shouldSkip = true;
|
|
48445
48193
|
}
|