@putout/babel 4.5.7 → 4.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/bundle/index.js +333 -494
- package/bundle/metafile-cjs.json +1 -0
- package/package.json +2 -2
package/bundle/index.js
CHANGED
|
@@ -8869,12 +8869,8 @@ defineType$4('NumericLiteral', {
|
|
|
8869
8869
|
if (1 / val < 0 || !Number.isFinite(val)) {
|
|
8870
8870
|
const error = new Error(`NumericLiterals must be non-negative finite numbers. You can use t.valueToNode(${val}) instead.`);
|
|
8871
8871
|
|
|
8872
|
-
{
|
|
8873
|
-
|
|
8874
|
-
if (!new Error().stack.includes('regenerator')) {
|
|
8875
|
-
throw error;
|
|
8876
|
-
}
|
|
8877
|
-
}
|
|
8872
|
+
if (!new Error().stack.includes('regenerator')) {
|
|
8873
|
+
throw error;
|
|
8878
8874
|
}
|
|
8879
8875
|
}
|
|
8880
8876
|
}, {
|
|
@@ -11820,24 +11816,22 @@ defineType('TSLiteralType', {
|
|
|
11820
11816
|
},
|
|
11821
11817
|
},
|
|
11822
11818
|
});
|
|
11823
|
-
{
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11830
|
-
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
});
|
|
11840
|
-
}
|
|
11819
|
+
defineType('TSClassImplements', {
|
|
11820
|
+
aliases: ['TSType'],
|
|
11821
|
+
visitor: ['expression', 'typeArguments'],
|
|
11822
|
+
fields: {
|
|
11823
|
+
expression: validateType('Expression'),
|
|
11824
|
+
typeArguments: validateOptionalType('TSTypeParameterInstantiation'),
|
|
11825
|
+
},
|
|
11826
|
+
});
|
|
11827
|
+
defineType('TSInterfaceHeritage', {
|
|
11828
|
+
aliases: ['TSType'],
|
|
11829
|
+
visitor: ['expression', 'typeArguments'],
|
|
11830
|
+
fields: {
|
|
11831
|
+
expression: validateType('Expression'),
|
|
11832
|
+
typeArguments: validateOptionalType('TSTypeParameterInstantiation'),
|
|
11833
|
+
},
|
|
11834
|
+
});
|
|
11841
11835
|
defineType('TSInterfaceDeclaration', {
|
|
11842
11836
|
aliases: ['Statement', 'Declaration'],
|
|
11843
11837
|
visitor: [
|
|
@@ -11915,18 +11909,16 @@ defineType('TSEnumBody', {
|
|
|
11915
11909
|
members: validateArrayOfType('TSEnumMember'),
|
|
11916
11910
|
},
|
|
11917
11911
|
});
|
|
11918
|
-
{
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
|
|
11922
|
-
|
|
11923
|
-
|
|
11924
|
-
|
|
11925
|
-
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
});
|
|
11929
|
-
}
|
|
11912
|
+
defineType('TSEnumDeclaration', {
|
|
11913
|
+
aliases: ['Statement', 'Declaration'],
|
|
11914
|
+
visitor: ['id', 'body'],
|
|
11915
|
+
fields: {
|
|
11916
|
+
declare: validateOptional(bool),
|
|
11917
|
+
const: validateOptional(bool),
|
|
11918
|
+
id: validateType('Identifier'),
|
|
11919
|
+
body: validateType('TSEnumBody'),
|
|
11920
|
+
},
|
|
11921
|
+
});
|
|
11930
11922
|
defineType('TSEnumMember', {
|
|
11931
11923
|
visitor: ['id', 'initializer'],
|
|
11932
11924
|
fields: {
|
|
@@ -15487,12 +15479,10 @@ var b = /* @__PURE__ */Object.freeze({
|
|
|
15487
15479
|
});
|
|
15488
15480
|
|
|
15489
15481
|
function alias(lowercase) {
|
|
15490
|
-
{
|
|
15491
|
-
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
};
|
|
15495
|
-
}
|
|
15482
|
+
return function() {
|
|
15483
|
+
deprecationWarning(lowercase.replace(/^(?:ts|jsx|[a-z])/, (x) => x.toUpperCase()), lowercase, 'Usage of builders starting with an uppercase letter such as ', 'uppercase builders');
|
|
15484
|
+
return b[lowercase](...arguments);
|
|
15485
|
+
};
|
|
15496
15486
|
}
|
|
15497
15487
|
|
|
15498
15488
|
var ArrayExpression = alias('arrayExpression');
|
|
@@ -18204,9 +18194,7 @@ function isBinding(node, parent, grandparent) {
|
|
|
18204
18194
|
}
|
|
18205
18195
|
|
|
18206
18196
|
function isLet(node) {
|
|
18207
|
-
|
|
18208
|
-
return isVariableDeclaration(node) && node.kind !== 'var';
|
|
18209
|
-
}
|
|
18197
|
+
return isVariableDeclaration(node) && node.kind !== 'var';
|
|
18210
18198
|
}
|
|
18211
18199
|
|
|
18212
18200
|
function isBlockScoped(node) {
|
|
@@ -18462,9 +18450,7 @@ function isValidES3Identifier(name) {
|
|
|
18462
18450
|
}
|
|
18463
18451
|
|
|
18464
18452
|
function isVar(node) {
|
|
18465
|
-
|
|
18466
|
-
return isVariableDeclaration(node) && node.kind === 'var';
|
|
18467
|
-
}
|
|
18453
|
+
return isVariableDeclaration(node) && node.kind === 'var';
|
|
18468
18454
|
}
|
|
18469
18455
|
|
|
18470
18456
|
var react = {
|
|
@@ -18896,9 +18882,7 @@ function getOptions(opts) {
|
|
|
18896
18882
|
options.startColumn = options.startIndex;
|
|
18897
18883
|
}
|
|
18898
18884
|
} else if (opts.startColumn == null || opts.startIndex == null) {
|
|
18899
|
-
|
|
18900
|
-
throw new Error('With a `startLine > 1` you must also specify `startIndex` and `startColumn`.');
|
|
18901
|
-
}
|
|
18885
|
+
throw new Error('With a `startLine > 1` you must also specify `startIndex` and `startColumn`.');
|
|
18902
18886
|
}
|
|
18903
18887
|
|
|
18904
18888
|
if (options.sourceType === 'commonjs') {
|
|
@@ -21705,12 +21689,11 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21705
21689
|
break;
|
|
21706
21690
|
|
|
21707
21691
|
case 62:
|
|
21708
|
-
case 125:
|
|
21692
|
+
case 125:
|
|
21709
21693
|
this.raise(JsxErrors.UnexpectedToken, this.state.curPosition(), {
|
|
21710
21694
|
unexpected: this.input[this.state.pos],
|
|
21711
21695
|
HTMLEntity: ch === 125 ? '}' : '>',
|
|
21712
21696
|
});
|
|
21713
|
-
}
|
|
21714
21697
|
|
|
21715
21698
|
default:
|
|
21716
21699
|
if (isNewLine(ch)) {
|
|
@@ -21916,11 +21899,10 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21916
21899
|
} else {
|
|
21917
21900
|
const expression2 = this.parseExpression();
|
|
21918
21901
|
|
|
21919
|
-
{
|
|
21920
|
-
|
|
21921
|
-
this.raise(JsxErrors.UnexpectedSequenceExpression, expression2.expressions[1]);
|
|
21922
|
-
}
|
|
21902
|
+
if (expression2.type === 'SequenceExpression' && !expression2.extra?.parenthesized) {
|
|
21903
|
+
this.raise(JsxErrors.UnexpectedSequenceExpression, expression2.expressions[1]);
|
|
21923
21904
|
}
|
|
21905
|
+
|
|
21924
21906
|
node.expression = expression2;
|
|
21925
21907
|
}
|
|
21926
21908
|
|
|
@@ -22490,8 +22472,7 @@ var CommentsParser = class extends BaseParser {
|
|
|
22490
22472
|
if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) {
|
|
22491
22473
|
switch(node.type) {
|
|
22492
22474
|
case 'ObjectExpression':
|
|
22493
|
-
case 'ObjectPattern':
|
|
22494
|
-
case 'RecordExpression':
|
|
22475
|
+
case 'ObjectPattern':
|
|
22495
22476
|
adjustInnerComments(node, node.properties, commentWS);
|
|
22496
22477
|
break;
|
|
22497
22478
|
|
|
@@ -22514,8 +22495,7 @@ var CommentsParser = class extends BaseParser {
|
|
|
22514
22495
|
break;
|
|
22515
22496
|
|
|
22516
22497
|
case 'ArrayExpression':
|
|
22517
|
-
case 'ArrayPattern':
|
|
22518
|
-
case 'TupleExpression':
|
|
22498
|
+
case 'ArrayPattern':
|
|
22519
22499
|
adjustInnerComments(node, node.elements, commentWS);
|
|
22520
22500
|
break;
|
|
22521
22501
|
|
|
@@ -22524,10 +22504,9 @@ var CommentsParser = class extends BaseParser {
|
|
|
22524
22504
|
adjustInnerComments(node, node.specifiers, commentWS);
|
|
22525
22505
|
break;
|
|
22526
22506
|
|
|
22527
|
-
case 'TSEnumDeclaration':
|
|
22507
|
+
case 'TSEnumDeclaration':
|
|
22528
22508
|
setInnerComments(node, comments);
|
|
22529
|
-
|
|
22530
|
-
break;
|
|
22509
|
+
break;
|
|
22531
22510
|
|
|
22532
22511
|
case 'TSEnumBody':
|
|
22533
22512
|
adjustInnerComments(node, node.members, commentWS);
|
|
@@ -23840,24 +23819,20 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23840
23819
|
this.finishToken(12);
|
|
23841
23820
|
return;
|
|
23842
23821
|
|
|
23843
|
-
case 91:
|
|
23822
|
+
case 91:
|
|
23844
23823
|
++this.state.pos;
|
|
23845
23824
|
this.finishToken(0);
|
|
23846
|
-
|
|
23847
|
-
|
|
23848
|
-
return;
|
|
23825
|
+
return;
|
|
23849
23826
|
|
|
23850
23827
|
case 93:
|
|
23851
23828
|
++this.state.pos;
|
|
23852
23829
|
this.finishToken(3);
|
|
23853
23830
|
return;
|
|
23854
23831
|
|
|
23855
|
-
case 123:
|
|
23832
|
+
case 123:
|
|
23856
23833
|
++this.state.pos;
|
|
23857
23834
|
this.finishToken(5);
|
|
23858
|
-
|
|
23859
|
-
|
|
23860
|
-
return;
|
|
23835
|
+
return;
|
|
23861
23836
|
|
|
23862
23837
|
case 125:
|
|
23863
23838
|
++this.state.pos;
|
|
@@ -24899,11 +24874,10 @@ var UtilParser = class extends Tokenizer {
|
|
|
24899
24874
|
scopeFlags |= 512;
|
|
24900
24875
|
}
|
|
24901
24876
|
|
|
24902
|
-
{
|
|
24903
|
-
|
|
24904
|
-
scopeFlags |= 16 | 32;
|
|
24905
|
-
}
|
|
24877
|
+
if (this.optionFlags & 16) {
|
|
24878
|
+
scopeFlags |= 16 | 32;
|
|
24906
24879
|
}
|
|
24880
|
+
|
|
24907
24881
|
this.scope.enter(scopeFlags);
|
|
24908
24882
|
}
|
|
24909
24883
|
|
|
@@ -26009,13 +25983,9 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26009
25983
|
|
|
26010
25984
|
if (!this.match(134)) {
|
|
26011
25985
|
this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
|
|
26012
|
-
|
|
26013
|
-
node.argument = this.tsParseNonConditionalType();
|
|
26014
|
-
}
|
|
25986
|
+
node.argument = this.tsParseNonConditionalType();
|
|
26015
25987
|
} else {
|
|
26016
|
-
|
|
26017
|
-
node.argument = this.tsParseLiteralTypeNode();
|
|
26018
|
-
}
|
|
25988
|
+
node.argument = this.tsParseLiteralTypeNode();
|
|
26019
25989
|
}
|
|
26020
25990
|
|
|
26021
25991
|
if (this.eat(12)) {
|
|
@@ -26031,9 +26001,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26031
26001
|
}
|
|
26032
26002
|
|
|
26033
26003
|
if (this.match(47)) {
|
|
26034
|
-
|
|
26035
|
-
node.typeArguments = this.tsParseTypeArguments();
|
|
26036
|
-
}
|
|
26004
|
+
node.typeArguments = this.tsParseTypeArguments();
|
|
26037
26005
|
}
|
|
26038
26006
|
|
|
26039
26007
|
return this.finishNode(node, 'TSImportType');
|
|
@@ -26116,9 +26084,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26116
26084
|
node.typeName = this.tsParseEntityName(1);
|
|
26117
26085
|
|
|
26118
26086
|
if (!this.hasPrecedingLineBreak() && this.match(47)) {
|
|
26119
|
-
|
|
26120
|
-
node.typeArguments = this.tsParseTypeArguments();
|
|
26121
|
-
}
|
|
26087
|
+
node.typeArguments = this.tsParseTypeArguments();
|
|
26122
26088
|
}
|
|
26123
26089
|
|
|
26124
26090
|
return this.finishNode(node, 'TSTypeReference');
|
|
@@ -26147,15 +26113,11 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26147
26113
|
if (this.match(83)) {
|
|
26148
26114
|
node.exprName = this.tsParseImportType();
|
|
26149
26115
|
} else {
|
|
26150
|
-
|
|
26151
|
-
node.exprName = this.tsParseEntityName(1);
|
|
26152
|
-
}
|
|
26116
|
+
node.exprName = this.tsParseEntityName(1);
|
|
26153
26117
|
}
|
|
26154
26118
|
|
|
26155
26119
|
if (!this.hasPrecedingLineBreak() && this.match(47)) {
|
|
26156
|
-
|
|
26157
|
-
node.typeArguments = this.tsParseTypeArguments();
|
|
26158
|
-
}
|
|
26120
|
+
node.typeArguments = this.tsParseTypeArguments();
|
|
26159
26121
|
}
|
|
26160
26122
|
|
|
26161
26123
|
return this.finishNode(node, 'TSTypeQuery');
|
|
@@ -26455,10 +26417,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26455
26417
|
}
|
|
26456
26418
|
|
|
26457
26419
|
this.expect(0);
|
|
26458
|
-
|
|
26459
|
-
|
|
26460
|
-
node.constraint = this.tsExpectThenParseType(58);
|
|
26461
|
-
}
|
|
26420
|
+
node.key = this.tsParseTypeParameterName();
|
|
26421
|
+
node.constraint = this.tsExpectThenParseType(58);
|
|
26462
26422
|
node.nameType = this.eatContextual(93) ? this.tsParseType() : null;
|
|
26463
26423
|
this.expect(3);
|
|
26464
26424
|
|
|
@@ -26618,34 +26578,32 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26618
26578
|
}
|
|
26619
26579
|
|
|
26620
26580
|
tsParseTemplateLiteralType() {
|
|
26621
|
-
|
|
26622
|
-
|
|
26623
|
-
|
|
26624
|
-
|
|
26581
|
+
const startLoc = this.state.startLoc;
|
|
26582
|
+
let curElt = this.parseTemplateElement(false);
|
|
26583
|
+
const quasis = [curElt];
|
|
26584
|
+
|
|
26585
|
+
if (curElt.tail) {
|
|
26586
|
+
const node = this.startNodeAt(startLoc);
|
|
26587
|
+
const literal = this.startNodeAt(startLoc);
|
|
26625
26588
|
|
|
26626
|
-
|
|
26627
|
-
|
|
26628
|
-
|
|
26629
|
-
|
|
26630
|
-
|
|
26631
|
-
|
|
26632
|
-
|
|
26633
|
-
|
|
26634
|
-
|
|
26635
|
-
|
|
26636
|
-
|
|
26637
|
-
while (!curElt.tail) {
|
|
26638
|
-
substitutions.push(this.tsParseType());
|
|
26639
|
-
this.readTemplateContinuation();
|
|
26640
|
-
quasis.push(curElt = this.parseTemplateElement(false));
|
|
26641
|
-
}
|
|
26642
|
-
|
|
26643
|
-
const node = this.startNodeAt(startLoc);
|
|
26644
|
-
|
|
26645
|
-
node.types = substitutions;
|
|
26646
|
-
node.quasis = quasis;
|
|
26647
|
-
return this.finishNode(node, 'TSTemplateLiteralType');
|
|
26589
|
+
literal.expressions = [];
|
|
26590
|
+
literal.quasis = quasis;
|
|
26591
|
+
node.literal = this.finishNode(literal, 'TemplateLiteral');
|
|
26592
|
+
return this.finishNode(node, 'TSLiteralType');
|
|
26593
|
+
} else {
|
|
26594
|
+
const substitutions = [];
|
|
26595
|
+
|
|
26596
|
+
while (!curElt.tail) {
|
|
26597
|
+
substitutions.push(this.tsParseType());
|
|
26598
|
+
this.readTemplateContinuation();
|
|
26599
|
+
quasis.push(curElt = this.parseTemplateElement(false));
|
|
26648
26600
|
}
|
|
26601
|
+
|
|
26602
|
+
const node = this.startNodeAt(startLoc);
|
|
26603
|
+
|
|
26604
|
+
node.types = substitutions;
|
|
26605
|
+
node.quasis = quasis;
|
|
26606
|
+
return this.finishNode(node, 'TSTemplateLiteralType');
|
|
26649
26607
|
}
|
|
26650
26608
|
}
|
|
26651
26609
|
|
|
@@ -26705,7 +26663,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26705
26663
|
case 0:
|
|
26706
26664
|
return this.tsParseTupleType();
|
|
26707
26665
|
|
|
26708
|
-
case 10:
|
|
26666
|
+
case 10:
|
|
26709
26667
|
if (!(this.optionFlags & 1024)) {
|
|
26710
26668
|
const startLoc = this.state.startLoc;
|
|
26711
26669
|
this.next();
|
|
@@ -26715,9 +26673,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26715
26673
|
this.addExtra(type, 'parenStart', startLoc.index);
|
|
26716
26674
|
return type;
|
|
26717
26675
|
}
|
|
26718
|
-
|
|
26719
|
-
|
|
26720
|
-
return this.tsParseParenthesizedType();
|
|
26676
|
+
|
|
26677
|
+
return this.tsParseParenthesizedType();
|
|
26721
26678
|
|
|
26722
26679
|
case 25:
|
|
26723
26680
|
case 24:
|
|
@@ -27071,32 +27028,30 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27071
27028
|
tsParseHeritageClause(token) {
|
|
27072
27029
|
const originalStartLoc = this.state.startLoc;
|
|
27073
27030
|
const delimitedList = this.tsParseDelimitedList('HeritageClauseElement', () => {
|
|
27074
|
-
|
|
27075
|
-
|
|
27076
|
-
|
|
27077
|
-
|
|
27078
|
-
|
|
27079
|
-
|
|
27080
|
-
});
|
|
27081
|
-
}
|
|
27082
|
-
|
|
27083
|
-
const nodeType = token === 'extends' ? 'TSInterfaceHeritage' : 'TSClassImplements';
|
|
27084
|
-
|
|
27085
|
-
if (expression2.type === 'TSInstantiationExpression') {
|
|
27086
|
-
expression2.type = nodeType;
|
|
27087
|
-
return expression2;
|
|
27088
|
-
}
|
|
27089
|
-
|
|
27090
|
-
const node = this.startNodeAtNode(expression2);
|
|
27091
|
-
|
|
27092
|
-
node.expression = expression2;
|
|
27093
|
-
|
|
27094
|
-
if (this.match(47) || this.match(51)) {
|
|
27095
|
-
node.typeArguments = this.tsParseTypeArgumentsInExpression();
|
|
27096
|
-
}
|
|
27097
|
-
|
|
27098
|
-
return this.finishNode(node, nodeType);
|
|
27031
|
+
const expression2 = super.parseExprSubscripts();
|
|
27032
|
+
|
|
27033
|
+
if (!tsIsEntityName(expression2)) {
|
|
27034
|
+
this.raise(TSErrors.InvalidHeritageClauseType, expression2.loc.start, {
|
|
27035
|
+
token,
|
|
27036
|
+
});
|
|
27099
27037
|
}
|
|
27038
|
+
|
|
27039
|
+
const nodeType = token === 'extends' ? 'TSInterfaceHeritage' : 'TSClassImplements';
|
|
27040
|
+
|
|
27041
|
+
if (expression2.type === 'TSInstantiationExpression') {
|
|
27042
|
+
expression2.type = nodeType;
|
|
27043
|
+
return expression2;
|
|
27044
|
+
}
|
|
27045
|
+
|
|
27046
|
+
const node = this.startNodeAtNode(expression2);
|
|
27047
|
+
|
|
27048
|
+
node.expression = expression2;
|
|
27049
|
+
|
|
27050
|
+
if (this.match(47) || this.match(51)) {
|
|
27051
|
+
node.typeArguments = this.tsParseTypeArgumentsInExpression();
|
|
27052
|
+
}
|
|
27053
|
+
|
|
27054
|
+
return this.finishNode(node, nodeType);
|
|
27100
27055
|
});
|
|
27101
27056
|
|
|
27102
27057
|
if (!delimitedList.length) {
|
|
@@ -27247,10 +27202,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27247
27202
|
this.expectContextual(126);
|
|
27248
27203
|
node.id = this.parseIdentifier();
|
|
27249
27204
|
this.checkIdentifier(node.id, node.const ? 8971 : 8459);
|
|
27250
|
-
|
|
27251
|
-
node.body = this.tsParseEnumBody();
|
|
27252
|
-
}
|
|
27253
|
-
|
|
27205
|
+
node.body = this.tsParseEnumBody();
|
|
27254
27206
|
return this.finishNode(node, 'TSEnumDeclaration');
|
|
27255
27207
|
}
|
|
27256
27208
|
|
|
@@ -27278,14 +27230,11 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27278
27230
|
this.checkIdentifier(node.id, 1024);
|
|
27279
27231
|
}
|
|
27280
27232
|
|
|
27281
|
-
|
|
27282
|
-
|
|
27283
|
-
|
|
27284
|
-
|
|
27285
|
-
|
|
27286
|
-
this.scope.exit();
|
|
27287
|
-
}
|
|
27288
|
-
|
|
27233
|
+
this.scope.enter(1024);
|
|
27234
|
+
this.prodParam.enter(0);
|
|
27235
|
+
node.body = this.tsParseModuleBlock();
|
|
27236
|
+
this.prodParam.exit();
|
|
27237
|
+
this.scope.exit();
|
|
27289
27238
|
return this.finishNode(node, 'TSModuleDeclaration');
|
|
27290
27239
|
}
|
|
27291
27240
|
|
|
@@ -27755,10 +27704,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27755
27704
|
if (tokenIsTemplate(this.state.type)) {
|
|
27756
27705
|
const result2 = super.parseTaggedTemplateExpression(base, startLoc, state);
|
|
27757
27706
|
|
|
27758
|
-
|
|
27759
|
-
result2.typeArguments = typeArguments;
|
|
27760
|
-
}
|
|
27761
|
-
|
|
27707
|
+
result2.typeArguments = typeArguments;
|
|
27762
27708
|
return result2;
|
|
27763
27709
|
}
|
|
27764
27710
|
|
|
@@ -27768,9 +27714,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27768
27714
|
node2.callee = base;
|
|
27769
27715
|
node2.arguments = this.parseCallExpressionArguments();
|
|
27770
27716
|
this.tsCheckForInvalidTypeCasts(node2.arguments);
|
|
27771
|
-
|
|
27772
|
-
|
|
27773
|
-
}
|
|
27717
|
+
node2.typeArguments = typeArguments;
|
|
27718
|
+
|
|
27774
27719
|
if (state.optionalChainMember) {
|
|
27775
27720
|
node2.optional = isOptionalCall;
|
|
27776
27721
|
}
|
|
@@ -27787,10 +27732,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27787
27732
|
const node = this.startNodeAt(startLoc);
|
|
27788
27733
|
|
|
27789
27734
|
node.expression = base;
|
|
27790
|
-
|
|
27791
|
-
node.typeArguments = typeArguments;
|
|
27792
|
-
}
|
|
27793
|
-
|
|
27735
|
+
node.typeArguments = typeArguments;
|
|
27794
27736
|
return this.finishNode(node, 'TSInstantiationExpression');
|
|
27795
27737
|
});
|
|
27796
27738
|
|
|
@@ -27821,9 +27763,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27821
27763
|
const {callee} = node;
|
|
27822
27764
|
|
|
27823
27765
|
if (callee.type === 'TSInstantiationExpression' && !callee.extra?.parenthesized) {
|
|
27824
|
-
|
|
27825
|
-
node.typeArguments = callee.typeArguments;
|
|
27826
|
-
}
|
|
27766
|
+
node.typeArguments = callee.typeArguments;
|
|
27827
27767
|
node.callee = callee.expression;
|
|
27828
27768
|
}
|
|
27829
27769
|
}
|
|
@@ -27940,14 +27880,12 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27940
27880
|
|
|
27941
27881
|
const declaration = this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier, true);
|
|
27942
27882
|
|
|
27943
|
-
|
|
27944
|
-
|
|
27945
|
-
|
|
27946
|
-
|
|
27947
|
-
|
|
27948
|
-
|
|
27949
|
-
return this.finishNode(node, 'ExportNamedDeclaration');
|
|
27950
|
-
}
|
|
27883
|
+
node.attributes = [];
|
|
27884
|
+
node.declaration = declaration;
|
|
27885
|
+
node.exportKind = 'value';
|
|
27886
|
+
node.source = null;
|
|
27887
|
+
node.specifiers = [];
|
|
27888
|
+
return this.finishNode(node, 'ExportNamedDeclaration');
|
|
27951
27889
|
} else if (this.eat(29)) {
|
|
27952
27890
|
const assign = node;
|
|
27953
27891
|
|
|
@@ -28413,9 +28351,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28413
28351
|
super.parseClassSuper(node);
|
|
28414
28352
|
|
|
28415
28353
|
if (node.superClass && (this.match(47) || this.match(51))) {
|
|
28416
|
-
|
|
28417
|
-
node.superTypeArguments = this.tsParseTypeArgumentsInExpression();
|
|
28418
|
-
}
|
|
28354
|
+
node.superTypeArguments = this.tsParseTypeArgumentsInExpression();
|
|
28419
28355
|
}
|
|
28420
28356
|
|
|
28421
28357
|
if (this.eatContextual(113)) {
|
|
@@ -28507,15 +28443,14 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28507
28443
|
}
|
|
28508
28444
|
|
|
28509
28445
|
expr.typeParameters = typeParameters;
|
|
28510
|
-
|
|
28511
|
-
|
|
28512
|
-
|
|
28513
|
-
|
|
28514
|
-
|
|
28515
|
-
|
|
28516
|
-
|
|
28517
|
-
|
|
28518
|
-
}
|
|
28446
|
+
|
|
28447
|
+
if (this.hasPlugin('jsx') && expr.typeParameters.params.length === 1 && !expr.typeParameters.extra?.trailingComma) {
|
|
28448
|
+
const parameter = expr.typeParameters.params[0];
|
|
28449
|
+
|
|
28450
|
+
if (!parameter.constraint) {
|
|
28451
|
+
this.raise(TSErrors.SingleTypeParameterWithoutTrailingComma, createPositionWithColumnOffset(parameter.loc.end, 1), {
|
|
28452
|
+
typeParameterName: parameter.name.name,
|
|
28453
|
+
});
|
|
28519
28454
|
}
|
|
28520
28455
|
}
|
|
28521
28456
|
|
|
@@ -28722,10 +28657,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28722
28657
|
if (this.match(10)) {
|
|
28723
28658
|
const call2 = super.parseMaybeDecoratorArguments(expr, startLoc);
|
|
28724
28659
|
|
|
28725
|
-
|
|
28726
|
-
call2.typeArguments = typeArguments;
|
|
28727
|
-
}
|
|
28728
|
-
|
|
28660
|
+
call2.typeArguments = typeArguments;
|
|
28729
28661
|
return call2;
|
|
28730
28662
|
}
|
|
28731
28663
|
|
|
@@ -28839,9 +28771,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28839
28771
|
const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression());
|
|
28840
28772
|
|
|
28841
28773
|
if (typeArguments) {
|
|
28842
|
-
|
|
28843
|
-
node.typeArguments = typeArguments;
|
|
28844
|
-
}
|
|
28774
|
+
node.typeArguments = typeArguments;
|
|
28845
28775
|
}
|
|
28846
28776
|
}
|
|
28847
28777
|
|
|
@@ -29148,10 +29078,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
29148
29078
|
case 'TSImportType':
|
|
29149
29079
|
node.qualifier ?? (node.qualifier = null);
|
|
29150
29080
|
node.options ?? (node.options = null);
|
|
29151
|
-
|
|
29152
|
-
node.typeArguments ?? (node.typeArguments = null);
|
|
29153
|
-
}
|
|
29154
|
-
|
|
29081
|
+
node.typeArguments ?? (node.typeArguments = null);
|
|
29155
29082
|
return;
|
|
29156
29083
|
|
|
29157
29084
|
case 'TSInterfaceDeclaration':
|
|
@@ -29649,27 +29576,19 @@ function validatePlugins(pluginsMap) {
|
|
|
29649
29576
|
}
|
|
29650
29577
|
|
|
29651
29578
|
if (pluginsMap.has('moduleAttributes')) {
|
|
29652
|
-
|
|
29653
|
-
throw new Error('`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.');
|
|
29654
|
-
}
|
|
29579
|
+
throw new Error('`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.');
|
|
29655
29580
|
}
|
|
29656
29581
|
|
|
29657
29582
|
if (pluginsMap.has('importAssertions')) {
|
|
29658
|
-
|
|
29659
|
-
throw new Error('`importAssertions` has been removed in Babel 8, please use import attributes instead. To use the non-standard `assert` syntax you can enable the `deprecatedImportAssert` parser plugin.');
|
|
29660
|
-
}
|
|
29583
|
+
throw new Error('`importAssertions` has been removed in Babel 8, please use import attributes instead. To use the non-standard `assert` syntax you can enable the `deprecatedImportAssert` parser plugin.');
|
|
29661
29584
|
}
|
|
29662
29585
|
|
|
29663
29586
|
if (!pluginsMap.has('deprecatedImportAssert') && pluginsMap.has('importAttributes') && pluginsMap.get('importAttributes').deprecatedAssertSyntax) {
|
|
29664
|
-
|
|
29665
|
-
throw new Error('The \'importAttributes\' plugin has been removed in Babel 8. If you need to enable support for the deprecated `assert` syntax, you can enable the `deprecatedImportAssert` parser plugin.');
|
|
29666
|
-
}
|
|
29587
|
+
throw new Error('The \'importAttributes\' plugin has been removed in Babel 8. If you need to enable support for the deprecated `assert` syntax, you can enable the `deprecatedImportAssert` parser plugin.');
|
|
29667
29588
|
}
|
|
29668
29589
|
|
|
29669
29590
|
if (pluginsMap.has('recordAndTuple')) {
|
|
29670
|
-
|
|
29671
|
-
throw new Error('The \'recordAndTuple\' plugin has been removed in Babel 8. Please remove it from your configuration.');
|
|
29672
|
-
}
|
|
29591
|
+
throw new Error('The \'recordAndTuple\' plugin has been removed in Babel 8. Please remove it from your configuration.');
|
|
29673
29592
|
}
|
|
29674
29593
|
|
|
29675
29594
|
if (pluginsMap.has('asyncDoExpressions') && !pluginsMap.has('doExpressions')) {
|
|
@@ -29687,14 +29606,12 @@ function validatePlugins(pluginsMap) {
|
|
|
29687
29606
|
throw new Error('The \'discardBinding\' plugin requires a \'syntaxType\' option. Currently the only supported value is \'void\'.');
|
|
29688
29607
|
}
|
|
29689
29608
|
|
|
29690
|
-
{
|
|
29691
|
-
|
|
29692
|
-
|
|
29693
|
-
|
|
29694
|
-
|
|
29695
|
-
|
|
29696
|
-
throw new Error('The \'importReflection\' plugin has been removed in Babel 8. Use \'sourcePhaseImports\' instead, and replace \'import module\' with \'import source\' in your code.');
|
|
29697
|
-
}
|
|
29609
|
+
if (pluginsMap.has('decimal')) {
|
|
29610
|
+
throw new Error('The \'decimal\' plugin has been removed in Babel 8. Please remove it from your configuration.');
|
|
29611
|
+
}
|
|
29612
|
+
|
|
29613
|
+
if (pluginsMap.has('importReflection')) {
|
|
29614
|
+
throw new Error('The \'importReflection\' plugin has been removed in Babel 8. Use \'sourcePhaseImports\' instead, and replace \'import module\' with \'import source\' in your code.');
|
|
29698
29615
|
}
|
|
29699
29616
|
}
|
|
29700
29617
|
|
|
@@ -30615,14 +30532,12 @@ var ExpressionParser = class extends LValParser {
|
|
|
30615
30532
|
|
|
30616
30533
|
finishTopicReference(node, startLoc, pipeProposal, tokenType) {
|
|
30617
30534
|
if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {
|
|
30618
|
-
{
|
|
30619
|
-
|
|
30620
|
-
this.raise(Errors.PipeTopicUnbound, startLoc);
|
|
30621
|
-
}
|
|
30622
|
-
|
|
30623
|
-
this.registerTopicReference();
|
|
30624
|
-
return this.finishNode(node, 'TopicReference');
|
|
30535
|
+
if (!this.topicReferenceIsAllowedInCurrentContext()) {
|
|
30536
|
+
this.raise(Errors.PipeTopicUnbound, startLoc);
|
|
30625
30537
|
}
|
|
30538
|
+
|
|
30539
|
+
this.registerTopicReference();
|
|
30540
|
+
return this.finishNode(node, 'TopicReference');
|
|
30626
30541
|
} else {
|
|
30627
30542
|
throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, {
|
|
30628
30543
|
token: tokenLabelName(tokenType),
|
|
@@ -30691,13 +30606,9 @@ var ExpressionParser = class extends LValParser {
|
|
|
30691
30606
|
this.next();
|
|
30692
30607
|
|
|
30693
30608
|
if (this.match(10) && !this.scope.allowDirectSuper) {
|
|
30694
|
-
|
|
30695
|
-
this.raise(Errors.SuperNotAllowed, node);
|
|
30696
|
-
}
|
|
30609
|
+
this.raise(Errors.SuperNotAllowed, node);
|
|
30697
30610
|
} else if (!this.scope.allowSuper) {
|
|
30698
|
-
|
|
30699
|
-
this.raise(Errors.UnexpectedSuper, node);
|
|
30700
|
-
}
|
|
30611
|
+
this.raise(Errors.UnexpectedSuper, node);
|
|
30701
30612
|
}
|
|
30702
30613
|
|
|
30703
30614
|
if (!this.match(10) && !this.match(0) && !this.match(16)) {
|
|
@@ -30799,20 +30710,18 @@ var ExpressionParser = class extends LValParser {
|
|
|
30799
30710
|
}
|
|
30800
30711
|
|
|
30801
30712
|
parseBigIntLiteral(value) {
|
|
30802
|
-
|
|
30803
|
-
|
|
30804
|
-
|
|
30805
|
-
|
|
30806
|
-
|
|
30807
|
-
|
|
30808
|
-
|
|
30809
|
-
}
|
|
30713
|
+
let bigInt;
|
|
30714
|
+
|
|
30715
|
+
try {
|
|
30716
|
+
bigInt = BigInt(value);
|
|
30717
|
+
} catch {
|
|
30718
|
+
bigInt = null;
|
|
30719
|
+
}
|
|
30810
30720
|
|
|
30811
30721
|
|
|
30812
|
-
|
|
30813
|
-
|
|
30814
|
-
|
|
30815
|
-
}
|
|
30722
|
+
const node = this.parseLiteral(bigInt, 'BigIntLiteral');
|
|
30723
|
+
|
|
30724
|
+
return node;
|
|
30816
30725
|
}
|
|
30817
30726
|
|
|
30818
30727
|
parseDecimalLiteral(value) {
|
|
@@ -31788,9 +31697,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
31788
31697
|
}
|
|
31789
31698
|
|
|
31790
31699
|
withSmartMixTopicForbiddingContext(callback) {
|
|
31791
|
-
|
|
31792
|
-
return callback();
|
|
31793
|
-
}
|
|
31700
|
+
return callback();
|
|
31794
31701
|
}
|
|
31795
31702
|
|
|
31796
31703
|
withSoloAwaitPermittingContext(callback) {
|
|
@@ -33557,9 +33464,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33557
33464
|
const isTypeExport = node2.exportKind === 'type';
|
|
33558
33465
|
node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport));
|
|
33559
33466
|
node2.source = null;
|
|
33560
|
-
|
|
33561
|
-
node2.attributes = [];
|
|
33562
|
-
}
|
|
33467
|
+
node2.attributes = [];
|
|
33563
33468
|
node2.declaration = null;
|
|
33564
33469
|
return true;
|
|
33565
33470
|
}
|
|
@@ -33571,9 +33476,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33571
33476
|
if (this.shouldParseExportDeclaration()) {
|
|
33572
33477
|
node.specifiers = [];
|
|
33573
33478
|
node.source = null;
|
|
33574
|
-
|
|
33575
|
-
node.attributes = [];
|
|
33576
|
-
}
|
|
33479
|
+
node.attributes = [];
|
|
33577
33480
|
node.declaration = this.parseExportDeclaration(node);
|
|
33578
33481
|
return true;
|
|
33579
33482
|
}
|
|
@@ -34116,26 +34019,20 @@ var StatementParser = class extends ExpressionParser {
|
|
|
34116
34019
|
}
|
|
34117
34020
|
|
|
34118
34021
|
this.next();
|
|
34119
|
-
|
|
34120
|
-
attributes = this.parseImportAttributes();
|
|
34121
|
-
}
|
|
34022
|
+
attributes = this.parseImportAttributes();
|
|
34122
34023
|
} else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {
|
|
34123
34024
|
if (!this.hasPlugin('deprecatedImportAssert')) {
|
|
34124
34025
|
this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc);
|
|
34125
34026
|
}
|
|
34126
34027
|
|
|
34127
|
-
|
|
34128
|
-
this.addExtra(node, 'deprecatedAssertSyntax', true);
|
|
34129
|
-
}
|
|
34028
|
+
this.addExtra(node, 'deprecatedAssertSyntax', true);
|
|
34130
34029
|
this.next();
|
|
34131
34030
|
attributes = this.parseImportAttributes();
|
|
34132
34031
|
} else {
|
|
34133
34032
|
attributes = [];
|
|
34134
34033
|
}
|
|
34135
34034
|
|
|
34136
|
-
|
|
34137
|
-
node.attributes = attributes;
|
|
34138
|
-
}
|
|
34035
|
+
node.attributes = attributes;
|
|
34139
34036
|
}
|
|
34140
34037
|
|
|
34141
34038
|
maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) {
|
|
@@ -34465,119 +34362,117 @@ var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
|
|
34465
34362
|
var BRACKET = /^[()[\]{}]$/;
|
|
34466
34363
|
var tokenize;
|
|
34467
34364
|
|
|
34468
|
-
{
|
|
34469
|
-
|
|
34470
|
-
|
|
34471
|
-
const tokenValue = token.value;
|
|
34472
|
-
|
|
34473
|
-
if (isKeyword(tokenValue) || isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) {
|
|
34474
|
-
return 'keyword';
|
|
34475
|
-
}
|
|
34476
|
-
|
|
34477
|
-
const firstChar = tokenValue.charCodeAt(0);
|
|
34478
|
-
|
|
34479
|
-
if (firstChar < 128) {
|
|
34480
|
-
if (firstChar >= 65 && firstChar <= 90) {
|
|
34481
|
-
return 'capitalized';
|
|
34482
|
-
}
|
|
34483
|
-
} else {
|
|
34484
|
-
const firstChar2 = String.fromCodePoint(tokenValue.codePointAt(0));
|
|
34485
|
-
|
|
34486
|
-
if (firstChar2 !== firstChar2.toLowerCase()) {
|
|
34487
|
-
return 'capitalized';
|
|
34488
|
-
}
|
|
34489
|
-
}
|
|
34490
|
-
}
|
|
34365
|
+
var getTokenType = function(token) {
|
|
34366
|
+
if (token.type === 'IdentifierName') {
|
|
34367
|
+
const tokenValue = token.value;
|
|
34491
34368
|
|
|
34492
|
-
if (
|
|
34493
|
-
return '
|
|
34369
|
+
if (isKeyword(tokenValue) || isStrictReservedWord(tokenValue, true) || sometimesKeywords.has(tokenValue)) {
|
|
34370
|
+
return 'keyword';
|
|
34494
34371
|
}
|
|
34495
34372
|
|
|
34496
|
-
|
|
34497
|
-
return 'punctuator';
|
|
34498
|
-
}
|
|
34373
|
+
const firstChar = tokenValue.charCodeAt(0);
|
|
34499
34374
|
|
|
34375
|
+
if (firstChar < 128) {
|
|
34376
|
+
if (firstChar >= 65 && firstChar <= 90) {
|
|
34377
|
+
return 'capitalized';
|
|
34378
|
+
}
|
|
34379
|
+
} else {
|
|
34380
|
+
const firstChar2 = String.fromCodePoint(tokenValue.codePointAt(0));
|
|
34381
|
+
|
|
34382
|
+
if (firstChar2 !== firstChar2.toLowerCase()) {
|
|
34383
|
+
return 'capitalized';
|
|
34384
|
+
}
|
|
34385
|
+
}
|
|
34386
|
+
}
|
|
34387
|
+
|
|
34388
|
+
if (token.type === 'Punctuator' && BRACKET.test(token.value)) {
|
|
34389
|
+
return 'uncolored';
|
|
34390
|
+
}
|
|
34391
|
+
|
|
34392
|
+
if (token.type === 'Invalid' && token.value === '@') {
|
|
34393
|
+
return 'punctuator';
|
|
34394
|
+
}
|
|
34395
|
+
|
|
34396
|
+
switch(token.type) {
|
|
34397
|
+
case 'NumericLiteral':
|
|
34398
|
+
return 'number';
|
|
34399
|
+
|
|
34400
|
+
case 'StringLiteral':
|
|
34401
|
+
case 'JSXString':
|
|
34402
|
+
case 'NoSubstitutionTemplate':
|
|
34403
|
+
return 'string';
|
|
34404
|
+
|
|
34405
|
+
case 'RegularExpressionLiteral':
|
|
34406
|
+
return 'regex';
|
|
34407
|
+
|
|
34408
|
+
case 'Punctuator':
|
|
34409
|
+
case 'JSXPunctuator':
|
|
34410
|
+
return 'punctuator';
|
|
34411
|
+
|
|
34412
|
+
case 'MultiLineComment':
|
|
34413
|
+
case 'SingleLineComment':
|
|
34414
|
+
return 'comment';
|
|
34415
|
+
|
|
34416
|
+
case 'Invalid':
|
|
34417
|
+
case 'JSXInvalid':
|
|
34418
|
+
return 'invalid';
|
|
34419
|
+
|
|
34420
|
+
case 'JSXIdentifier':
|
|
34421
|
+
return 'jsxIdentifier';
|
|
34422
|
+
|
|
34423
|
+
default:
|
|
34424
|
+
return 'uncolored';
|
|
34425
|
+
}
|
|
34426
|
+
};
|
|
34427
|
+
|
|
34428
|
+
tokenize = function*(text) {
|
|
34429
|
+
for (const token of (0, import_js_tokens.default)(text, {jsx: true})) {
|
|
34500
34430
|
switch(token.type) {
|
|
34501
|
-
case '
|
|
34502
|
-
|
|
34503
|
-
|
|
34504
|
-
|
|
34505
|
-
|
|
34506
|
-
|
|
34507
|
-
|
|
34508
|
-
|
|
34509
|
-
|
|
34510
|
-
|
|
34511
|
-
|
|
34512
|
-
case 'Punctuator':
|
|
34513
|
-
case 'JSXPunctuator':
|
|
34514
|
-
return 'punctuator';
|
|
34515
|
-
|
|
34516
|
-
case 'MultiLineComment':
|
|
34517
|
-
case 'SingleLineComment':
|
|
34518
|
-
return 'comment';
|
|
34431
|
+
case 'TemplateHead':
|
|
34432
|
+
yield {
|
|
34433
|
+
type: 'string',
|
|
34434
|
+
value: token.value.slice(0, -2),
|
|
34435
|
+
};
|
|
34436
|
+
yield {
|
|
34437
|
+
type: 'punctuator',
|
|
34438
|
+
value: '${',
|
|
34439
|
+
};
|
|
34440
|
+
break;
|
|
34519
34441
|
|
|
34520
|
-
case '
|
|
34521
|
-
|
|
34522
|
-
|
|
34442
|
+
case 'TemplateMiddle':
|
|
34443
|
+
yield {
|
|
34444
|
+
type: 'punctuator',
|
|
34445
|
+
value: '}',
|
|
34446
|
+
};
|
|
34447
|
+
yield {
|
|
34448
|
+
type: 'string',
|
|
34449
|
+
value: token.value.slice(1, -2),
|
|
34450
|
+
};
|
|
34451
|
+
yield {
|
|
34452
|
+
type: 'punctuator',
|
|
34453
|
+
value: '${',
|
|
34454
|
+
};
|
|
34455
|
+
break;
|
|
34523
34456
|
|
|
34524
|
-
case '
|
|
34525
|
-
|
|
34457
|
+
case 'TemplateTail':
|
|
34458
|
+
yield {
|
|
34459
|
+
type: 'punctuator',
|
|
34460
|
+
value: '}',
|
|
34461
|
+
};
|
|
34462
|
+
yield {
|
|
34463
|
+
type: 'string',
|
|
34464
|
+
value: token.value.slice(1),
|
|
34465
|
+
};
|
|
34466
|
+
break;
|
|
34526
34467
|
|
|
34527
34468
|
default:
|
|
34528
|
-
|
|
34529
|
-
|
|
34530
|
-
|
|
34531
|
-
|
|
34532
|
-
tokenize = function*(text) {
|
|
34533
|
-
for (const token of (0, import_js_tokens.default)(text, {jsx: true})) {
|
|
34534
|
-
switch(token.type) {
|
|
34535
|
-
case 'TemplateHead':
|
|
34536
|
-
yield {
|
|
34537
|
-
type: 'string',
|
|
34538
|
-
value: token.value.slice(0, -2),
|
|
34539
|
-
};
|
|
34540
|
-
yield {
|
|
34541
|
-
type: 'punctuator',
|
|
34542
|
-
value: '${',
|
|
34543
|
-
};
|
|
34544
|
-
break;
|
|
34545
|
-
|
|
34546
|
-
case 'TemplateMiddle':
|
|
34547
|
-
yield {
|
|
34548
|
-
type: 'punctuator',
|
|
34549
|
-
value: '}',
|
|
34550
|
-
};
|
|
34551
|
-
yield {
|
|
34552
|
-
type: 'string',
|
|
34553
|
-
value: token.value.slice(1, -2),
|
|
34554
|
-
};
|
|
34555
|
-
yield {
|
|
34556
|
-
type: 'punctuator',
|
|
34557
|
-
value: '${',
|
|
34558
|
-
};
|
|
34559
|
-
break;
|
|
34560
|
-
|
|
34561
|
-
case 'TemplateTail':
|
|
34562
|
-
yield {
|
|
34563
|
-
type: 'punctuator',
|
|
34564
|
-
value: '}',
|
|
34565
|
-
};
|
|
34566
|
-
yield {
|
|
34567
|
-
type: 'string',
|
|
34568
|
-
value: token.value.slice(1),
|
|
34569
|
-
};
|
|
34570
|
-
break;
|
|
34571
|
-
|
|
34572
|
-
default:
|
|
34573
|
-
yield {
|
|
34574
|
-
type: getTokenType(token),
|
|
34575
|
-
value: token.value,
|
|
34576
|
-
};
|
|
34577
|
-
}
|
|
34469
|
+
yield {
|
|
34470
|
+
type: getTokenType(token),
|
|
34471
|
+
value: token.value,
|
|
34472
|
+
};
|
|
34578
34473
|
}
|
|
34579
|
-
}
|
|
34580
|
-
}
|
|
34474
|
+
}
|
|
34475
|
+
};
|
|
34581
34476
|
function highlight(text) {
|
|
34582
34477
|
if (text === '')
|
|
34583
34478
|
return '';
|
|
@@ -37916,9 +37811,7 @@ function* childrenIterator(node) {
|
|
|
37916
37811
|
|
|
37917
37812
|
function TaggedTemplateExpression2(node) {
|
|
37918
37813
|
this.print(node.tag);
|
|
37919
|
-
|
|
37920
|
-
this.print(node.typeArguments);
|
|
37921
|
-
}
|
|
37814
|
+
this.print(node.typeArguments);
|
|
37922
37815
|
this.print(node.quasi);
|
|
37923
37816
|
}
|
|
37924
37817
|
|
|
@@ -39445,9 +39338,6 @@ function ArrayExpression2(node) {
|
|
|
39445
39338
|
this.tokenChar(93);
|
|
39446
39339
|
}
|
|
39447
39340
|
|
|
39448
|
-
var RecordExpression;
|
|
39449
|
-
var TupleExpression;
|
|
39450
|
-
|
|
39451
39341
|
function RegExpLiteral2(node) {
|
|
39452
39342
|
this.word(`/${node.pattern}/${node.flags}`);
|
|
39453
39343
|
}
|
|
@@ -40370,9 +40260,8 @@ function spaceSeparator() {
|
|
|
40370
40260
|
function JSXOpeningElement2(node) {
|
|
40371
40261
|
this.tokenChar(60);
|
|
40372
40262
|
this.print(node.name);
|
|
40373
|
-
|
|
40374
|
-
|
|
40375
|
-
}
|
|
40263
|
+
this.print(node.typeArguments);
|
|
40264
|
+
|
|
40376
40265
|
if (node.attributes.length > 0) {
|
|
40377
40266
|
this.space();
|
|
40378
40267
|
this.printJoin(node.attributes, void 0, void 0, spaceSeparator);
|
|
@@ -40400,7 +40289,6 @@ function JSXEmptyExpression2() {
|
|
|
40400
40289
|
function JSXFragment2(node) {
|
|
40401
40290
|
this.print(node.openingFragment);
|
|
40402
40291
|
this.indent();
|
|
40403
|
-
|
|
40404
40292
|
for (const child of node.children) {
|
|
40405
40293
|
this.print(child);
|
|
40406
40294
|
}
|
|
@@ -40831,15 +40719,12 @@ function TSMappedType2(node) {
|
|
|
40831
40719
|
}
|
|
40832
40720
|
|
|
40833
40721
|
this.tokenChar(91);
|
|
40834
|
-
|
|
40835
|
-
this.word(node.key.name);
|
|
40836
|
-
}
|
|
40722
|
+
this.word(node.key.name);
|
|
40837
40723
|
this.space();
|
|
40838
40724
|
this.word('in');
|
|
40839
40725
|
this.space();
|
|
40840
|
-
|
|
40841
|
-
|
|
40842
|
-
}
|
|
40726
|
+
this.print(node.constraint);
|
|
40727
|
+
|
|
40843
40728
|
if (nameType) {
|
|
40844
40729
|
this.space();
|
|
40845
40730
|
this.word('as');
|
|
@@ -40968,9 +40853,7 @@ function TSTypeAssertion2(node) {
|
|
|
40968
40853
|
|
|
40969
40854
|
function TSInstantiationExpression2(node) {
|
|
40970
40855
|
this.print(node.expression);
|
|
40971
|
-
|
|
40972
|
-
this.print(node.typeArguments);
|
|
40973
|
-
}
|
|
40856
|
+
this.print(node.typeArguments);
|
|
40974
40857
|
}
|
|
40975
40858
|
|
|
40976
40859
|
function TSEnumDeclaration2(node) {
|
|
@@ -40994,9 +40877,7 @@ function TSEnumDeclaration2(node) {
|
|
|
40994
40877
|
this.space();
|
|
40995
40878
|
this.print(id);
|
|
40996
40879
|
this.space();
|
|
40997
|
-
|
|
40998
|
-
this.print(node.body);
|
|
40999
|
-
}
|
|
40880
|
+
this.print(node.body);
|
|
41000
40881
|
}
|
|
41001
40882
|
|
|
41002
40883
|
function TSEnumBody2(node) {
|
|
@@ -41024,22 +40905,20 @@ function TSModuleDeclaration2(node) {
|
|
|
41024
40905
|
this.space();
|
|
41025
40906
|
}
|
|
41026
40907
|
|
|
41027
|
-
{
|
|
41028
|
-
|
|
41029
|
-
this.word(kind);
|
|
41030
|
-
this.space();
|
|
41031
|
-
}
|
|
41032
|
-
|
|
41033
|
-
this.print(node.id);
|
|
41034
|
-
|
|
41035
|
-
if (!node.body) {
|
|
41036
|
-
this.semicolon();
|
|
41037
|
-
return;
|
|
41038
|
-
}
|
|
41039
|
-
|
|
40908
|
+
if (kind !== 'global') {
|
|
40909
|
+
this.word(kind);
|
|
41040
40910
|
this.space();
|
|
41041
|
-
this.print(node.body);
|
|
41042
40911
|
}
|
|
40912
|
+
|
|
40913
|
+
this.print(node.id);
|
|
40914
|
+
|
|
40915
|
+
if (!node.body) {
|
|
40916
|
+
this.semicolon();
|
|
40917
|
+
return;
|
|
40918
|
+
}
|
|
40919
|
+
|
|
40920
|
+
this.space();
|
|
40921
|
+
this.print(node.body);
|
|
41043
40922
|
}
|
|
41044
40923
|
|
|
41045
40924
|
function TSModuleBlock2(node) {
|
|
@@ -41324,7 +41203,6 @@ var generatorFunctions = /* @__PURE__ */Object.freeze({
|
|
|
41324
41203
|
PrivateName: PrivateName2,
|
|
41325
41204
|
Program: Program2,
|
|
41326
41205
|
QualifiedTypeIdentifier: QualifiedTypeIdentifier2,
|
|
41327
|
-
RecordExpression,
|
|
41328
41206
|
RegExpLiteral: RegExpLiteral2,
|
|
41329
41207
|
RestElement: RestElement2,
|
|
41330
41208
|
ReturnStatement: ReturnStatement2,
|
|
@@ -41414,7 +41292,6 @@ var generatorFunctions = /* @__PURE__ */Object.freeze({
|
|
|
41414
41292
|
ThrowStatement: ThrowStatement2,
|
|
41415
41293
|
TopicReference: TopicReference2,
|
|
41416
41294
|
TryStatement: TryStatement2,
|
|
41417
|
-
TupleExpression,
|
|
41418
41295
|
TupleTypeAnnotation: TupleTypeAnnotation2,
|
|
41419
41296
|
TypeAlias: TypeAlias2,
|
|
41420
41297
|
TypeAnnotation: TypeAnnotation2,
|
|
@@ -43180,9 +43057,7 @@ var _environmentVisitor = {
|
|
|
43180
43057
|
path.skip();
|
|
43181
43058
|
|
|
43182
43059
|
if (path.isMethod()) {
|
|
43183
|
-
|
|
43184
|
-
path.requeueComputedKeyAndDecorators();
|
|
43185
|
-
}
|
|
43060
|
+
path.requeueComputedKeyAndDecorators();
|
|
43186
43061
|
}
|
|
43187
43062
|
},
|
|
43188
43063
|
Property(path) {
|
|
@@ -43190,9 +43065,7 @@ var _environmentVisitor = {
|
|
|
43190
43065
|
return;
|
|
43191
43066
|
|
|
43192
43067
|
path.skip();
|
|
43193
|
-
|
|
43194
|
-
path.requeueComputedKeyAndDecorators();
|
|
43195
|
-
}
|
|
43068
|
+
path.requeueComputedKeyAndDecorators();
|
|
43196
43069
|
},
|
|
43197
43070
|
};
|
|
43198
43071
|
|
|
@@ -43222,9 +43095,7 @@ var renameVisitor = {
|
|
|
43222
43095
|
path.skip();
|
|
43223
43096
|
|
|
43224
43097
|
if (path.isMethod()) {
|
|
43225
|
-
|
|
43226
|
-
path.requeueComputedKeyAndDecorators();
|
|
43227
|
-
}
|
|
43098
|
+
path.requeueComputedKeyAndDecorators();
|
|
43228
43099
|
}
|
|
43229
43100
|
}
|
|
43230
43101
|
},
|
|
@@ -43321,11 +43192,10 @@ var Renamer = class {
|
|
|
43321
43192
|
}
|
|
43322
43193
|
|
|
43323
43194
|
traverseNode(blockToTraverse, explode$1(renameVisitor), scope2, this, scope2.path, skipKeys);
|
|
43324
|
-
|
|
43325
|
-
|
|
43326
|
-
|
|
43327
|
-
|
|
43328
|
-
}
|
|
43195
|
+
scope2.removeOwnBinding(oldName);
|
|
43196
|
+
scope2.bindings[newName] = binding;
|
|
43197
|
+
this.binding.identifier.name = newName;
|
|
43198
|
+
|
|
43329
43199
|
if (parentDeclar) {
|
|
43330
43200
|
this.maybeConvertFromClassFunctionDeclaration(path);
|
|
43331
43201
|
this.maybeConvertFromClassFunctionExpression(path);
|
|
@@ -43969,12 +43839,8 @@ var _Scope = class _Scope {
|
|
|
43969
43839
|
i++;
|
|
43970
43840
|
} while (this.hasLabel(uid2) || this.hasBinding(uid2) || this.hasGlobal(uid2) || this.hasReference(uid2))
|
|
43971
43841
|
const program3 = this.getProgramParent();
|
|
43972
|
-
|
|
43973
|
-
|
|
43974
|
-
program3.referencesSet.add(uid2);
|
|
43975
|
-
program3.uidsSet.add(uid2);
|
|
43976
|
-
}
|
|
43977
|
-
|
|
43842
|
+
program3.referencesSet.add(uid2);
|
|
43843
|
+
program3.uidsSet.add(uid2);
|
|
43978
43844
|
return uid2;
|
|
43979
43845
|
}
|
|
43980
43846
|
|
|
@@ -44053,10 +43919,7 @@ var _Scope = class _Scope {
|
|
|
44053
43919
|
if (binding) {
|
|
44054
43920
|
newName || (newName = this.generateUidIdentifier(oldName).name);
|
|
44055
43921
|
const renamer = new Renamer(binding, oldName, newName);
|
|
44056
|
-
|
|
44057
|
-
{
|
|
44058
|
-
renamer.rename();
|
|
44059
|
-
}
|
|
43922
|
+
renamer.rename();
|
|
44060
43923
|
}
|
|
44061
43924
|
}
|
|
44062
43925
|
|
|
@@ -44166,9 +44029,7 @@ var _Scope = class _Scope {
|
|
|
44166
44029
|
const ids = path.getOuterBindingIdentifiers(true);
|
|
44167
44030
|
|
|
44168
44031
|
for (const name of Object.keys(ids)) {
|
|
44169
|
-
|
|
44170
|
-
parent.referencesSet.add(name);
|
|
44171
|
-
}
|
|
44032
|
+
parent.referencesSet.add(name);
|
|
44172
44033
|
|
|
44173
44034
|
for (const id of ids[name]) {
|
|
44174
44035
|
const local = this.getOwnBinding(name);
|
|
@@ -44199,12 +44060,10 @@ var _Scope = class _Scope {
|
|
|
44199
44060
|
}
|
|
44200
44061
|
|
|
44201
44062
|
hasUid(name) {
|
|
44202
|
-
|
|
44203
|
-
|
|
44204
|
-
|
|
44205
|
-
|
|
44206
|
-
.has(name);
|
|
44207
|
-
}
|
|
44063
|
+
return this
|
|
44064
|
+
.getProgramParent()
|
|
44065
|
+
.uidsSet
|
|
44066
|
+
.has(name);
|
|
44208
44067
|
}
|
|
44209
44068
|
|
|
44210
44069
|
hasGlobal(name) {
|
|
@@ -44219,12 +44078,10 @@ var _Scope = class _Scope {
|
|
|
44219
44078
|
}
|
|
44220
44079
|
|
|
44221
44080
|
hasReference(name) {
|
|
44222
|
-
|
|
44223
|
-
|
|
44224
|
-
|
|
44225
|
-
|
|
44226
|
-
.has(name);
|
|
44227
|
-
}
|
|
44081
|
+
return this
|
|
44082
|
+
.getProgramParent()
|
|
44083
|
+
.referencesSet
|
|
44084
|
+
.has(name);
|
|
44228
44085
|
}
|
|
44229
44086
|
|
|
44230
44087
|
isPure(node, constantsOnly) {
|
|
@@ -44416,9 +44273,7 @@ collectorVisitor]));
|
|
|
44416
44273
|
}
|
|
44417
44274
|
}
|
|
44418
44275
|
|
|
44419
|
-
|
|
44420
|
-
traverseForScope(path, scopeVisitor, state);
|
|
44421
|
-
}
|
|
44276
|
+
traverseForScope(path, scopeVisitor, state);
|
|
44422
44277
|
this.crawling = false;
|
|
44423
44278
|
|
|
44424
44279
|
for (const path2 of state.assignments) {
|
|
@@ -44662,12 +44517,10 @@ collectorVisitor]));
|
|
|
44662
44517
|
|
|
44663
44518
|
removeBinding(name) {
|
|
44664
44519
|
this.getBinding(name)?.scope.removeOwnBinding(name);
|
|
44665
|
-
|
|
44666
|
-
|
|
44667
|
-
|
|
44668
|
-
|
|
44669
|
-
.delete(name);
|
|
44670
|
-
}
|
|
44520
|
+
this
|
|
44521
|
+
.getProgramParent()
|
|
44522
|
+
.uidsSet
|
|
44523
|
+
.delete(name);
|
|
44671
44524
|
}
|
|
44672
44525
|
|
|
44673
44526
|
hoistVariables(emit = (id) => this.push({
|
|
@@ -44903,14 +44756,12 @@ var {
|
|
|
44903
44756
|
} = lib_exports;
|
|
44904
44757
|
|
|
44905
44758
|
function createUnionType(types2) {
|
|
44906
|
-
{
|
|
44907
|
-
|
|
44908
|
-
|
|
44909
|
-
|
|
44910
|
-
|
|
44911
|
-
|
|
44912
|
-
return createTSUnionType2(types2);
|
|
44913
|
-
}
|
|
44759
|
+
if (types2.every((v) => isFlowType2(v))) {
|
|
44760
|
+
return createFlowUnionType2(types2);
|
|
44761
|
+
}
|
|
44762
|
+
|
|
44763
|
+
if (types2.every((v) => isTSType2(v))) {
|
|
44764
|
+
return createTSUnionType2(types2);
|
|
44914
44765
|
}
|
|
44915
44766
|
}
|
|
44916
44767
|
|
|
@@ -46096,10 +45947,8 @@ function replaceExpressionWithStatements(nodes2) {
|
|
|
46096
45947
|
|
|
46097
45948
|
callee.arrowFunctionToExpression();
|
|
46098
45949
|
const newCallee = callee;
|
|
46099
|
-
const needToAwaitFunction = isParentAsync && traverse3.hasType(
|
|
46100
|
-
|
|
46101
|
-
const needToYieldFunction = isParentGenerator && traverse3.hasType(this
|
|
46102
|
-
.get('callee.body').node, 'YieldExpression', FUNCTION_TYPES2);
|
|
45950
|
+
const needToAwaitFunction = isParentAsync && traverse3.hasType(newCallee.node.body, 'AwaitExpression', FUNCTION_TYPES2);
|
|
45951
|
+
const needToYieldFunction = isParentGenerator && traverse3.hasType(newCallee.node.body, 'YieldExpression', FUNCTION_TYPES2);
|
|
46103
45952
|
|
|
46104
45953
|
if (needToAwaitFunction) {
|
|
46105
45954
|
newCallee.set('async', true);
|
|
@@ -47377,26 +47226,20 @@ function ensureFunctionName(supportUnicodeId) {
|
|
|
47377
47226
|
|
|
47378
47227
|
if (!state.needsRename) {
|
|
47379
47228
|
this.node.id = id;
|
|
47380
|
-
|
|
47381
|
-
|
|
47382
|
-
|
|
47383
|
-
|
|
47384
|
-
.add(id.name);
|
|
47385
|
-
}
|
|
47386
|
-
|
|
47229
|
+
scope2
|
|
47230
|
+
.getProgramParent()
|
|
47231
|
+
.referencesSet
|
|
47232
|
+
.add(id.name);
|
|
47387
47233
|
return this;
|
|
47388
47234
|
}
|
|
47389
47235
|
|
|
47390
47236
|
if (scope2.hasBinding(id.name) && !scope2.hasGlobal(id.name)) {
|
|
47391
47237
|
scope2.rename(id.name);
|
|
47392
47238
|
this.node.id = id;
|
|
47393
|
-
|
|
47394
|
-
|
|
47395
|
-
|
|
47396
|
-
|
|
47397
|
-
.add(id.name);
|
|
47398
|
-
}
|
|
47399
|
-
|
|
47239
|
+
scope2
|
|
47240
|
+
.getProgramParent()
|
|
47241
|
+
.referencesSet
|
|
47242
|
+
.add(id.name);
|
|
47400
47243
|
return this;
|
|
47401
47244
|
}
|
|
47402
47245
|
|
|
@@ -48974,9 +48817,7 @@ function _traverse(node, opts, scope2, state, path, skipKeys, visitSelf) {
|
|
|
48974
48817
|
}
|
|
48975
48818
|
|
|
48976
48819
|
function traverseNode(node, opts, scope2, state, path, skipKeys, visitSelf) {
|
|
48977
|
-
|
|
48978
|
-
return _traverse(node, opts, scope2, state, path, skipKeys, visitSelf);
|
|
48979
|
-
}
|
|
48820
|
+
return _traverse(node, opts, scope2, state, path, skipKeys, visitSelf);
|
|
48980
48821
|
}
|
|
48981
48822
|
|
|
48982
48823
|
function call(key) {
|
|
@@ -49230,9 +49071,7 @@ function requeue(pathToQueue = this) {
|
|
|
49230
49071
|
if (pathToQueue.removed)
|
|
49231
49072
|
return;
|
|
49232
49073
|
|
|
49233
|
-
|
|
49234
|
-
pathToQueue.shouldSkip = false;
|
|
49235
|
-
}
|
|
49074
|
+
pathToQueue.shouldSkip = false;
|
|
49236
49075
|
const contexts = this.contexts;
|
|
49237
49076
|
|
|
49238
49077
|
for (const context of contexts) {
|