@putout/babel 5.0.6 → 5.0.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 +1 -1
- package/bundle/index.js +740 -759
- package/bundle/metafile-cjs.json +1 -1
- package/package.json +4 -3
package/bundle/index.js
CHANGED
|
@@ -18937,16 +18937,7 @@ var tt = {
|
|
|
18937
18937
|
beforeExpr,
|
|
18938
18938
|
startsExpr,
|
|
18939
18939
|
}),
|
|
18940
|
-
bracketHashL: createToken('#[', {
|
|
18941
|
-
beforeExpr,
|
|
18942
|
-
startsExpr,
|
|
18943
|
-
}),
|
|
18944
|
-
bracketBarL: createToken('[|', {
|
|
18945
|
-
beforeExpr,
|
|
18946
|
-
startsExpr,
|
|
18947
|
-
}),
|
|
18948
18940
|
bracketR: createToken(']'),
|
|
18949
|
-
bracketBarR: createToken('|]'),
|
|
18950
18941
|
braceL: createToken('{', {
|
|
18951
18942
|
beforeExpr,
|
|
18952
18943
|
startsExpr,
|
|
@@ -18955,10 +18946,6 @@ var tt = {
|
|
|
18955
18946
|
beforeExpr,
|
|
18956
18947
|
startsExpr,
|
|
18957
18948
|
}),
|
|
18958
|
-
braceHashL: createToken('#{', {
|
|
18959
|
-
beforeExpr,
|
|
18960
|
-
startsExpr,
|
|
18961
|
-
}),
|
|
18962
18949
|
braceR: createToken('}'),
|
|
18963
18950
|
braceBarR: createToken('|}'),
|
|
18964
18951
|
parenL: createToken('(', {
|
|
@@ -19308,9 +19295,6 @@ var tt = {
|
|
|
19308
19295
|
bigint: createToken('bigint', {
|
|
19309
19296
|
startsExpr,
|
|
19310
19297
|
}),
|
|
19311
|
-
decimal: createToken('decimal', {
|
|
19312
|
-
startsExpr,
|
|
19313
|
-
}),
|
|
19314
19298
|
regexp: createToken('regexp', {
|
|
19315
19299
|
startsExpr,
|
|
19316
19300
|
}),
|
|
@@ -19329,19 +19313,19 @@ var tt = {
|
|
|
19329
19313
|
};
|
|
19330
19314
|
|
|
19331
19315
|
function tokenIsIdentifier(token) {
|
|
19332
|
-
return token >=
|
|
19316
|
+
return token >= 89 && token <= 129;
|
|
19333
19317
|
}
|
|
19334
19318
|
|
|
19335
19319
|
function tokenKeywordOrIdentifierIsKeyword(token) {
|
|
19336
|
-
return token <=
|
|
19320
|
+
return token <= 88;
|
|
19337
19321
|
}
|
|
19338
19322
|
|
|
19339
19323
|
function tokenIsKeywordOrIdentifier(token) {
|
|
19340
|
-
return token >=
|
|
19324
|
+
return token >= 54 && token <= 129;
|
|
19341
19325
|
}
|
|
19342
19326
|
|
|
19343
19327
|
function tokenIsLiteralPropertyName(token) {
|
|
19344
|
-
return token >=
|
|
19328
|
+
return token >= 54 && token <= 132;
|
|
19345
19329
|
}
|
|
19346
19330
|
|
|
19347
19331
|
function tokenComesBeforeExpression(token) {
|
|
@@ -19353,23 +19337,23 @@ function tokenCanStartExpression(token) {
|
|
|
19353
19337
|
}
|
|
19354
19338
|
|
|
19355
19339
|
function tokenIsAssignment(token) {
|
|
19356
|
-
return token >=
|
|
19340
|
+
return token >= 25 && token <= 29;
|
|
19357
19341
|
}
|
|
19358
19342
|
|
|
19359
19343
|
function tokenIsLoop(token) {
|
|
19360
|
-
return token >=
|
|
19344
|
+
return token >= 86 && token <= 88;
|
|
19361
19345
|
}
|
|
19362
19346
|
|
|
19363
19347
|
function tokenIsKeyword(token) {
|
|
19364
|
-
return token >=
|
|
19348
|
+
return token >= 54 && token <= 88;
|
|
19365
19349
|
}
|
|
19366
19350
|
|
|
19367
19351
|
function tokenIsOperator(token) {
|
|
19368
|
-
return token >=
|
|
19352
|
+
return token >= 35 && token <= 55;
|
|
19369
19353
|
}
|
|
19370
19354
|
|
|
19371
19355
|
function tokenIsPostfix(token) {
|
|
19372
|
-
return token ===
|
|
19356
|
+
return token === 30;
|
|
19373
19357
|
}
|
|
19374
19358
|
|
|
19375
19359
|
function tokenIsPrefix(token) {
|
|
@@ -19377,11 +19361,11 @@ function tokenIsPrefix(token) {
|
|
|
19377
19361
|
}
|
|
19378
19362
|
|
|
19379
19363
|
function tokenIsTSTypeOperator(token) {
|
|
19380
|
-
return token >=
|
|
19364
|
+
return token >= 117 && token <= 119;
|
|
19381
19365
|
}
|
|
19382
19366
|
|
|
19383
19367
|
function tokenIsTSDeclarationStart(token) {
|
|
19384
|
-
return token >=
|
|
19368
|
+
return token >= 120 && token <= 126;
|
|
19385
19369
|
}
|
|
19386
19370
|
|
|
19387
19371
|
function tokenLabelName(token) {
|
|
@@ -19393,11 +19377,11 @@ function tokenOperatorPrecedence(token) {
|
|
|
19393
19377
|
}
|
|
19394
19378
|
|
|
19395
19379
|
function tokenIsRightAssociative(token) {
|
|
19396
|
-
return token ===
|
|
19380
|
+
return token === 53;
|
|
19397
19381
|
}
|
|
19398
19382
|
|
|
19399
19383
|
function tokenIsTemplate(token) {
|
|
19400
|
-
return token >=
|
|
19384
|
+
return token >= 20 && token <= 21;
|
|
19401
19385
|
}
|
|
19402
19386
|
|
|
19403
19387
|
function getExportedToken(token) {
|
|
@@ -21137,7 +21121,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21137
21121
|
if (this.state.pos === this.state.start) {
|
|
21138
21122
|
if (ch === 60 && this.state.canStartJSXElement) {
|
|
21139
21123
|
++this.state.pos;
|
|
21140
|
-
this.finishToken(
|
|
21124
|
+
this.finishToken(138);
|
|
21141
21125
|
} else {
|
|
21142
21126
|
super.getTokenFromCode(ch);
|
|
21143
21127
|
}
|
|
@@ -21146,7 +21130,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21146
21130
|
}
|
|
21147
21131
|
|
|
21148
21132
|
out += this.input.slice(chunkStart, this.state.pos);
|
|
21149
|
-
this.finishToken(
|
|
21133
|
+
this.finishToken(137, out);
|
|
21150
21134
|
return;
|
|
21151
21135
|
|
|
21152
21136
|
case 38:
|
|
@@ -21219,7 +21203,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21219
21203
|
}
|
|
21220
21204
|
|
|
21221
21205
|
out += this.input.slice(chunkStart, this.state.pos++);
|
|
21222
|
-
this.finishToken(
|
|
21206
|
+
this.finishToken(130, out);
|
|
21223
21207
|
}
|
|
21224
21208
|
|
|
21225
21209
|
jsxReadEntity() {
|
|
@@ -21270,13 +21254,13 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21270
21254
|
do {
|
|
21271
21255
|
ch = this.input.charCodeAt(++this.state.pos);
|
|
21272
21256
|
} while (isIdentifierChar2(ch) || ch === 45)
|
|
21273
|
-
this.finishToken(
|
|
21257
|
+
this.finishToken(136, this.input.slice(start, this.state.pos));
|
|
21274
21258
|
}
|
|
21275
21259
|
|
|
21276
21260
|
jsxParseIdentifier() {
|
|
21277
21261
|
const node = this.startNode();
|
|
21278
21262
|
|
|
21279
|
-
if (this.match(
|
|
21263
|
+
if (this.match(136)) {
|
|
21280
21264
|
node.name = this.state.value;
|
|
21281
21265
|
} else if (tokenIsKeyword(this.state.type)) {
|
|
21282
21266
|
node.name = tokenLabelName(this.state.type);
|
|
@@ -21292,7 +21276,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21292
21276
|
const startLoc = this.state.startLoc;
|
|
21293
21277
|
const name = this.jsxParseIdentifier();
|
|
21294
21278
|
|
|
21295
|
-
if (!this.eat(
|
|
21279
|
+
if (!this.eat(10))
|
|
21296
21280
|
return name;
|
|
21297
21281
|
|
|
21298
21282
|
const node = this.startNodeAt(startLoc);
|
|
@@ -21310,7 +21294,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21310
21294
|
return node;
|
|
21311
21295
|
}
|
|
21312
21296
|
|
|
21313
|
-
while (this.eat(
|
|
21297
|
+
while (this.eat(12)) {
|
|
21314
21298
|
const newNode = this.startNodeAt(startLoc);
|
|
21315
21299
|
|
|
21316
21300
|
newNode.object = node;
|
|
@@ -21325,7 +21309,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21325
21309
|
let node;
|
|
21326
21310
|
|
|
21327
21311
|
switch(this.state.type) {
|
|
21328
|
-
case
|
|
21312
|
+
case 2:
|
|
21329
21313
|
node = this.startNode();
|
|
21330
21314
|
this.setContext(types.brace);
|
|
21331
21315
|
this.next();
|
|
@@ -21337,8 +21321,8 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21337
21321
|
|
|
21338
21322
|
return node;
|
|
21339
21323
|
|
|
21340
|
-
case
|
|
21341
|
-
case
|
|
21324
|
+
case 138:
|
|
21325
|
+
case 130:
|
|
21342
21326
|
return this.parseExprAtom();
|
|
21343
21327
|
|
|
21344
21328
|
default:
|
|
@@ -21356,12 +21340,12 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21356
21340
|
node.expression = this.parseExpression();
|
|
21357
21341
|
this.setContext(types.j_expr);
|
|
21358
21342
|
this.state.canStartJSXElement = true;
|
|
21359
|
-
this.expect(
|
|
21343
|
+
this.expect(4);
|
|
21360
21344
|
return this.finishNode(node, 'JSXSpreadChild');
|
|
21361
21345
|
}
|
|
21362
21346
|
|
|
21363
21347
|
jsxParseExpressionContainer(node, previousContext) {
|
|
21364
|
-
if (this.match(
|
|
21348
|
+
if (this.match(4)) {
|
|
21365
21349
|
node.expression = this.jsxParseEmptyExpression();
|
|
21366
21350
|
} else {
|
|
21367
21351
|
const expression2 = this.parseExpression();
|
|
@@ -21375,33 +21359,33 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21375
21359
|
|
|
21376
21360
|
this.setContext(previousContext);
|
|
21377
21361
|
this.state.canStartJSXElement = true;
|
|
21378
|
-
this.expect(
|
|
21362
|
+
this.expect(4);
|
|
21379
21363
|
return this.finishNode(node, 'JSXExpressionContainer');
|
|
21380
21364
|
}
|
|
21381
21365
|
|
|
21382
21366
|
jsxParseAttribute() {
|
|
21383
21367
|
const node = this.startNode();
|
|
21384
21368
|
|
|
21385
|
-
if (this.match(
|
|
21369
|
+
if (this.match(2)) {
|
|
21386
21370
|
this.setContext(types.brace);
|
|
21387
21371
|
this.next();
|
|
21388
|
-
this.expect(
|
|
21372
|
+
this.expect(17);
|
|
21389
21373
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
21390
21374
|
this.setContext(types.j_oTag);
|
|
21391
21375
|
this.state.canStartJSXElement = true;
|
|
21392
|
-
this.expect(
|
|
21376
|
+
this.expect(4);
|
|
21393
21377
|
return this.finishNode(node, 'JSXSpreadAttribute');
|
|
21394
21378
|
}
|
|
21395
21379
|
|
|
21396
21380
|
node.name = this.jsxParseNamespacedName();
|
|
21397
|
-
node.value = this.eat(
|
|
21381
|
+
node.value = this.eat(25) ? this.jsxParseAttributeValue() : null;
|
|
21398
21382
|
return this.finishNode(node, 'JSXAttribute');
|
|
21399
21383
|
}
|
|
21400
21384
|
|
|
21401
21385
|
jsxParseOpeningElementAt(startLoc) {
|
|
21402
21386
|
const node = this.startNodeAt(startLoc);
|
|
21403
21387
|
|
|
21404
|
-
if (this.eat(
|
|
21388
|
+
if (this.eat(139)) {
|
|
21405
21389
|
return this.finishNode(node, 'JSXOpeningFragment');
|
|
21406
21390
|
}
|
|
21407
21391
|
|
|
@@ -21412,25 +21396,25 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21412
21396
|
jsxParseOpeningElementAfterName(node) {
|
|
21413
21397
|
const attributes = [];
|
|
21414
21398
|
|
|
21415
|
-
while (!this.match(
|
|
21399
|
+
while (!this.match(52) && !this.match(139)) {
|
|
21416
21400
|
attributes.push(this.jsxParseAttribute());
|
|
21417
21401
|
}
|
|
21418
21402
|
|
|
21419
21403
|
node.attributes = attributes;
|
|
21420
|
-
node.selfClosing = this.eat(
|
|
21421
|
-
this.expect(
|
|
21404
|
+
node.selfClosing = this.eat(52);
|
|
21405
|
+
this.expect(139);
|
|
21422
21406
|
return this.finishNode(node, 'JSXOpeningElement');
|
|
21423
21407
|
}
|
|
21424
21408
|
|
|
21425
21409
|
jsxParseClosingElementAt(startLoc) {
|
|
21426
21410
|
const node = this.startNodeAt(startLoc);
|
|
21427
21411
|
|
|
21428
|
-
if (this.eat(
|
|
21412
|
+
if (this.eat(139)) {
|
|
21429
21413
|
return this.finishNode(node, 'JSXClosingFragment');
|
|
21430
21414
|
}
|
|
21431
21415
|
|
|
21432
21416
|
node.name = this.jsxParseElementName();
|
|
21433
|
-
this.expect(
|
|
21417
|
+
this.expect(139);
|
|
21434
21418
|
return this.finishNode(node, 'JSXClosingElement');
|
|
21435
21419
|
}
|
|
21436
21420
|
|
|
@@ -21443,11 +21427,11 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21443
21427
|
if (!openingElement.selfClosing) {
|
|
21444
21428
|
contents: for (;;) {
|
|
21445
21429
|
switch(this.state.type) {
|
|
21446
|
-
case
|
|
21430
|
+
case 138:
|
|
21447
21431
|
startLoc = this.state.startLoc;
|
|
21448
21432
|
this.next();
|
|
21449
21433
|
|
|
21450
|
-
if (this.eat(
|
|
21434
|
+
if (this.eat(52)) {
|
|
21451
21435
|
closingElement = this.jsxParseClosingElementAt(startLoc);
|
|
21452
21436
|
break contents;
|
|
21453
21437
|
}
|
|
@@ -21455,16 +21439,16 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21455
21439
|
children.push(this.jsxParseElementAt(startLoc));
|
|
21456
21440
|
break;
|
|
21457
21441
|
|
|
21458
|
-
case
|
|
21442
|
+
case 137:
|
|
21459
21443
|
children.push(this.parseLiteral(this.state.value, 'JSXText'));
|
|
21460
21444
|
break;
|
|
21461
21445
|
|
|
21462
|
-
case
|
|
21446
|
+
case 2: {
|
|
21463
21447
|
const node2 = this.startNode();
|
|
21464
21448
|
this.setContext(types.brace);
|
|
21465
21449
|
this.next();
|
|
21466
21450
|
|
|
21467
|
-
if (this.match(
|
|
21451
|
+
if (this.match(17)) {
|
|
21468
21452
|
children.push(this.jsxParseSpreadChild(node2));
|
|
21469
21453
|
} else {
|
|
21470
21454
|
children.push(this.jsxParseExpressionContainer(node2, types.j_expr));
|
|
@@ -21503,7 +21487,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21503
21487
|
|
|
21504
21488
|
node.children = children;
|
|
21505
21489
|
|
|
21506
|
-
if (this.match(
|
|
21490
|
+
if (this.match(43)) {
|
|
21507
21491
|
throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc);
|
|
21508
21492
|
}
|
|
21509
21493
|
|
|
@@ -21523,10 +21507,10 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21523
21507
|
}
|
|
21524
21508
|
|
|
21525
21509
|
parseExprAtom(refExpressionErrors) {
|
|
21526
|
-
if (this.match(
|
|
21510
|
+
if (this.match(138)) {
|
|
21527
21511
|
return this.jsxParseElement();
|
|
21528
|
-
} else if (this.match(
|
|
21529
|
-
this.replaceToken(
|
|
21512
|
+
} else if (this.match(43) && this.input.charCodeAt(this.state.pos) !== 33) {
|
|
21513
|
+
this.replaceToken(138);
|
|
21530
21514
|
return this.jsxParseElement();
|
|
21531
21515
|
} else {
|
|
21532
21516
|
return super.parseExprAtom(refExpressionErrors);
|
|
@@ -21556,7 +21540,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21556
21540
|
|
|
21557
21541
|
if (code2 === 62) {
|
|
21558
21542
|
++this.state.pos;
|
|
21559
|
-
this.finishToken(
|
|
21543
|
+
this.finishToken(139);
|
|
21560
21544
|
return;
|
|
21561
21545
|
}
|
|
21562
21546
|
|
|
@@ -21568,7 +21552,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21568
21552
|
|
|
21569
21553
|
if (code2 === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
|
|
21570
21554
|
++this.state.pos;
|
|
21571
|
-
this.finishToken(
|
|
21555
|
+
this.finishToken(138);
|
|
21572
21556
|
return;
|
|
21573
21557
|
}
|
|
21574
21558
|
|
|
@@ -21578,15 +21562,15 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
21578
21562
|
updateContext(prevType) {
|
|
21579
21563
|
const {context, type} = this.state;
|
|
21580
21564
|
|
|
21581
|
-
if (type ===
|
|
21565
|
+
if (type === 52 && prevType === 138) {
|
|
21582
21566
|
context.splice(-2, 2, types.j_cTag);
|
|
21583
21567
|
this.state.canStartJSXElement = false;
|
|
21584
|
-
} else if (type ===
|
|
21568
|
+
} else if (type === 138) {
|
|
21585
21569
|
context.push(types.j_oTag);
|
|
21586
|
-
} else if (type ===
|
|
21570
|
+
} else if (type === 139) {
|
|
21587
21571
|
const out = context[context.length - 1];
|
|
21588
21572
|
|
|
21589
|
-
if (out === types.j_oTag && prevType ===
|
|
21573
|
+
if (out === types.j_oTag && prevType === 52 || out === types.j_cTag) {
|
|
21590
21574
|
context.pop();
|
|
21591
21575
|
this.state.canStartJSXElement = context[context.length - 1] === types.j_expr;
|
|
21592
21576
|
} else {
|
|
@@ -22061,7 +22045,7 @@ var State = class _State {
|
|
|
22061
22045
|
__publicField(this, 'commentsLen', 0);
|
|
22062
22046
|
__publicField(this, 'commentStack', []);
|
|
22063
22047
|
__publicField(this, 'pos', 0);
|
|
22064
|
-
__publicField(this, 'type',
|
|
22048
|
+
__publicField(this, 'type', 135);
|
|
22065
22049
|
__publicField(this, 'value', null);
|
|
22066
22050
|
__publicField(this, 'start', 0);
|
|
22067
22051
|
__publicField(this, 'end', 0);
|
|
@@ -22815,7 +22799,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
22815
22799
|
this.state.startLoc = this.state.curPosition();
|
|
22816
22800
|
|
|
22817
22801
|
if (this.state.pos >= this.length) {
|
|
22818
|
-
this.finishToken(
|
|
22802
|
+
this.finishToken(135);
|
|
22819
22803
|
return;
|
|
22820
22804
|
}
|
|
22821
22805
|
|
|
@@ -23033,12 +23017,12 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23033
23017
|
|
|
23034
23018
|
if (isIdentifierStart2(next)) {
|
|
23035
23019
|
++this.state.pos;
|
|
23036
|
-
this.finishToken(
|
|
23020
|
+
this.finishToken(134, this.readWord1(next));
|
|
23037
23021
|
} else if (next === 92) {
|
|
23038
23022
|
++this.state.pos;
|
|
23039
|
-
this.finishToken(
|
|
23023
|
+
this.finishToken(134, this.readWord1());
|
|
23040
23024
|
} else {
|
|
23041
|
-
this.finishOp(
|
|
23025
|
+
this.finishOp(23, 1);
|
|
23042
23026
|
}
|
|
23043
23027
|
}
|
|
23044
23028
|
|
|
@@ -23052,10 +23036,10 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23052
23036
|
|
|
23053
23037
|
if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
|
|
23054
23038
|
this.state.pos += 3;
|
|
23055
|
-
this.finishToken(
|
|
23039
|
+
this.finishToken(17);
|
|
23056
23040
|
} else {
|
|
23057
23041
|
++this.state.pos;
|
|
23058
|
-
this.finishToken(
|
|
23042
|
+
this.finishToken(12);
|
|
23059
23043
|
}
|
|
23060
23044
|
}
|
|
23061
23045
|
|
|
@@ -23063,9 +23047,9 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23063
23047
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
23064
23048
|
|
|
23065
23049
|
if (next === 61) {
|
|
23066
|
-
this.finishOp(
|
|
23050
|
+
this.finishOp(27, 2);
|
|
23067
23051
|
} else {
|
|
23068
|
-
this.finishOp(
|
|
23052
|
+
this.finishOp(52, 1);
|
|
23069
23053
|
}
|
|
23070
23054
|
}
|
|
23071
23055
|
|
|
@@ -23086,24 +23070,24 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23086
23070
|
}
|
|
23087
23071
|
|
|
23088
23072
|
const value = this.input.slice(start + 2, this.state.pos);
|
|
23089
|
-
this.finishToken(
|
|
23073
|
+
this.finishToken(24, value);
|
|
23090
23074
|
return true;
|
|
23091
23075
|
}
|
|
23092
23076
|
|
|
23093
23077
|
readToken_mult_modulo(code2) {
|
|
23094
|
-
let type = code2 === 42 ?
|
|
23078
|
+
let type = code2 === 42 ? 51 : 50;
|
|
23095
23079
|
let width = 1;
|
|
23096
23080
|
let next = this.input.charCodeAt(this.state.pos + 1);
|
|
23097
23081
|
|
|
23098
23082
|
if (code2 === 42 && next === 42) {
|
|
23099
23083
|
width++;
|
|
23100
23084
|
next = this.input.charCodeAt(this.state.pos + 2);
|
|
23101
|
-
type =
|
|
23085
|
+
type = 53;
|
|
23102
23086
|
}
|
|
23103
23087
|
|
|
23104
23088
|
if (next === 61 && !this.state.inType) {
|
|
23105
23089
|
width++;
|
|
23106
|
-
type = code2 === 37 ?
|
|
23090
|
+
type = code2 === 37 ? 29 : 26;
|
|
23107
23091
|
}
|
|
23108
23092
|
|
|
23109
23093
|
this.finishOp(type, width);
|
|
@@ -23114,9 +23098,9 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23114
23098
|
|
|
23115
23099
|
if (next === code2) {
|
|
23116
23100
|
if (this.input.charCodeAt(this.state.pos + 2) === 61) {
|
|
23117
|
-
this.finishOp(
|
|
23101
|
+
this.finishOp(26, 3);
|
|
23118
23102
|
} else {
|
|
23119
|
-
this.finishOp(code2 === 124 ?
|
|
23103
|
+
this.finishOp(code2 === 124 ? 37 : 38, 2);
|
|
23120
23104
|
}
|
|
23121
23105
|
|
|
23122
23106
|
return;
|
|
@@ -23124,33 +23108,33 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23124
23108
|
|
|
23125
23109
|
if (code2 === 124) {
|
|
23126
23110
|
if (next === 62) {
|
|
23127
|
-
this.finishOp(
|
|
23111
|
+
this.finishOp(35, 2);
|
|
23128
23112
|
return;
|
|
23129
23113
|
}
|
|
23130
23114
|
}
|
|
23131
23115
|
|
|
23132
23116
|
if (next === 61) {
|
|
23133
|
-
this.finishOp(
|
|
23117
|
+
this.finishOp(26, 2);
|
|
23134
23118
|
return;
|
|
23135
23119
|
}
|
|
23136
23120
|
|
|
23137
|
-
this.finishOp(code2 === 124 ?
|
|
23121
|
+
this.finishOp(code2 === 124 ? 39 : 41, 1);
|
|
23138
23122
|
}
|
|
23139
23123
|
|
|
23140
23124
|
readToken_caret() {
|
|
23141
23125
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
23142
23126
|
|
|
23143
23127
|
if (next === 61 && !this.state.inType) {
|
|
23144
|
-
this.finishOp(
|
|
23128
|
+
this.finishOp(28, 2);
|
|
23145
23129
|
} else if (next === 94 && this.hasPlugin(['pipelineOperator', {proposal: 'hack', topicToken: '^^'}])) {
|
|
23146
|
-
this.finishOp(
|
|
23130
|
+
this.finishOp(33, 2);
|
|
23147
23131
|
const lookaheadCh = this.input.codePointAt(this.state.pos);
|
|
23148
23132
|
|
|
23149
23133
|
if (lookaheadCh === 94) {
|
|
23150
23134
|
this.unexpected();
|
|
23151
23135
|
}
|
|
23152
23136
|
} else {
|
|
23153
|
-
this.finishOp(
|
|
23137
|
+
this.finishOp(40, 1);
|
|
23154
23138
|
}
|
|
23155
23139
|
}
|
|
23156
23140
|
|
|
@@ -23158,9 +23142,9 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23158
23142
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
23159
23143
|
|
|
23160
23144
|
if (next === 64 && this.hasPlugin(['pipelineOperator', {proposal: 'hack', topicToken: '@@'}])) {
|
|
23161
|
-
this.finishOp(
|
|
23145
|
+
this.finishOp(34, 2);
|
|
23162
23146
|
} else {
|
|
23163
|
-
this.finishOp(
|
|
23147
|
+
this.finishOp(22, 1);
|
|
23164
23148
|
}
|
|
23165
23149
|
}
|
|
23166
23150
|
|
|
@@ -23168,14 +23152,14 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23168
23152
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
23169
23153
|
|
|
23170
23154
|
if (next === code2) {
|
|
23171
|
-
this.finishOp(
|
|
23155
|
+
this.finishOp(30, 2);
|
|
23172
23156
|
return;
|
|
23173
23157
|
}
|
|
23174
23158
|
|
|
23175
23159
|
if (next === 61) {
|
|
23176
|
-
this.finishOp(
|
|
23160
|
+
this.finishOp(26, 2);
|
|
23177
23161
|
} else {
|
|
23178
|
-
this.finishOp(
|
|
23162
|
+
this.finishOp(49, 1);
|
|
23179
23163
|
}
|
|
23180
23164
|
}
|
|
23181
23165
|
|
|
@@ -23186,20 +23170,20 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23186
23170
|
|
|
23187
23171
|
if (next === 60) {
|
|
23188
23172
|
if (this.input.charCodeAt(pos + 2) === 61) {
|
|
23189
|
-
this.finishOp(
|
|
23173
|
+
this.finishOp(26, 3);
|
|
23190
23174
|
return;
|
|
23191
23175
|
}
|
|
23192
23176
|
|
|
23193
|
-
this.finishOp(
|
|
23177
|
+
this.finishOp(47, 2);
|
|
23194
23178
|
return;
|
|
23195
23179
|
}
|
|
23196
23180
|
|
|
23197
23181
|
if (next === 61) {
|
|
23198
|
-
this.finishOp(
|
|
23182
|
+
this.finishOp(45, 2);
|
|
23199
23183
|
return;
|
|
23200
23184
|
}
|
|
23201
23185
|
|
|
23202
|
-
this.finishOp(
|
|
23186
|
+
this.finishOp(43, 1);
|
|
23203
23187
|
}
|
|
23204
23188
|
|
|
23205
23189
|
readToken_gt() {
|
|
@@ -23211,37 +23195,37 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23211
23195
|
const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2;
|
|
23212
23196
|
|
|
23213
23197
|
if (this.input.charCodeAt(pos + size) === 61) {
|
|
23214
|
-
this.finishOp(
|
|
23198
|
+
this.finishOp(26, size + 1);
|
|
23215
23199
|
return;
|
|
23216
23200
|
}
|
|
23217
23201
|
|
|
23218
|
-
this.finishOp(
|
|
23202
|
+
this.finishOp(48, size);
|
|
23219
23203
|
return;
|
|
23220
23204
|
}
|
|
23221
23205
|
|
|
23222
23206
|
if (next === 61) {
|
|
23223
|
-
this.finishOp(
|
|
23207
|
+
this.finishOp(45, 2);
|
|
23224
23208
|
return;
|
|
23225
23209
|
}
|
|
23226
23210
|
|
|
23227
|
-
this.finishOp(
|
|
23211
|
+
this.finishOp(44, 1);
|
|
23228
23212
|
}
|
|
23229
23213
|
|
|
23230
23214
|
readToken_eq_excl(code2) {
|
|
23231
23215
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
23232
23216
|
|
|
23233
23217
|
if (next === 61) {
|
|
23234
|
-
this.finishOp(
|
|
23218
|
+
this.finishOp(42, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
|
|
23235
23219
|
return;
|
|
23236
23220
|
}
|
|
23237
23221
|
|
|
23238
23222
|
if (code2 === 61 && next === 62) {
|
|
23239
23223
|
this.state.pos += 2;
|
|
23240
|
-
this.finishToken(
|
|
23224
|
+
this.finishToken(15);
|
|
23241
23225
|
return;
|
|
23242
23226
|
}
|
|
23243
23227
|
|
|
23244
|
-
this.finishOp(code2 === 61 ?
|
|
23228
|
+
this.finishOp(code2 === 61 ? 25 : 31, 1);
|
|
23245
23229
|
}
|
|
23246
23230
|
|
|
23247
23231
|
readToken_question() {
|
|
@@ -23250,16 +23234,16 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23250
23234
|
|
|
23251
23235
|
if (next === 63) {
|
|
23252
23236
|
if (next2 === 61) {
|
|
23253
|
-
this.finishOp(
|
|
23237
|
+
this.finishOp(26, 3);
|
|
23254
23238
|
} else {
|
|
23255
|
-
this.finishOp(
|
|
23239
|
+
this.finishOp(36, 2);
|
|
23256
23240
|
}
|
|
23257
23241
|
} else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
|
|
23258
23242
|
this.state.pos += 2;
|
|
23259
|
-
this.finishToken(
|
|
23243
|
+
this.finishToken(14);
|
|
23260
23244
|
} else {
|
|
23261
23245
|
++this.state.pos;
|
|
23262
|
-
this.finishToken(
|
|
23246
|
+
this.finishToken(13);
|
|
23263
23247
|
}
|
|
23264
23248
|
}
|
|
23265
23249
|
|
|
@@ -23271,22 +23255,22 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23271
23255
|
|
|
23272
23256
|
case 40:
|
|
23273
23257
|
++this.state.pos;
|
|
23274
|
-
this.finishToken(
|
|
23258
|
+
this.finishToken(6);
|
|
23275
23259
|
return;
|
|
23276
23260
|
|
|
23277
23261
|
case 41:
|
|
23278
23262
|
++this.state.pos;
|
|
23279
|
-
this.finishToken(
|
|
23263
|
+
this.finishToken(7);
|
|
23280
23264
|
return;
|
|
23281
23265
|
|
|
23282
23266
|
case 59:
|
|
23283
23267
|
++this.state.pos;
|
|
23284
|
-
this.finishToken(
|
|
23268
|
+
this.finishToken(9);
|
|
23285
23269
|
return;
|
|
23286
23270
|
|
|
23287
23271
|
case 44:
|
|
23288
23272
|
++this.state.pos;
|
|
23289
|
-
this.finishToken(
|
|
23273
|
+
this.finishToken(8);
|
|
23290
23274
|
return;
|
|
23291
23275
|
|
|
23292
23276
|
case 91:
|
|
@@ -23296,25 +23280,25 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23296
23280
|
|
|
23297
23281
|
case 93:
|
|
23298
23282
|
++this.state.pos;
|
|
23299
|
-
this.finishToken(
|
|
23283
|
+
this.finishToken(1);
|
|
23300
23284
|
return;
|
|
23301
23285
|
|
|
23302
23286
|
case 123:
|
|
23303
23287
|
++this.state.pos;
|
|
23304
|
-
this.finishToken(
|
|
23288
|
+
this.finishToken(2);
|
|
23305
23289
|
return;
|
|
23306
23290
|
|
|
23307
23291
|
case 125:
|
|
23308
23292
|
++this.state.pos;
|
|
23309
|
-
this.finishToken(
|
|
23293
|
+
this.finishToken(4);
|
|
23310
23294
|
return;
|
|
23311
23295
|
|
|
23312
23296
|
case 58:
|
|
23313
23297
|
if (this.hasPlugin('functionBind') && this.input.charCodeAt(this.state.pos + 1) === 58) {
|
|
23314
|
-
this.finishOp(
|
|
23298
|
+
this.finishOp(11, 2);
|
|
23315
23299
|
} else {
|
|
23316
23300
|
++this.state.pos;
|
|
23317
|
-
this.finishToken(
|
|
23301
|
+
this.finishToken(10);
|
|
23318
23302
|
}
|
|
23319
23303
|
|
|
23320
23304
|
return;
|
|
@@ -23400,7 +23384,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23400
23384
|
return;
|
|
23401
23385
|
|
|
23402
23386
|
case 126:
|
|
23403
|
-
this.finishOp(
|
|
23387
|
+
this.finishOp(32, 1);
|
|
23404
23388
|
return;
|
|
23405
23389
|
|
|
23406
23390
|
case 64:
|
|
@@ -23501,7 +23485,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23501
23485
|
}
|
|
23502
23486
|
|
|
23503
23487
|
this.state.pos = pos;
|
|
23504
|
-
this.finishToken(
|
|
23488
|
+
this.finishToken(133, {
|
|
23505
23489
|
pattern: content,
|
|
23506
23490
|
flags: mods,
|
|
23507
23491
|
});
|
|
@@ -23546,11 +23530,11 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23546
23530
|
.state
|
|
23547
23531
|
.pos)
|
|
23548
23532
|
.replace(/[_n]/g, '');
|
|
23549
|
-
this.finishToken(
|
|
23533
|
+
this.finishToken(132, str);
|
|
23550
23534
|
return;
|
|
23551
23535
|
}
|
|
23552
23536
|
|
|
23553
|
-
this.finishToken(
|
|
23537
|
+
this.finishToken(131, val);
|
|
23554
23538
|
}
|
|
23555
23539
|
|
|
23556
23540
|
readNumber(startsWithDot) {
|
|
@@ -23629,12 +23613,12 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23629
23613
|
.replace(/[_mn]/g, '');
|
|
23630
23614
|
|
|
23631
23615
|
if (isBigInt) {
|
|
23632
|
-
this.finishToken(
|
|
23616
|
+
this.finishToken(132, str);
|
|
23633
23617
|
return;
|
|
23634
23618
|
}
|
|
23635
23619
|
|
|
23636
23620
|
const val = isOctal ? parseInt(str, 8) : parseFloat(str);
|
|
23637
|
-
this.finishToken(
|
|
23621
|
+
this.finishToken(131, val);
|
|
23638
23622
|
}
|
|
23639
23623
|
|
|
23640
23624
|
readCodePoint(throwOnInvalid) {
|
|
@@ -23655,12 +23639,12 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23655
23639
|
this.state.pos = pos + 1;
|
|
23656
23640
|
this.state.lineStart = lineStart;
|
|
23657
23641
|
this.state.curLine = curLine;
|
|
23658
|
-
this.finishToken(
|
|
23642
|
+
this.finishToken(130, str);
|
|
23659
23643
|
}
|
|
23660
23644
|
|
|
23661
23645
|
readTemplateContinuation() {
|
|
23662
|
-
if (!this.match(
|
|
23663
|
-
this.unexpected(null,
|
|
23646
|
+
if (!this.match(4)) {
|
|
23647
|
+
this.unexpected(null, 4);
|
|
23664
23648
|
}
|
|
23665
23649
|
|
|
23666
23650
|
this.state.pos--;
|
|
@@ -23686,10 +23670,10 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23686
23670
|
}
|
|
23687
23671
|
|
|
23688
23672
|
if (this.input.codePointAt(pos) === 96) {
|
|
23689
|
-
this.finishToken(
|
|
23673
|
+
this.finishToken(20, firstInvalidLoc ? null : opening + str + '`');
|
|
23690
23674
|
} else {
|
|
23691
23675
|
this.state.pos++;
|
|
23692
|
-
this.finishToken(
|
|
23676
|
+
this.finishToken(21, firstInvalidLoc ? null : opening + str + '${');
|
|
23693
23677
|
}
|
|
23694
23678
|
}
|
|
23695
23679
|
|
|
@@ -23757,7 +23741,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23757
23741
|
if (type !== void 0) {
|
|
23758
23742
|
this.finishToken(type, tokenLabelName(type));
|
|
23759
23743
|
} else {
|
|
23760
|
-
this.finishToken(
|
|
23744
|
+
this.finishToken(128, word);
|
|
23761
23745
|
}
|
|
23762
23746
|
}
|
|
23763
23747
|
|
|
@@ -24128,7 +24112,7 @@ var UtilParser = class extends Tokenizer {
|
|
|
24128
24112
|
}
|
|
24129
24113
|
|
|
24130
24114
|
canInsertSemicolon() {
|
|
24131
|
-
return this.match(
|
|
24115
|
+
return this.match(135) || this.match(4) || this.hasPrecedingLineBreak();
|
|
24132
24116
|
}
|
|
24133
24117
|
|
|
24134
24118
|
hasPrecedingLineBreak() {
|
|
@@ -24140,11 +24124,11 @@ var UtilParser = class extends Tokenizer {
|
|
|
24140
24124
|
}
|
|
24141
24125
|
|
|
24142
24126
|
isLineTerminator() {
|
|
24143
|
-
return this.eat(
|
|
24127
|
+
return this.eat(9) || this.canInsertSemicolon();
|
|
24144
24128
|
}
|
|
24145
24129
|
|
|
24146
24130
|
semicolon(allowAsi = true) {
|
|
24147
|
-
if (allowAsi ? this.isLineTerminator() : this.eat(
|
|
24131
|
+
if (allowAsi ? this.isLineTerminator() : this.eat(9))
|
|
24148
24132
|
return;
|
|
24149
24133
|
|
|
24150
24134
|
this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc);
|
|
@@ -24711,14 +24695,14 @@ var LValParser = class extends NodeUtils {
|
|
|
24711
24695
|
case 0: {
|
|
24712
24696
|
const node = this.startNode();
|
|
24713
24697
|
this.next();
|
|
24714
|
-
node.elements = this.parseBindingList(
|
|
24698
|
+
node.elements = this.parseBindingList(1, 93, 1);
|
|
24715
24699
|
return this.finishNode(node, 'ArrayPattern');
|
|
24716
24700
|
}
|
|
24717
24701
|
|
|
24718
|
-
case
|
|
24719
|
-
return this.parseObjectLike(
|
|
24702
|
+
case 2:
|
|
24703
|
+
return this.parseObjectLike(4, true);
|
|
24720
24704
|
|
|
24721
|
-
case
|
|
24705
|
+
case 84:
|
|
24722
24706
|
return this.parseVoidPattern(null);
|
|
24723
24707
|
}
|
|
24724
24708
|
|
|
@@ -24734,14 +24718,14 @@ var LValParser = class extends NodeUtils {
|
|
|
24734
24718
|
if (first) {
|
|
24735
24719
|
first = false;
|
|
24736
24720
|
} else {
|
|
24737
|
-
this.expect(
|
|
24721
|
+
this.expect(8);
|
|
24738
24722
|
}
|
|
24739
24723
|
|
|
24740
|
-
if (allowEmpty && this.match(
|
|
24724
|
+
if (allowEmpty && this.match(8)) {
|
|
24741
24725
|
elts.push(null);
|
|
24742
24726
|
} else if (this.eat(close)) {
|
|
24743
24727
|
break;
|
|
24744
|
-
} else if (this.match(
|
|
24728
|
+
} else if (this.match(17)) {
|
|
24745
24729
|
let rest = this.parseRestBinding();
|
|
24746
24730
|
|
|
24747
24731
|
if (flags & 2) {
|
|
@@ -24758,11 +24742,11 @@ var LValParser = class extends NodeUtils {
|
|
|
24758
24742
|
const decorators = [];
|
|
24759
24743
|
|
|
24760
24744
|
if (flags & 2) {
|
|
24761
|
-
if (this.match(
|
|
24745
|
+
if (this.match(22) && this.hasPlugin('decorators')) {
|
|
24762
24746
|
this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc);
|
|
24763
24747
|
}
|
|
24764
24748
|
|
|
24765
|
-
while (this.match(
|
|
24749
|
+
while (this.match(22)) {
|
|
24766
24750
|
decorators.push(this.parseDecorator());
|
|
24767
24751
|
}
|
|
24768
24752
|
}
|
|
@@ -24778,7 +24762,7 @@ var LValParser = class extends NodeUtils {
|
|
|
24778
24762
|
parseBindingRestProperty(prop) {
|
|
24779
24763
|
this.next();
|
|
24780
24764
|
|
|
24781
|
-
if (this.hasPlugin('discardBinding') && this.match(
|
|
24765
|
+
if (this.hasPlugin('discardBinding') && this.match(84)) {
|
|
24782
24766
|
prop.argument = this.parseVoidPattern(null);
|
|
24783
24767
|
this.raise(Errors.UnexpectedVoidPattern, prop.argument);
|
|
24784
24768
|
} else {
|
|
@@ -24792,13 +24776,13 @@ var LValParser = class extends NodeUtils {
|
|
|
24792
24776
|
parseBindingProperty() {
|
|
24793
24777
|
const {type, startLoc} = this.state;
|
|
24794
24778
|
|
|
24795
|
-
if (type ===
|
|
24779
|
+
if (type === 17) {
|
|
24796
24780
|
return this.parseBindingRestProperty(this.startNode());
|
|
24797
24781
|
}
|
|
24798
24782
|
|
|
24799
24783
|
const prop = this.startNode();
|
|
24800
24784
|
|
|
24801
|
-
if (type ===
|
|
24785
|
+
if (type === 134) {
|
|
24802
24786
|
this.expectPlugin('destructuringPrivate', startLoc);
|
|
24803
24787
|
this.classScope.usePrivateName(this.state.value, startLoc);
|
|
24804
24788
|
prop.key = this.parsePrivateName();
|
|
@@ -24835,7 +24819,7 @@ var LValParser = class extends NodeUtils {
|
|
|
24835
24819
|
startLoc ?? (startLoc = this.state.startLoc);
|
|
24836
24820
|
left = left ?? this.parseBindingAtom();
|
|
24837
24821
|
|
|
24838
|
-
if (!this.eat(
|
|
24822
|
+
if (!this.eat(25))
|
|
24839
24823
|
return left;
|
|
24840
24824
|
|
|
24841
24825
|
const node = this.startNodeAt(startLoc);
|
|
@@ -25017,7 +25001,7 @@ var LValParser = class extends NodeUtils {
|
|
|
25017
25001
|
}
|
|
25018
25002
|
|
|
25019
25003
|
checkCommaAfterRest(close) {
|
|
25020
|
-
if (!this.match(
|
|
25004
|
+
if (!this.match(8)) {
|
|
25021
25005
|
return false;
|
|
25022
25006
|
}
|
|
25023
25007
|
|
|
@@ -25226,10 +25210,10 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25226
25210
|
|
|
25227
25211
|
tsTokenCanFollowModifier() {
|
|
25228
25212
|
return this.match(0)
|
|
25229
|
-
|| this.match(
|
|
25230
|
-
|| this.match(
|
|
25231
|
-
|| this.match(
|
|
25232
|
-
|| this.match(
|
|
25213
|
+
|| this.match(2)
|
|
25214
|
+
|| this.match(51)
|
|
25215
|
+
|| this.match(17)
|
|
25216
|
+
|| this.match(134)
|
|
25233
25217
|
|| this.isLiteralPropertyName();
|
|
25234
25218
|
}
|
|
25235
25219
|
|
|
@@ -25244,7 +25228,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25244
25228
|
}
|
|
25245
25229
|
|
|
25246
25230
|
tsNextTokenCanFollowModifier() {
|
|
25247
|
-
if (this.match(
|
|
25231
|
+
if (this.match(102)) {
|
|
25248
25232
|
this.next();
|
|
25249
25233
|
return this.tsTokenCanFollowModifier();
|
|
25250
25234
|
}
|
|
@@ -25253,14 +25237,14 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25253
25237
|
}
|
|
25254
25238
|
|
|
25255
25239
|
tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) {
|
|
25256
|
-
if (!tokenIsIdentifier(this.state.type) && this.state.type !==
|
|
25240
|
+
if (!tokenIsIdentifier(this.state.type) && this.state.type !== 54 && this.state.type !== 71) {
|
|
25257
25241
|
return void 0;
|
|
25258
25242
|
}
|
|
25259
25243
|
|
|
25260
25244
|
const modifier = this.state.value;
|
|
25261
25245
|
|
|
25262
25246
|
if (allowedModifiers.includes(modifier)) {
|
|
25263
|
-
if (hasSeenStaticModifier && this.match(
|
|
25247
|
+
if (hasSeenStaticModifier && this.match(102)) {
|
|
25264
25248
|
return void 0;
|
|
25265
25249
|
}
|
|
25266
25250
|
|
|
@@ -25350,16 +25334,16 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25350
25334
|
switch(kind) {
|
|
25351
25335
|
case 'EnumMembers':
|
|
25352
25336
|
case 'TypeMembers':
|
|
25353
|
-
return this.match(
|
|
25337
|
+
return this.match(4);
|
|
25354
25338
|
|
|
25355
25339
|
case 'HeritageClauseElement':
|
|
25356
|
-
return this.match(
|
|
25340
|
+
return this.match(2);
|
|
25357
25341
|
|
|
25358
25342
|
case 'TupleElementTypes':
|
|
25359
|
-
return this.match(
|
|
25343
|
+
return this.match(1);
|
|
25360
25344
|
|
|
25361
25345
|
case 'TypeParametersOrArguments':
|
|
25362
|
-
return this.match(
|
|
25346
|
+
return this.match(44);
|
|
25363
25347
|
}
|
|
25364
25348
|
}
|
|
25365
25349
|
|
|
@@ -25400,7 +25384,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25400
25384
|
|
|
25401
25385
|
result.push(element);
|
|
25402
25386
|
|
|
25403
|
-
if (this.eat(
|
|
25387
|
+
if (this.eat(8)) {
|
|
25404
25388
|
trailingCommaPos = this.state.lastTokStartLoc.index;
|
|
25405
25389
|
continue;
|
|
25406
25390
|
}
|
|
@@ -25410,7 +25394,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25410
25394
|
}
|
|
25411
25395
|
|
|
25412
25396
|
if (expectSuccess) {
|
|
25413
|
-
this.expect(
|
|
25397
|
+
this.expect(8);
|
|
25414
25398
|
}
|
|
25415
25399
|
|
|
25416
25400
|
return void 0;
|
|
@@ -25428,16 +25412,16 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25428
25412
|
if (bracket) {
|
|
25429
25413
|
this.expect(0);
|
|
25430
25414
|
} else {
|
|
25431
|
-
this.expect(
|
|
25415
|
+
this.expect(43);
|
|
25432
25416
|
}
|
|
25433
25417
|
}
|
|
25434
25418
|
|
|
25435
25419
|
const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos);
|
|
25436
25420
|
|
|
25437
25421
|
if (bracket) {
|
|
25438
|
-
this.expect(
|
|
25422
|
+
this.expect(1);
|
|
25439
25423
|
} else {
|
|
25440
|
-
this.expect(
|
|
25424
|
+
this.expect(44);
|
|
25441
25425
|
}
|
|
25442
25426
|
|
|
25443
25427
|
return result;
|
|
@@ -25445,29 +25429,29 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25445
25429
|
|
|
25446
25430
|
tsParseImportType() {
|
|
25447
25431
|
const node = this.startNode();
|
|
25448
|
-
this.expect(
|
|
25449
|
-
this.expect(
|
|
25432
|
+
this.expect(79);
|
|
25433
|
+
this.expect(6);
|
|
25450
25434
|
|
|
25451
|
-
if (!this.match(
|
|
25435
|
+
if (!this.match(130)) {
|
|
25452
25436
|
this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
|
|
25453
25437
|
node.source = this.tsParseNonConditionalType();
|
|
25454
25438
|
} else {
|
|
25455
25439
|
node.source = this.parseStringLiteral(this.state.value);
|
|
25456
25440
|
}
|
|
25457
25441
|
|
|
25458
|
-
if (this.eat(
|
|
25442
|
+
if (this.eat(8)) {
|
|
25459
25443
|
node.options = this.tsParseImportTypeOptions();
|
|
25460
25444
|
} else {
|
|
25461
25445
|
node.options = null;
|
|
25462
25446
|
}
|
|
25463
25447
|
|
|
25464
|
-
this.expect(
|
|
25448
|
+
this.expect(7);
|
|
25465
25449
|
|
|
25466
|
-
if (this.eat(
|
|
25450
|
+
if (this.eat(12)) {
|
|
25467
25451
|
node.qualifier = this.tsParseEntityName(1 | 2);
|
|
25468
25452
|
}
|
|
25469
25453
|
|
|
25470
|
-
if (this.match(
|
|
25454
|
+
if (this.match(43)) {
|
|
25471
25455
|
node.typeArguments = this.tsParseTypeArguments();
|
|
25472
25456
|
}
|
|
25473
25457
|
|
|
@@ -25476,42 +25460,42 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25476
25460
|
|
|
25477
25461
|
tsParseImportTypeOptions() {
|
|
25478
25462
|
const node = this.startNode();
|
|
25479
|
-
this.expect(
|
|
25463
|
+
this.expect(2);
|
|
25480
25464
|
const withProperty = this.startNode();
|
|
25481
25465
|
|
|
25482
|
-
if (this.isContextual(
|
|
25466
|
+
if (this.isContextual(72)) {
|
|
25483
25467
|
withProperty.method = false;
|
|
25484
25468
|
withProperty.key = this.parseIdentifier(true);
|
|
25485
25469
|
withProperty.computed = false;
|
|
25486
25470
|
withProperty.shorthand = false;
|
|
25487
25471
|
} else {
|
|
25488
|
-
this.unexpected(null,
|
|
25472
|
+
this.unexpected(null, 72);
|
|
25489
25473
|
}
|
|
25490
25474
|
|
|
25491
|
-
this.expect(
|
|
25475
|
+
this.expect(10);
|
|
25492
25476
|
withProperty.value = this.tsParseImportTypeWithPropertyValue();
|
|
25493
25477
|
node.properties = [
|
|
25494
25478
|
this.finishObjectProperty(withProperty),
|
|
25495
25479
|
];
|
|
25496
|
-
this.eat(
|
|
25497
|
-
this.expect(
|
|
25480
|
+
this.eat(8);
|
|
25481
|
+
this.expect(4);
|
|
25498
25482
|
return this.finishNode(node, 'ObjectExpression');
|
|
25499
25483
|
}
|
|
25500
25484
|
|
|
25501
25485
|
tsParseImportTypeWithPropertyValue() {
|
|
25502
25486
|
const node = this.startNode();
|
|
25503
25487
|
const properties = [];
|
|
25504
|
-
this.expect(
|
|
25505
|
-
while (!this.match(
|
|
25488
|
+
this.expect(2);
|
|
25489
|
+
while (!this.match(4)) {
|
|
25506
25490
|
const type = this.state.type;
|
|
25507
25491
|
|
|
25508
|
-
if (tokenIsIdentifier(type) || type ===
|
|
25492
|
+
if (tokenIsIdentifier(type) || type === 130) {
|
|
25509
25493
|
properties.push(super.parsePropertyDefinition(null));
|
|
25510
25494
|
} else {
|
|
25511
25495
|
this.unexpected();
|
|
25512
25496
|
}
|
|
25513
25497
|
|
|
25514
|
-
this.eat(
|
|
25498
|
+
this.eat(8);
|
|
25515
25499
|
}
|
|
25516
25500
|
|
|
25517
25501
|
node.properties = properties;
|
|
@@ -25522,7 +25506,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25522
25506
|
tsParseEntityName(flags) {
|
|
25523
25507
|
let entity;
|
|
25524
25508
|
|
|
25525
|
-
if (flags & 1 && this.match(
|
|
25509
|
+
if (flags & 1 && this.match(74)) {
|
|
25526
25510
|
if (flags & 2) {
|
|
25527
25511
|
entity = this.parseIdentifier(true);
|
|
25528
25512
|
} else {
|
|
@@ -25534,7 +25518,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25534
25518
|
entity = this.parseIdentifier(!!(flags & 1));
|
|
25535
25519
|
}
|
|
25536
25520
|
|
|
25537
|
-
while (this.eat(
|
|
25521
|
+
while (this.eat(12)) {
|
|
25538
25522
|
const node = this.startNodeAtNode(entity);
|
|
25539
25523
|
|
|
25540
25524
|
node.left = entity;
|
|
@@ -25550,7 +25534,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25550
25534
|
|
|
25551
25535
|
node.typeName = this.tsParseEntityName(1);
|
|
25552
25536
|
|
|
25553
|
-
if (!this.hasPrecedingLineBreak() && this.match(
|
|
25537
|
+
if (!this.hasPrecedingLineBreak() && this.match(43)) {
|
|
25554
25538
|
node.typeArguments = this.tsParseTypeArguments();
|
|
25555
25539
|
}
|
|
25556
25540
|
|
|
@@ -25575,15 +25559,15 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25575
25559
|
|
|
25576
25560
|
tsParseTypeQuery() {
|
|
25577
25561
|
const node = this.startNode();
|
|
25578
|
-
this.expect(
|
|
25562
|
+
this.expect(83);
|
|
25579
25563
|
|
|
25580
|
-
if (this.match(
|
|
25564
|
+
if (this.match(79)) {
|
|
25581
25565
|
node.exprName = this.tsParseImportType();
|
|
25582
25566
|
} else {
|
|
25583
25567
|
node.exprName = this.tsParseEntityName(1);
|
|
25584
25568
|
}
|
|
25585
25569
|
|
|
25586
|
-
if (!this.hasPrecedingLineBreak() && this.match(
|
|
25570
|
+
if (!this.hasPrecedingLineBreak() && this.match(43)) {
|
|
25587
25571
|
node.typeArguments = this.tsParseTypeArguments();
|
|
25588
25572
|
}
|
|
25589
25573
|
|
|
@@ -25594,13 +25578,13 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25594
25578
|
const node = this.startNode();
|
|
25595
25579
|
parseModifiers(node);
|
|
25596
25580
|
node.name = this.tsParseTypeParameterName();
|
|
25597
|
-
node.constraint = this.tsEatThenParseType(
|
|
25598
|
-
node.default = this.tsEatThenParseType(
|
|
25581
|
+
node.constraint = this.tsEatThenParseType(77);
|
|
25582
|
+
node.default = this.tsEatThenParseType(25);
|
|
25599
25583
|
return this.finishNode(node, 'TSTypeParameter');
|
|
25600
25584
|
}
|
|
25601
25585
|
|
|
25602
25586
|
tsTryParseTypeParameters(parseModifiers) {
|
|
25603
|
-
if (this.match(
|
|
25587
|
+
if (this.match(43)) {
|
|
25604
25588
|
return this.tsParseTypeParameters(parseModifiers);
|
|
25605
25589
|
}
|
|
25606
25590
|
}
|
|
@@ -25608,7 +25592,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25608
25592
|
tsParseTypeParameters(parseModifiers) {
|
|
25609
25593
|
const node = this.startNode();
|
|
25610
25594
|
|
|
25611
|
-
if (this.match(
|
|
25595
|
+
if (this.match(43) || this.match(138)) {
|
|
25612
25596
|
this.next();
|
|
25613
25597
|
} else {
|
|
25614
25598
|
this.unexpected();
|
|
@@ -25635,12 +25619,12 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25635
25619
|
}
|
|
25636
25620
|
|
|
25637
25621
|
tsFillSignature(returnToken, signature) {
|
|
25638
|
-
const returnTokenRequired = returnToken ===
|
|
25622
|
+
const returnTokenRequired = returnToken === 15;
|
|
25639
25623
|
const paramsKey = 'params';
|
|
25640
25624
|
const returnTypeKey = 'returnType';
|
|
25641
25625
|
|
|
25642
25626
|
signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
|
|
25643
|
-
this.expect(
|
|
25627
|
+
this.expect(6);
|
|
25644
25628
|
signature[paramsKey] = this.tsParseBindingListForSignature();
|
|
25645
25629
|
|
|
25646
25630
|
if (returnTokenRequired) {
|
|
@@ -25651,7 +25635,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25651
25635
|
}
|
|
25652
25636
|
|
|
25653
25637
|
tsParseBindingListForSignature() {
|
|
25654
|
-
const list = super.parseBindingList(
|
|
25638
|
+
const list = super.parseBindingList(7, 41, 2);
|
|
25655
25639
|
|
|
25656
25640
|
for (const pattern of list) {
|
|
25657
25641
|
const {type} = pattern;
|
|
@@ -25667,13 +25651,13 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25667
25651
|
}
|
|
25668
25652
|
|
|
25669
25653
|
tsParseTypeMemberSemicolon() {
|
|
25670
|
-
if (!this.eat(
|
|
25671
|
-
this.expect(
|
|
25654
|
+
if (!this.eat(8) && !this.isLineTerminator()) {
|
|
25655
|
+
this.expect(9);
|
|
25672
25656
|
}
|
|
25673
25657
|
}
|
|
25674
25658
|
|
|
25675
25659
|
tsParseSignatureMember(kind, node) {
|
|
25676
|
-
this.tsFillSignature(
|
|
25660
|
+
this.tsFillSignature(10, node);
|
|
25677
25661
|
this.tsParseTypeMemberSemicolon();
|
|
25678
25662
|
return this.finishNode(node, kind);
|
|
25679
25663
|
}
|
|
@@ -25683,7 +25667,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25683
25667
|
|
|
25684
25668
|
if (tokenIsIdentifier(this.state.type)) {
|
|
25685
25669
|
this.next();
|
|
25686
|
-
return this.match(
|
|
25670
|
+
return this.match(10);
|
|
25687
25671
|
}
|
|
25688
25672
|
|
|
25689
25673
|
return false;
|
|
@@ -25699,7 +25683,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25699
25683
|
|
|
25700
25684
|
id.typeAnnotation = this.tsParseTypeAnnotation();
|
|
25701
25685
|
this.resetEndLocation(id);
|
|
25702
|
-
this.expect(
|
|
25686
|
+
this.expect(1);
|
|
25703
25687
|
node.parameters = [id];
|
|
25704
25688
|
const type = this.tsTryParseTypeAnnotation();
|
|
25705
25689
|
|
|
@@ -25711,38 +25695,36 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25711
25695
|
}
|
|
25712
25696
|
|
|
25713
25697
|
tsParsePropertyOrMethodSignature(node, readonly) {
|
|
25714
|
-
if (this.eat(
|
|
25698
|
+
if (this.eat(13))
|
|
25715
25699
|
node.optional = true;
|
|
25716
25700
|
|
|
25717
|
-
if (this.match(
|
|
25701
|
+
if (this.match(6) || this.match(43)) {
|
|
25718
25702
|
if (readonly) {
|
|
25719
25703
|
this.raise(TSErrors.ReadonlyForMethodSignature, node);
|
|
25720
25704
|
}
|
|
25721
25705
|
|
|
25722
25706
|
const method = node;
|
|
25723
25707
|
|
|
25724
|
-
if (method.kind && this.match(
|
|
25708
|
+
if (method.kind && this.match(43)) {
|
|
25725
25709
|
this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition());
|
|
25726
25710
|
}
|
|
25727
25711
|
|
|
25728
|
-
this.tsFillSignature(
|
|
25712
|
+
this.tsFillSignature(10, method);
|
|
25729
25713
|
this.tsParseTypeMemberSemicolon();
|
|
25730
|
-
const paramsKey = 'params';
|
|
25731
|
-
const returnTypeKey = 'returnType';
|
|
25732
25714
|
|
|
25733
25715
|
if (method.kind === 'get') {
|
|
25734
|
-
if (method
|
|
25716
|
+
if (method.params.length > 0) {
|
|
25735
25717
|
this.raise(Errors.BadGetterArity, this.state.curPosition());
|
|
25736
25718
|
|
|
25737
|
-
if (this.isThisParam(method[
|
|
25719
|
+
if (this.isThisParam(method.params[0])) {
|
|
25738
25720
|
this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition());
|
|
25739
25721
|
}
|
|
25740
25722
|
}
|
|
25741
25723
|
} else if (method.kind === 'set') {
|
|
25742
|
-
if (method
|
|
25724
|
+
if (method.params.length !== 1) {
|
|
25743
25725
|
this.raise(Errors.BadSetterArity, this.state.curPosition());
|
|
25744
25726
|
} else {
|
|
25745
|
-
const firstParameter = method[
|
|
25727
|
+
const firstParameter = method.params[0];
|
|
25746
25728
|
|
|
25747
25729
|
if (this.isThisParam(firstParameter)) {
|
|
25748
25730
|
this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition());
|
|
@@ -25757,8 +25739,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25757
25739
|
}
|
|
25758
25740
|
}
|
|
25759
25741
|
|
|
25760
|
-
if (method
|
|
25761
|
-
this.raise(TSErrors.SetAccessorCannotHaveReturnType, method
|
|
25742
|
+
if (method.returnType) {
|
|
25743
|
+
this.raise(TSErrors.SetAccessorCannotHaveReturnType, method.returnType);
|
|
25762
25744
|
}
|
|
25763
25745
|
} else {
|
|
25764
25746
|
method.kind = 'method';
|
|
@@ -25784,15 +25766,15 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25784
25766
|
tsParseTypeMember() {
|
|
25785
25767
|
const node = this.startNode();
|
|
25786
25768
|
|
|
25787
|
-
if (this.match(
|
|
25769
|
+
if (this.match(6) || this.match(43)) {
|
|
25788
25770
|
return this.tsParseSignatureMember('TSCallSignatureDeclaration', node);
|
|
25789
25771
|
}
|
|
25790
25772
|
|
|
25791
|
-
if (this.match(
|
|
25773
|
+
if (this.match(73)) {
|
|
25792
25774
|
const id = this.startNode();
|
|
25793
25775
|
this.next();
|
|
25794
25776
|
|
|
25795
|
-
if (this.match(
|
|
25777
|
+
if (this.match(6) || this.match(43)) {
|
|
25796
25778
|
return this.tsParseSignatureMember('TSConstructSignatureDeclaration', node);
|
|
25797
25779
|
} else {
|
|
25798
25780
|
node.key = this.createIdentifier(id, 'new');
|
|
@@ -25824,8 +25806,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25824
25806
|
node.kind = node.key.name;
|
|
25825
25807
|
super.parsePropertyName(node);
|
|
25826
25808
|
|
|
25827
|
-
if (!this.match(
|
|
25828
|
-
this.unexpected(null,
|
|
25809
|
+
if (!this.match(6) && !this.match(43)) {
|
|
25810
|
+
this.unexpected(null, 6);
|
|
25829
25811
|
}
|
|
25830
25812
|
}
|
|
25831
25813
|
|
|
@@ -25840,20 +25822,20 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25840
25822
|
}
|
|
25841
25823
|
|
|
25842
25824
|
tsParseObjectTypeMembers() {
|
|
25843
|
-
this.expect(
|
|
25825
|
+
this.expect(2);
|
|
25844
25826
|
const members = this.tsParseList('TypeMembers', this.tsParseTypeMember.bind(this));
|
|
25845
|
-
this.expect(
|
|
25827
|
+
this.expect(4);
|
|
25846
25828
|
return members;
|
|
25847
25829
|
}
|
|
25848
25830
|
|
|
25849
25831
|
tsIsStartOfMappedType() {
|
|
25850
25832
|
this.next();
|
|
25851
25833
|
|
|
25852
|
-
if (this.eat(
|
|
25853
|
-
return this.isContextual(
|
|
25834
|
+
if (this.eat(49)) {
|
|
25835
|
+
return this.isContextual(118);
|
|
25854
25836
|
}
|
|
25855
25837
|
|
|
25856
|
-
if (this.isContextual(
|
|
25838
|
+
if (this.isContextual(118)) {
|
|
25857
25839
|
this.next();
|
|
25858
25840
|
}
|
|
25859
25841
|
|
|
@@ -25868,38 +25850,38 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25868
25850
|
}
|
|
25869
25851
|
|
|
25870
25852
|
this.next();
|
|
25871
|
-
return this.match(
|
|
25853
|
+
return this.match(54);
|
|
25872
25854
|
}
|
|
25873
25855
|
|
|
25874
25856
|
tsParseMappedType() {
|
|
25875
25857
|
const node = this.startNode();
|
|
25876
|
-
this.expect(
|
|
25858
|
+
this.expect(2);
|
|
25877
25859
|
|
|
25878
|
-
if (this.match(
|
|
25860
|
+
if (this.match(49)) {
|
|
25879
25861
|
node.readonly = this.state.value;
|
|
25880
25862
|
this.next();
|
|
25881
|
-
this.expectContextual(
|
|
25882
|
-
} else if (this.eatContextual(
|
|
25863
|
+
this.expectContextual(118);
|
|
25864
|
+
} else if (this.eatContextual(118)) {
|
|
25883
25865
|
node.readonly = true;
|
|
25884
25866
|
}
|
|
25885
25867
|
|
|
25886
25868
|
this.expect(0);
|
|
25887
25869
|
node.key = this.tsParseTypeParameterName();
|
|
25888
|
-
node.constraint = this.tsExpectThenParseType(
|
|
25889
|
-
node.nameType = this.eatContextual(
|
|
25890
|
-
this.expect(
|
|
25870
|
+
node.constraint = this.tsExpectThenParseType(54);
|
|
25871
|
+
node.nameType = this.eatContextual(89) ? this.tsParseType() : null;
|
|
25872
|
+
this.expect(1);
|
|
25891
25873
|
|
|
25892
|
-
if (this.match(
|
|
25874
|
+
if (this.match(49)) {
|
|
25893
25875
|
node.optional = this.state.value;
|
|
25894
25876
|
this.next();
|
|
25895
|
-
this.expect(
|
|
25896
|
-
} else if (this.eat(
|
|
25877
|
+
this.expect(13);
|
|
25878
|
+
} else if (this.eat(13)) {
|
|
25897
25879
|
node.optional = true;
|
|
25898
25880
|
}
|
|
25899
25881
|
|
|
25900
25882
|
node.typeAnnotation = this.tsTryParseType();
|
|
25901
25883
|
this.semicolon();
|
|
25902
|
-
this.expect(
|
|
25884
|
+
this.expect(4);
|
|
25903
25885
|
return this.finishNode(node, 'TSMappedType');
|
|
25904
25886
|
}
|
|
25905
25887
|
|
|
@@ -25923,7 +25905,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25923
25905
|
|
|
25924
25906
|
tsParseTupleElementType() {
|
|
25925
25907
|
const restStartLoc = this.state.startLoc;
|
|
25926
|
-
const rest = this.eat(
|
|
25908
|
+
const rest = this.eat(17);
|
|
25927
25909
|
const {startLoc} = this.state;
|
|
25928
25910
|
|
|
25929
25911
|
let labeled;
|
|
@@ -25937,7 +25919,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25937
25919
|
labeled = true;
|
|
25938
25920
|
optional = false;
|
|
25939
25921
|
label = this.parseIdentifier(true);
|
|
25940
|
-
this.expect(
|
|
25922
|
+
this.expect(10);
|
|
25941
25923
|
type = this.tsParseType();
|
|
25942
25924
|
} else if (chAfterWord === 63) {
|
|
25943
25925
|
optional = true;
|
|
@@ -25947,18 +25929,18 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25947
25929
|
if (this.lookaheadCharCode() === 58) {
|
|
25948
25930
|
labeled = true;
|
|
25949
25931
|
label = this.createIdentifier(this.startNodeAt(startLoc), wordName);
|
|
25950
|
-
this.expect(
|
|
25951
|
-
this.expect(
|
|
25932
|
+
this.expect(13);
|
|
25933
|
+
this.expect(10);
|
|
25952
25934
|
type = this.tsParseType();
|
|
25953
25935
|
} else {
|
|
25954
25936
|
labeled = false;
|
|
25955
25937
|
type = typeOrLabel;
|
|
25956
|
-
this.expect(
|
|
25938
|
+
this.expect(13);
|
|
25957
25939
|
}
|
|
25958
25940
|
} else {
|
|
25959
25941
|
type = this.tsParseType();
|
|
25960
|
-
optional = this.eat(
|
|
25961
|
-
labeled = this.eat(
|
|
25942
|
+
optional = this.eat(13);
|
|
25943
|
+
labeled = this.eat(10);
|
|
25962
25944
|
}
|
|
25963
25945
|
|
|
25964
25946
|
if (labeled) {
|
|
@@ -25970,7 +25952,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25970
25952
|
labeledNode.label = label;
|
|
25971
25953
|
labeledNode.elementType = type;
|
|
25972
25954
|
|
|
25973
|
-
if (this.eat(
|
|
25955
|
+
if (this.eat(13)) {
|
|
25974
25956
|
labeledNode.optional = true;
|
|
25975
25957
|
this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc);
|
|
25976
25958
|
}
|
|
@@ -26002,9 +25984,9 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26002
25984
|
|
|
26003
25985
|
tsParseParenthesizedType() {
|
|
26004
25986
|
const node = this.startNode();
|
|
26005
|
-
this.expect(
|
|
25987
|
+
this.expect(6);
|
|
26006
25988
|
node.typeAnnotation = this.tsParseType();
|
|
26007
|
-
this.expect(
|
|
25989
|
+
this.expect(7);
|
|
26008
25990
|
return this.finishNode(node, 'TSParenthesizedType');
|
|
26009
25991
|
}
|
|
26010
25992
|
|
|
@@ -26020,7 +26002,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26020
26002
|
this.next();
|
|
26021
26003
|
}
|
|
26022
26004
|
|
|
26023
|
-
this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(
|
|
26005
|
+
this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(15, node));
|
|
26024
26006
|
return this.finishNode(node, type);
|
|
26025
26007
|
}
|
|
26026
26008
|
|
|
@@ -26028,11 +26010,11 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26028
26010
|
const node = this.startNode();
|
|
26029
26011
|
|
|
26030
26012
|
switch(this.state.type) {
|
|
26031
|
-
case
|
|
26032
|
-
case
|
|
26033
|
-
case
|
|
26034
|
-
case
|
|
26035
|
-
case
|
|
26013
|
+
case 131:
|
|
26014
|
+
case 132:
|
|
26015
|
+
case 130:
|
|
26016
|
+
case 81:
|
|
26017
|
+
case 82:
|
|
26036
26018
|
node.literal = super.parseExprAtom();
|
|
26037
26019
|
break;
|
|
26038
26020
|
|
|
@@ -26084,7 +26066,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26084
26066
|
tsParseThisTypeOrThisTypePredicate() {
|
|
26085
26067
|
const thisKeyword = this.tsParseThisTypeNode();
|
|
26086
26068
|
|
|
26087
|
-
if (this.isContextual(
|
|
26069
|
+
if (this.isContextual(112) && !this.hasPrecedingLineBreak()) {
|
|
26088
26070
|
return this.tsParseThisTypePredicate(thisKeyword);
|
|
26089
26071
|
} else {
|
|
26090
26072
|
return thisKeyword;
|
|
@@ -26093,19 +26075,19 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26093
26075
|
|
|
26094
26076
|
tsParseNonArrayType() {
|
|
26095
26077
|
switch(this.state.type) {
|
|
26096
|
-
case
|
|
26097
|
-
case
|
|
26098
|
-
case
|
|
26099
|
-
case
|
|
26100
|
-
case
|
|
26078
|
+
case 130:
|
|
26079
|
+
case 131:
|
|
26080
|
+
case 132:
|
|
26081
|
+
case 81:
|
|
26082
|
+
case 82:
|
|
26101
26083
|
return this.tsParseLiteralTypeNode();
|
|
26102
26084
|
|
|
26103
|
-
case
|
|
26085
|
+
case 49:
|
|
26104
26086
|
if (this.state.value === '-') {
|
|
26105
26087
|
const node = this.startNode();
|
|
26106
26088
|
const nextToken = this.lookahead();
|
|
26107
26089
|
|
|
26108
|
-
if (nextToken.type !==
|
|
26090
|
+
if (nextToken.type !== 131 && nextToken.type !== 132) {
|
|
26109
26091
|
this.unexpected();
|
|
26110
26092
|
}
|
|
26111
26093
|
|
|
@@ -26115,27 +26097,27 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26115
26097
|
|
|
26116
26098
|
break;
|
|
26117
26099
|
|
|
26118
|
-
case
|
|
26100
|
+
case 74:
|
|
26119
26101
|
return this.tsParseThisTypeOrThisTypePredicate();
|
|
26120
26102
|
|
|
26121
|
-
case
|
|
26103
|
+
case 83:
|
|
26122
26104
|
return this.tsParseTypeQuery();
|
|
26123
26105
|
|
|
26124
|
-
case
|
|
26106
|
+
case 79:
|
|
26125
26107
|
return this.tsParseImportType();
|
|
26126
26108
|
|
|
26127
|
-
case
|
|
26109
|
+
case 2:
|
|
26128
26110
|
return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
|
|
26129
26111
|
|
|
26130
26112
|
case 0:
|
|
26131
26113
|
return this.tsParseTupleType();
|
|
26132
26114
|
|
|
26133
|
-
case
|
|
26115
|
+
case 6:
|
|
26134
26116
|
if (!(this.optionFlags & 1024)) {
|
|
26135
26117
|
const startLoc = this.state.startLoc;
|
|
26136
26118
|
this.next();
|
|
26137
26119
|
const type = this.tsParseType();
|
|
26138
|
-
this.expect(
|
|
26120
|
+
this.expect(7);
|
|
26139
26121
|
this.addExtra(type, 'parenthesized', true);
|
|
26140
26122
|
this.addExtra(type, 'parenStart', startLoc.index);
|
|
26141
26123
|
return type;
|
|
@@ -26143,15 +26125,15 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26143
26125
|
|
|
26144
26126
|
return this.tsParseParenthesizedType();
|
|
26145
26127
|
|
|
26146
|
-
case
|
|
26147
|
-
case
|
|
26128
|
+
case 21:
|
|
26129
|
+
case 20:
|
|
26148
26130
|
return this.tsParseTemplateLiteralType();
|
|
26149
26131
|
|
|
26150
26132
|
default: {
|
|
26151
26133
|
const {type} = this.state;
|
|
26152
26134
|
|
|
26153
|
-
if (tokenIsIdentifier(type) || type ===
|
|
26154
|
-
const nodeType = type ===
|
|
26135
|
+
if (tokenIsIdentifier(type) || type === 84 || type === 80) {
|
|
26136
|
+
const nodeType = type === 84 ? 'TSVoidKeyword' : type === 80 ? 'TSNullKeyword' : keywordTypeFromName(this.state.value);
|
|
26155
26137
|
|
|
26156
26138
|
if (nodeType !== void 0 && this.lookaheadCharCode() !== 46) {
|
|
26157
26139
|
const node = this.startNode();
|
|
@@ -26173,18 +26155,18 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26173
26155
|
let type = this.tsParseNonArrayType();
|
|
26174
26156
|
|
|
26175
26157
|
while (!this.hasPrecedingLineBreak() && this.eat(0)) {
|
|
26176
|
-
if (this.match(
|
|
26158
|
+
if (this.match(1)) {
|
|
26177
26159
|
const node = this.startNodeAt(startLoc);
|
|
26178
26160
|
|
|
26179
26161
|
node.elementType = type;
|
|
26180
|
-
this.expect(
|
|
26162
|
+
this.expect(1);
|
|
26181
26163
|
type = this.finishNode(node, 'TSArrayType');
|
|
26182
26164
|
} else {
|
|
26183
26165
|
const node = this.startNodeAt(startLoc);
|
|
26184
26166
|
|
|
26185
26167
|
node.objectType = type;
|
|
26186
26168
|
node.indexType = this.tsParseType();
|
|
26187
|
-
this.expect(
|
|
26169
|
+
this.expect(1);
|
|
26188
26170
|
type = this.finishNode(node, 'TSIndexedAccessType');
|
|
26189
26171
|
}
|
|
26190
26172
|
}
|
|
@@ -26219,7 +26201,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26219
26201
|
|
|
26220
26202
|
tsParseInferType() {
|
|
26221
26203
|
const node = this.startNode();
|
|
26222
|
-
this.expectContextual(
|
|
26204
|
+
this.expectContextual(111);
|
|
26223
26205
|
const typeParameter2 = this.startNode();
|
|
26224
26206
|
|
|
26225
26207
|
typeParameter2.name = this.tsParseTypeParameterName();
|
|
@@ -26229,10 +26211,10 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26229
26211
|
}
|
|
26230
26212
|
|
|
26231
26213
|
tsParseConstraintForInferType() {
|
|
26232
|
-
if (this.eat(
|
|
26214
|
+
if (this.eat(77)) {
|
|
26233
26215
|
const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType());
|
|
26234
26216
|
|
|
26235
|
-
if (this.state.inDisallowConditionalTypesContext || !this.match(
|
|
26217
|
+
if (this.state.inDisallowConditionalTypesContext || !this.match(13)) {
|
|
26236
26218
|
return constraint;
|
|
26237
26219
|
}
|
|
26238
26220
|
}
|
|
@@ -26240,7 +26222,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26240
26222
|
|
|
26241
26223
|
tsParseTypeOperatorOrHigher() {
|
|
26242
26224
|
const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;
|
|
26243
|
-
return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(
|
|
26225
|
+
return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(111) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());
|
|
26244
26226
|
}
|
|
26245
26227
|
|
|
26246
26228
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
@@ -26260,34 +26242,34 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26260
26242
|
}
|
|
26261
26243
|
|
|
26262
26244
|
tsParseIntersectionTypeOrHigher() {
|
|
26263
|
-
return this.tsParseUnionOrIntersectionType('TSIntersectionType', this.tsParseTypeOperatorOrHigher.bind(this),
|
|
26245
|
+
return this.tsParseUnionOrIntersectionType('TSIntersectionType', this.tsParseTypeOperatorOrHigher.bind(this), 41);
|
|
26264
26246
|
}
|
|
26265
26247
|
|
|
26266
26248
|
tsParseUnionTypeOrHigher() {
|
|
26267
|
-
return this.tsParseUnionOrIntersectionType('TSUnionType', this.tsParseIntersectionTypeOrHigher.bind(this),
|
|
26249
|
+
return this.tsParseUnionOrIntersectionType('TSUnionType', this.tsParseIntersectionTypeOrHigher.bind(this), 39);
|
|
26268
26250
|
}
|
|
26269
26251
|
|
|
26270
26252
|
tsIsStartOfFunctionType() {
|
|
26271
|
-
if (this.match(
|
|
26253
|
+
if (this.match(43)) {
|
|
26272
26254
|
return true;
|
|
26273
26255
|
}
|
|
26274
26256
|
|
|
26275
|
-
return this.match(
|
|
26257
|
+
return this.match(6) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
|
|
26276
26258
|
}
|
|
26277
26259
|
|
|
26278
26260
|
tsSkipParameterStart() {
|
|
26279
|
-
if (tokenIsIdentifier(this.state.type) || this.match(
|
|
26261
|
+
if (tokenIsIdentifier(this.state.type) || this.match(74)) {
|
|
26280
26262
|
this.next();
|
|
26281
26263
|
return true;
|
|
26282
26264
|
}
|
|
26283
26265
|
|
|
26284
|
-
if (this.match(
|
|
26266
|
+
if (this.match(2)) {
|
|
26285
26267
|
const {errors} = this.state;
|
|
26286
26268
|
|
|
26287
26269
|
const previousErrorCount = errors.length;
|
|
26288
26270
|
|
|
26289
26271
|
try {
|
|
26290
|
-
this.parseObjectLike(
|
|
26272
|
+
this.parseObjectLike(4, true);
|
|
26291
26273
|
return errors.length === previousErrorCount;
|
|
26292
26274
|
} catch {
|
|
26293
26275
|
return false;
|
|
@@ -26301,7 +26283,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26301
26283
|
const previousErrorCount = errors.length;
|
|
26302
26284
|
|
|
26303
26285
|
try {
|
|
26304
|
-
super.parseBindingList(
|
|
26286
|
+
super.parseBindingList(1, 93, 1);
|
|
26305
26287
|
return errors.length === previousErrorCount;
|
|
26306
26288
|
} catch {
|
|
26307
26289
|
return false;
|
|
@@ -26314,19 +26296,19 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26314
26296
|
tsIsUnambiguouslyStartOfFunctionType() {
|
|
26315
26297
|
this.next();
|
|
26316
26298
|
|
|
26317
|
-
if (this.match(
|
|
26299
|
+
if (this.match(7) || this.match(17)) {
|
|
26318
26300
|
return true;
|
|
26319
26301
|
}
|
|
26320
26302
|
|
|
26321
26303
|
if (this.tsSkipParameterStart()) {
|
|
26322
|
-
if (this.match(
|
|
26304
|
+
if (this.match(10) || this.match(8) || this.match(13) || this.match(25)) {
|
|
26323
26305
|
return true;
|
|
26324
26306
|
}
|
|
26325
26307
|
|
|
26326
|
-
if (this.match(
|
|
26308
|
+
if (this.match(7)) {
|
|
26327
26309
|
this.next();
|
|
26328
26310
|
|
|
26329
|
-
if (this.match(
|
|
26311
|
+
if (this.match(15)) {
|
|
26330
26312
|
return true;
|
|
26331
26313
|
}
|
|
26332
26314
|
}
|
|
@@ -26342,7 +26324,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26342
26324
|
const node = this.startNode();
|
|
26343
26325
|
const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
|
|
26344
26326
|
|
|
26345
|
-
if (asserts && this.match(
|
|
26327
|
+
if (asserts && this.match(74)) {
|
|
26346
26328
|
let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
|
|
26347
26329
|
|
|
26348
26330
|
if (thisTypePredicate.type === 'TSThisType') {
|
|
@@ -26384,39 +26366,39 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26384
26366
|
}
|
|
26385
26367
|
|
|
26386
26368
|
tsTryParseTypeOrTypePredicateAnnotation() {
|
|
26387
|
-
if (this.match(
|
|
26388
|
-
return this.tsParseTypeOrTypePredicateAnnotation(
|
|
26369
|
+
if (this.match(10)) {
|
|
26370
|
+
return this.tsParseTypeOrTypePredicateAnnotation(10);
|
|
26389
26371
|
}
|
|
26390
26372
|
}
|
|
26391
26373
|
|
|
26392
26374
|
tsTryParseTypeAnnotation() {
|
|
26393
|
-
if (this.match(
|
|
26375
|
+
if (this.match(10)) {
|
|
26394
26376
|
return this.tsParseTypeAnnotation();
|
|
26395
26377
|
}
|
|
26396
26378
|
}
|
|
26397
26379
|
|
|
26398
26380
|
tsTryParseType() {
|
|
26399
|
-
return this.tsEatThenParseType(
|
|
26381
|
+
return this.tsEatThenParseType(10);
|
|
26400
26382
|
}
|
|
26401
26383
|
|
|
26402
26384
|
tsParseTypePredicatePrefix() {
|
|
26403
26385
|
const id = this.parseIdentifier();
|
|
26404
26386
|
|
|
26405
|
-
if (this.isContextual(
|
|
26387
|
+
if (this.isContextual(112) && !this.hasPrecedingLineBreak()) {
|
|
26406
26388
|
this.next();
|
|
26407
26389
|
return id;
|
|
26408
26390
|
}
|
|
26409
26391
|
}
|
|
26410
26392
|
|
|
26411
26393
|
tsParseTypePredicateAsserts() {
|
|
26412
|
-
if (this.state.type !==
|
|
26394
|
+
if (this.state.type !== 105) {
|
|
26413
26395
|
return false;
|
|
26414
26396
|
}
|
|
26415
26397
|
|
|
26416
26398
|
const containsEsc = this.state.containsEsc;
|
|
26417
26399
|
this.next();
|
|
26418
26400
|
|
|
26419
|
-
if (!tokenIsIdentifier(this.state.type) && !this.match(
|
|
26401
|
+
if (!tokenIsIdentifier(this.state.type) && !this.match(74)) {
|
|
26420
26402
|
return false;
|
|
26421
26403
|
}
|
|
26422
26404
|
|
|
@@ -26432,7 +26414,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26432
26414
|
tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {
|
|
26433
26415
|
this.tsInType(() => {
|
|
26434
26416
|
if (eatColon)
|
|
26435
|
-
this.expect(
|
|
26417
|
+
this.expect(10);
|
|
26436
26418
|
|
|
26437
26419
|
t.typeAnnotation = this.tsParseType();
|
|
26438
26420
|
});
|
|
@@ -26443,7 +26425,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26443
26425
|
assert2(this.state.inType);
|
|
26444
26426
|
const type = this.tsParseNonConditionalType();
|
|
26445
26427
|
|
|
26446
|
-
if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(
|
|
26428
|
+
if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(77)) {
|
|
26447
26429
|
return type;
|
|
26448
26430
|
}
|
|
26449
26431
|
|
|
@@ -26451,15 +26433,15 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26451
26433
|
|
|
26452
26434
|
node.checkType = type;
|
|
26453
26435
|
node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType());
|
|
26454
|
-
this.expect(
|
|
26436
|
+
this.expect(13);
|
|
26455
26437
|
node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());
|
|
26456
|
-
this.expect(
|
|
26438
|
+
this.expect(10);
|
|
26457
26439
|
node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType());
|
|
26458
26440
|
return this.finishNode(node, 'TSConditionalType');
|
|
26459
26441
|
}
|
|
26460
26442
|
|
|
26461
26443
|
isAbstractConstructorSignature() {
|
|
26462
|
-
return this.isContextual(
|
|
26444
|
+
return this.isContextual(120) && this.isLookaheadContextual('new');
|
|
26463
26445
|
}
|
|
26464
26446
|
|
|
26465
26447
|
tsParseNonConditionalType() {
|
|
@@ -26467,7 +26449,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26467
26449
|
return this.tsParseFunctionOrConstructorType('TSFunctionType');
|
|
26468
26450
|
}
|
|
26469
26451
|
|
|
26470
|
-
if (this.match(
|
|
26452
|
+
if (this.match(73)) {
|
|
26471
26453
|
return this.tsParseFunctionOrConstructorType('TSConstructorType');
|
|
26472
26454
|
} else if (this.isAbstractConstructorSignature()) {
|
|
26473
26455
|
return this.tsParseFunctionOrConstructorType('TSConstructorType', true);
|
|
@@ -26485,9 +26467,9 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26485
26467
|
|
|
26486
26468
|
node.typeAnnotation = this.tsInType(() => {
|
|
26487
26469
|
this.next();
|
|
26488
|
-
return this.match(
|
|
26470
|
+
return this.match(71) ? this.tsParseTypeReference() : this.tsParseType();
|
|
26489
26471
|
});
|
|
26490
|
-
this.expect(
|
|
26472
|
+
this.expect(44);
|
|
26491
26473
|
node.expression = this.parseMaybeUnary();
|
|
26492
26474
|
return this.finishNode(node, 'TSTypeAssertion');
|
|
26493
26475
|
}
|
|
@@ -26514,7 +26496,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26514
26496
|
|
|
26515
26497
|
node.expression = expression2;
|
|
26516
26498
|
|
|
26517
|
-
if (this.match(
|
|
26499
|
+
if (this.match(43) || this.match(47)) {
|
|
26518
26500
|
node.typeArguments = this.tsParseTypeArgumentsInExpression();
|
|
26519
26501
|
}
|
|
26520
26502
|
|
|
@@ -26534,7 +26516,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26534
26516
|
if (this.hasFollowingLineBreak())
|
|
26535
26517
|
return null;
|
|
26536
26518
|
|
|
26537
|
-
this.expectContextual(
|
|
26519
|
+
this.expectContextual(125);
|
|
26538
26520
|
|
|
26539
26521
|
if (properties.declare)
|
|
26540
26522
|
node.declare = true;
|
|
@@ -26549,7 +26531,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26549
26531
|
|
|
26550
26532
|
node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);
|
|
26551
26533
|
|
|
26552
|
-
if (this.eat(
|
|
26534
|
+
if (this.eat(77)) {
|
|
26553
26535
|
node.extends = this.tsParseHeritageClause('extends');
|
|
26554
26536
|
}
|
|
26555
26537
|
|
|
@@ -26565,9 +26547,9 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26565
26547
|
this.checkIdentifier(node.id, 2);
|
|
26566
26548
|
node.typeAnnotation = this.tsInType(() => {
|
|
26567
26549
|
node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers);
|
|
26568
|
-
this.expect(
|
|
26550
|
+
this.expect(25);
|
|
26569
26551
|
|
|
26570
|
-
if (this.isContextual(
|
|
26552
|
+
if (this.isContextual(110) && this.lookaheadCharCode() !== 46) {
|
|
26571
26553
|
const node2 = this.startNode();
|
|
26572
26554
|
this.next();
|
|
26573
26555
|
return this.finishNode(node2, 'TSIntrinsicKeyword');
|
|
@@ -26650,9 +26632,9 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26650
26632
|
tsParseEnumMember() {
|
|
26651
26633
|
const node = this.startNode();
|
|
26652
26634
|
|
|
26653
|
-
node.id = this.match(
|
|
26635
|
+
node.id = this.match(130) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);
|
|
26654
26636
|
|
|
26655
|
-
if (this.eat(
|
|
26637
|
+
if (this.eat(25)) {
|
|
26656
26638
|
node.initializer = super.parseMaybeAssignAllowIn();
|
|
26657
26639
|
}
|
|
26658
26640
|
|
|
@@ -26666,7 +26648,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26666
26648
|
if (properties.declare)
|
|
26667
26649
|
node.declare = true;
|
|
26668
26650
|
|
|
26669
|
-
this.expectContextual(
|
|
26651
|
+
this.expectContextual(122);
|
|
26670
26652
|
node.id = this.parseIdentifier();
|
|
26671
26653
|
this.checkIdentifier(node.id, node.const ? 8971 : 8459);
|
|
26672
26654
|
node.body = this.tsParseEnumBody();
|
|
@@ -26675,17 +26657,17 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26675
26657
|
|
|
26676
26658
|
tsParseEnumBody() {
|
|
26677
26659
|
const node = this.startNode();
|
|
26678
|
-
this.expect(
|
|
26660
|
+
this.expect(2);
|
|
26679
26661
|
node.members = this.tsParseDelimitedList('EnumMembers', this.tsParseEnumMember.bind(this));
|
|
26680
|
-
this.expect(
|
|
26662
|
+
this.expect(4);
|
|
26681
26663
|
return this.finishNode(node, 'TSEnumBody');
|
|
26682
26664
|
}
|
|
26683
26665
|
|
|
26684
26666
|
tsParseModuleBlock() {
|
|
26685
26667
|
const node = this.startNode();
|
|
26686
26668
|
this.scope.enter(0);
|
|
26687
|
-
this.expect(
|
|
26688
|
-
super.parseBlockOrModuleBlockBody(node.body = [], void 0, true,
|
|
26669
|
+
this.expect(2);
|
|
26670
|
+
super.parseBlockOrModuleBlockBody(node.body = [], void 0, true, 4);
|
|
26689
26671
|
this.scope.exit();
|
|
26690
26672
|
return this.finishNode(node, 'TSModuleBlock');
|
|
26691
26673
|
}
|
|
@@ -26706,17 +26688,17 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26706
26688
|
}
|
|
26707
26689
|
|
|
26708
26690
|
tsParseAmbientExternalModuleDeclaration(node) {
|
|
26709
|
-
if (this.isContextual(
|
|
26691
|
+
if (this.isContextual(108)) {
|
|
26710
26692
|
node.kind = 'global';
|
|
26711
26693
|
node.id = this.parseIdentifier();
|
|
26712
|
-
} else if (this.match(
|
|
26694
|
+
} else if (this.match(130)) {
|
|
26713
26695
|
node.kind = 'module';
|
|
26714
26696
|
node.id = super.parseStringLiteral(this.state.value);
|
|
26715
26697
|
} else {
|
|
26716
26698
|
this.unexpected();
|
|
26717
26699
|
}
|
|
26718
26700
|
|
|
26719
|
-
if (this.match(
|
|
26701
|
+
if (this.match(2)) {
|
|
26720
26702
|
this.scope.enter(1024);
|
|
26721
26703
|
this.prodParam.enter(0);
|
|
26722
26704
|
node.body = this.tsParseModuleBlock();
|
|
@@ -26732,7 +26714,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26732
26714
|
tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier) {
|
|
26733
26715
|
node.id = maybeDefaultIdentifier || this.parseIdentifier();
|
|
26734
26716
|
this.checkIdentifier(node.id, 4096);
|
|
26735
|
-
this.expect(
|
|
26717
|
+
this.expect(25);
|
|
26736
26718
|
const moduleReference = this.tsParseModuleReference();
|
|
26737
26719
|
|
|
26738
26720
|
if (node.importKind === 'type' && moduleReference.type !== 'TSExternalModuleReference') {
|
|
@@ -26745,7 +26727,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26745
26727
|
}
|
|
26746
26728
|
|
|
26747
26729
|
tsIsExternalModuleReference() {
|
|
26748
|
-
return this.isContextual(
|
|
26730
|
+
return this.isContextual(115) && this.lookaheadCharCode() === 40;
|
|
26749
26731
|
}
|
|
26750
26732
|
|
|
26751
26733
|
tsParseModuleReference() {
|
|
@@ -26754,15 +26736,15 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26754
26736
|
|
|
26755
26737
|
tsParseExternalModuleReference() {
|
|
26756
26738
|
const node = this.startNode();
|
|
26757
|
-
this.expectContextual(
|
|
26758
|
-
this.expect(
|
|
26739
|
+
this.expectContextual(115);
|
|
26740
|
+
this.expect(6);
|
|
26759
26741
|
|
|
26760
|
-
if (!this.match(
|
|
26742
|
+
if (!this.match(130)) {
|
|
26761
26743
|
this.unexpected();
|
|
26762
26744
|
}
|
|
26763
26745
|
|
|
26764
26746
|
node.expression = super.parseExprAtom();
|
|
26765
|
-
this.expect(
|
|
26747
|
+
this.expect(7);
|
|
26766
26748
|
this.sawUnambiguousESM = true;
|
|
26767
26749
|
return this.finishNode(node, 'TSExternalModuleReference');
|
|
26768
26750
|
}
|
|
@@ -26807,41 +26789,41 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26807
26789
|
|
|
26808
26790
|
return this.tsInAmbientContext(() => {
|
|
26809
26791
|
switch(startType) {
|
|
26810
|
-
case
|
|
26792
|
+
case 64:
|
|
26811
26793
|
node.declare = true;
|
|
26812
26794
|
return super.parseFunctionStatement(node, false, false);
|
|
26813
26795
|
|
|
26814
|
-
case
|
|
26796
|
+
case 76:
|
|
26815
26797
|
node.declare = true;
|
|
26816
26798
|
return this.parseClass(node, true, false);
|
|
26817
26799
|
|
|
26818
|
-
case
|
|
26800
|
+
case 122:
|
|
26819
26801
|
return this.tsParseEnumDeclaration(node, {
|
|
26820
26802
|
declare: true,
|
|
26821
26803
|
});
|
|
26822
26804
|
|
|
26823
|
-
case
|
|
26805
|
+
case 108:
|
|
26824
26806
|
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
26825
26807
|
|
|
26826
|
-
case
|
|
26808
|
+
case 96:
|
|
26827
26809
|
if (this.state.containsEsc) {
|
|
26828
26810
|
return;
|
|
26829
26811
|
}
|
|
26830
26812
|
|
|
26831
|
-
case
|
|
26832
|
-
case
|
|
26833
|
-
if (!this.match(
|
|
26813
|
+
case 71:
|
|
26814
|
+
case 70:
|
|
26815
|
+
if (!this.match(71) || !this.isLookaheadContextual('enum')) {
|
|
26834
26816
|
node.declare = true;
|
|
26835
26817
|
return this.parseVarStatement(node, this.state.value, true);
|
|
26836
26818
|
}
|
|
26837
26819
|
|
|
26838
|
-
this.expect(
|
|
26820
|
+
this.expect(71);
|
|
26839
26821
|
return this.tsParseEnumDeclaration(node, {
|
|
26840
26822
|
const: true,
|
|
26841
26823
|
declare: true,
|
|
26842
26824
|
});
|
|
26843
26825
|
|
|
26844
|
-
case
|
|
26826
|
+
case 103:
|
|
26845
26827
|
if (this.isUsing()) {
|
|
26846
26828
|
this.raise(TSErrors.InvalidModifierOnUsingDeclaration, this.state.startLoc, 'declare');
|
|
26847
26829
|
node.declare = true;
|
|
@@ -26850,7 +26832,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26850
26832
|
|
|
26851
26833
|
break;
|
|
26852
26834
|
|
|
26853
|
-
case
|
|
26835
|
+
case 92:
|
|
26854
26836
|
if (this.isAwaitUsing()) {
|
|
26855
26837
|
this.raise(TSErrors.InvalidModifierOnAwaitUsingDeclaration, this.state.startLoc, 'declare');
|
|
26856
26838
|
node.declare = true;
|
|
@@ -26860,7 +26842,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26860
26842
|
|
|
26861
26843
|
break;
|
|
26862
26844
|
|
|
26863
|
-
case
|
|
26845
|
+
case 125: {
|
|
26864
26846
|
const result = this.tsParseInterfaceDeclaration(node, {
|
|
26865
26847
|
declare: true,
|
|
26866
26848
|
});
|
|
@@ -26883,16 +26865,16 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26883
26865
|
|
|
26884
26866
|
tsParseDeclaration(node, type, next, decorators) {
|
|
26885
26867
|
switch(type) {
|
|
26886
|
-
case
|
|
26887
|
-
if (this.tsCheckLineTerminator(next) && (this.match(
|
|
26868
|
+
case 120:
|
|
26869
|
+
if (this.tsCheckLineTerminator(next) && (this.match(76) || tokenIsIdentifier(this.state.type))) {
|
|
26888
26870
|
return this.tsParseAbstractDeclaration(node, decorators);
|
|
26889
26871
|
}
|
|
26890
26872
|
|
|
26891
26873
|
break;
|
|
26892
26874
|
|
|
26893
|
-
case
|
|
26875
|
+
case 123:
|
|
26894
26876
|
if (this.tsCheckLineTerminator(next)) {
|
|
26895
|
-
if (this.match(
|
|
26877
|
+
if (this.match(130)) {
|
|
26896
26878
|
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
26897
26879
|
} else if (tokenIsIdentifier(this.state.type)) {
|
|
26898
26880
|
node.kind = 'module';
|
|
@@ -26902,7 +26884,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26902
26884
|
|
|
26903
26885
|
break;
|
|
26904
26886
|
|
|
26905
|
-
case
|
|
26887
|
+
case 124:
|
|
26906
26888
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
|
|
26907
26889
|
node.kind = 'namespace';
|
|
26908
26890
|
return this.tsParseModuleOrNamespaceDeclaration(node);
|
|
@@ -26910,7 +26892,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26910
26892
|
|
|
26911
26893
|
break;
|
|
26912
26894
|
|
|
26913
|
-
case
|
|
26895
|
+
case 126:
|
|
26914
26896
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
|
|
26915
26897
|
return this.tsParseTypeAliasDeclaration(node);
|
|
26916
26898
|
}
|
|
@@ -26932,7 +26914,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26932
26914
|
}
|
|
26933
26915
|
|
|
26934
26916
|
tsTryParseGenericAsyncArrowFunction(startLoc) {
|
|
26935
|
-
if (!this.match(
|
|
26917
|
+
if (!this.match(43))
|
|
26936
26918
|
return;
|
|
26937
26919
|
|
|
26938
26920
|
const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
|
|
@@ -26944,7 +26926,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26944
26926
|
node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier);
|
|
26945
26927
|
super.parseFunctionParams(node);
|
|
26946
26928
|
node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();
|
|
26947
|
-
this.expect(
|
|
26929
|
+
this.expect(15);
|
|
26948
26930
|
return node;
|
|
26949
26931
|
});
|
|
26950
26932
|
|
|
@@ -26957,7 +26939,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26957
26939
|
}
|
|
26958
26940
|
|
|
26959
26941
|
tsParseTypeArgumentsInExpression() {
|
|
26960
|
-
if (this.reScan_lt() !==
|
|
26942
|
+
if (this.reScan_lt() !== 43)
|
|
26961
26943
|
return;
|
|
26962
26944
|
|
|
26963
26945
|
return this.tsParseTypeArguments();
|
|
@@ -26967,7 +26949,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26967
26949
|
const node = this.startNode();
|
|
26968
26950
|
|
|
26969
26951
|
node.params = this.tsInType(() => this.tsInTopLevelContext(() => {
|
|
26970
|
-
this.expect(
|
|
26952
|
+
this.expect(43);
|
|
26971
26953
|
return this.tsParseDelimitedList('TypeParametersOrArguments', this.tsParseType.bind(this));
|
|
26972
26954
|
}));
|
|
26973
26955
|
|
|
@@ -26977,7 +26959,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26977
26959
|
this.reScan_lt_gt();
|
|
26978
26960
|
}
|
|
26979
26961
|
|
|
26980
|
-
this.expect(
|
|
26962
|
+
this.expect(44);
|
|
26981
26963
|
return this.finishNode(node, 'TSTypeParameterInstantiation');
|
|
26982
26964
|
}
|
|
26983
26965
|
|
|
@@ -27070,13 +27052,13 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27070
27052
|
}
|
|
27071
27053
|
|
|
27072
27054
|
parseFunctionBodyAndFinish(node, type, isMethod3 = false) {
|
|
27073
|
-
if (this.match(
|
|
27074
|
-
node.returnType = this.tsParseTypeOrTypePredicateAnnotation(
|
|
27055
|
+
if (this.match(10)) {
|
|
27056
|
+
node.returnType = this.tsParseTypeOrTypePredicateAnnotation(10);
|
|
27075
27057
|
}
|
|
27076
27058
|
|
|
27077
27059
|
const bodilessType = type === 'FunctionDeclaration' ? 'TSDeclareFunction' : type === 'ClassMethod' || type === 'ClassPrivateMethod' ? 'TSDeclareMethod' : void 0;
|
|
27078
27060
|
|
|
27079
|
-
if (bodilessType && !this.match(
|
|
27061
|
+
if (bodilessType && !this.match(2) && this.isLineTerminator()) {
|
|
27080
27062
|
return this.finishNode(node, bodilessType);
|
|
27081
27063
|
}
|
|
27082
27064
|
|
|
@@ -27124,7 +27106,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27124
27106
|
}
|
|
27125
27107
|
|
|
27126
27108
|
parseSubscript(base, startLoc, noCalls, state) {
|
|
27127
|
-
if (!this.hasPrecedingLineBreak() && this.match(
|
|
27109
|
+
if (!this.hasPrecedingLineBreak() && this.match(31)) {
|
|
27128
27110
|
this.state.canStartJSXElement = false;
|
|
27129
27111
|
this.next();
|
|
27130
27112
|
const nonNullExpression = this.startNodeAt(startLoc);
|
|
@@ -27135,7 +27117,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27135
27117
|
|
|
27136
27118
|
let isOptionalCall = false;
|
|
27137
27119
|
|
|
27138
|
-
if (this.match(
|
|
27120
|
+
if (this.match(14) && this.lookaheadCharCode() === 60) {
|
|
27139
27121
|
if (noCalls) {
|
|
27140
27122
|
state.stop = true;
|
|
27141
27123
|
return base;
|
|
@@ -27146,7 +27128,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27146
27128
|
this.next();
|
|
27147
27129
|
}
|
|
27148
27130
|
|
|
27149
|
-
if (this.match(
|
|
27131
|
+
if (this.match(43) || this.match(47)) {
|
|
27150
27132
|
let missingParenErrorLoc;
|
|
27151
27133
|
const result = this.tsTryParseAndCatch(() => {
|
|
27152
27134
|
if (!noCalls && this.atPossibleAsyncArrow(base)) {
|
|
@@ -27163,7 +27145,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27163
27145
|
if (!typeArguments)
|
|
27164
27146
|
return;
|
|
27165
27147
|
|
|
27166
|
-
if (isOptionalCall && !this.match(
|
|
27148
|
+
if (isOptionalCall && !this.match(6)) {
|
|
27167
27149
|
missingParenErrorLoc = this.state.curPosition();
|
|
27168
27150
|
return;
|
|
27169
27151
|
}
|
|
@@ -27175,7 +27157,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27175
27157
|
return result2;
|
|
27176
27158
|
}
|
|
27177
27159
|
|
|
27178
|
-
if (!noCalls && this.eat(
|
|
27160
|
+
if (!noCalls && this.eat(6)) {
|
|
27179
27161
|
const node2 = this.startNodeAt(startLoc);
|
|
27180
27162
|
|
|
27181
27163
|
node2.callee = base;
|
|
@@ -27192,7 +27174,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27192
27174
|
|
|
27193
27175
|
const tokenType = this.state.type;
|
|
27194
27176
|
|
|
27195
|
-
if (tokenType ===
|
|
27177
|
+
if (tokenType === 44 || tokenType === 48 || tokenType !== 6 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
|
|
27196
27178
|
return;
|
|
27197
27179
|
}
|
|
27198
27180
|
|
|
@@ -27204,16 +27186,16 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27204
27186
|
});
|
|
27205
27187
|
|
|
27206
27188
|
if (missingParenErrorLoc) {
|
|
27207
|
-
this.unexpected(missingParenErrorLoc,
|
|
27189
|
+
this.unexpected(missingParenErrorLoc, 6);
|
|
27208
27190
|
}
|
|
27209
27191
|
|
|
27210
27192
|
if (result) {
|
|
27211
27193
|
if (result.type === 'TSInstantiationExpression') {
|
|
27212
|
-
if (this.match(
|
|
27194
|
+
if (this.match(12) || this.match(14) && this.lookaheadCharCode() !== 40) {
|
|
27213
27195
|
this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc);
|
|
27214
27196
|
}
|
|
27215
27197
|
|
|
27216
|
-
if (!this.match(
|
|
27198
|
+
if (!this.match(12) && !this.match(14)) {
|
|
27217
27199
|
result.expression = super.stopParseSubscript(base, state);
|
|
27218
27200
|
}
|
|
27219
27201
|
}
|
|
@@ -27238,14 +27220,14 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27238
27220
|
parseExprOp(left, leftStartLoc, minPrec) {
|
|
27239
27221
|
let isSatisfies;
|
|
27240
27222
|
|
|
27241
|
-
if (tokenOperatorPrecedence(
|
|
27223
|
+
if (tokenOperatorPrecedence(54) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(89) || (isSatisfies = this.isContextual(116)))) {
|
|
27242
27224
|
const node = this.startNodeAt(leftStartLoc);
|
|
27243
27225
|
|
|
27244
27226
|
node.expression = left;
|
|
27245
27227
|
node.typeAnnotation = this.tsInType(() => {
|
|
27246
27228
|
this.next();
|
|
27247
27229
|
|
|
27248
|
-
if (this.match(
|
|
27230
|
+
if (this.match(71)) {
|
|
27249
27231
|
if (isSatisfies) {
|
|
27250
27232
|
this.raise(Errors.UnexpectedKeyword, this.state.startLoc, {
|
|
27251
27233
|
keyword: 'const',
|
|
@@ -27277,12 +27259,12 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27277
27259
|
if (super.isPotentialImportPhase(isExport))
|
|
27278
27260
|
return true;
|
|
27279
27261
|
|
|
27280
|
-
if (this.isContextual(
|
|
27262
|
+
if (this.isContextual(126)) {
|
|
27281
27263
|
const ch = this.lookaheadCharCode();
|
|
27282
27264
|
return isExport ? ch === 123 || ch === 42 : ch !== 61;
|
|
27283
27265
|
}
|
|
27284
27266
|
|
|
27285
|
-
return !isExport && this.isContextual(
|
|
27267
|
+
return !isExport && this.isContextual(83);
|
|
27286
27268
|
}
|
|
27287
27269
|
|
|
27288
27270
|
applyImportPhase(node, isExport, phase, loc) {
|
|
@@ -27296,7 +27278,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27296
27278
|
}
|
|
27297
27279
|
|
|
27298
27280
|
parseImport(node) {
|
|
27299
|
-
if (this.match(
|
|
27281
|
+
if (this.match(130)) {
|
|
27300
27282
|
node.importKind = 'value';
|
|
27301
27283
|
return super.parseImport(node);
|
|
27302
27284
|
}
|
|
@@ -27306,7 +27288,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27306
27288
|
if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) {
|
|
27307
27289
|
node.importKind = 'value';
|
|
27308
27290
|
return this.tsParseImportEqualsDeclaration(node);
|
|
27309
|
-
} else if (this.isContextual(
|
|
27291
|
+
} else if (this.isContextual(126)) {
|
|
27310
27292
|
const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false);
|
|
27311
27293
|
|
|
27312
27294
|
if (this.lookaheadCharCode() === 61) {
|
|
@@ -27326,12 +27308,12 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27326
27308
|
}
|
|
27327
27309
|
|
|
27328
27310
|
parseExport(node, decorators) {
|
|
27329
|
-
if (this.match(
|
|
27311
|
+
if (this.match(79)) {
|
|
27330
27312
|
const nodeImportEquals = this.startNode();
|
|
27331
27313
|
this.next();
|
|
27332
27314
|
let maybeDefaultIdentifier = null;
|
|
27333
27315
|
|
|
27334
|
-
if (this.isContextual(
|
|
27316
|
+
if (this.isContextual(126) && this.isPotentialImportPhase(false)) {
|
|
27335
27317
|
maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false);
|
|
27336
27318
|
} else {
|
|
27337
27319
|
nodeImportEquals.importKind = 'value';
|
|
@@ -27345,16 +27327,16 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27345
27327
|
node.source = null;
|
|
27346
27328
|
node.specifiers = [];
|
|
27347
27329
|
return this.finishNode(node, 'ExportNamedDeclaration');
|
|
27348
|
-
} else if (this.eat(
|
|
27330
|
+
} else if (this.eat(25)) {
|
|
27349
27331
|
const assign = node;
|
|
27350
27332
|
|
|
27351
27333
|
assign.expression = super.parseExpression();
|
|
27352
27334
|
this.semicolon();
|
|
27353
27335
|
this.sawUnambiguousESM = true;
|
|
27354
27336
|
return this.finishNode(assign, 'TSExportAssignment');
|
|
27355
|
-
} else if (this.eatContextual(
|
|
27337
|
+
} else if (this.eatContextual(89)) {
|
|
27356
27338
|
const decl = node;
|
|
27357
|
-
this.expectContextual(
|
|
27339
|
+
this.expectContextual(124);
|
|
27358
27340
|
decl.id = this.parseIdentifier();
|
|
27359
27341
|
this.semicolon();
|
|
27360
27342
|
return this.finishNode(decl, 'TSNamespaceExportDeclaration');
|
|
@@ -27365,7 +27347,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27365
27347
|
}
|
|
27366
27348
|
|
|
27367
27349
|
isAbstractClass() {
|
|
27368
|
-
return this.isContextual(
|
|
27350
|
+
return this.isContextual(120) && this.isLookaheadContextual('class');
|
|
27369
27351
|
}
|
|
27370
27352
|
|
|
27371
27353
|
parseExportDefaultExpression() {
|
|
@@ -27376,7 +27358,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27376
27358
|
return this.parseClass(cls, true, true);
|
|
27377
27359
|
}
|
|
27378
27360
|
|
|
27379
|
-
if (this.match(
|
|
27361
|
+
if (this.match(125)) {
|
|
27380
27362
|
const result = this.tsParseInterfaceDeclaration(this.startNode());
|
|
27381
27363
|
|
|
27382
27364
|
if (result)
|
|
@@ -27416,10 +27398,10 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27416
27398
|
parseStatementContent(flags, decorators) {
|
|
27417
27399
|
if (!this.state.containsEsc) {
|
|
27418
27400
|
switch(this.state.type) {
|
|
27419
|
-
case
|
|
27401
|
+
case 71: {
|
|
27420
27402
|
if (this.isLookaheadContextual('enum')) {
|
|
27421
27403
|
const node = this.startNode();
|
|
27422
|
-
this.expect(
|
|
27404
|
+
this.expect(71);
|
|
27423
27405
|
return this.tsParseEnumDeclaration(node, {
|
|
27424
27406
|
const: true,
|
|
27425
27407
|
});
|
|
@@ -27428,22 +27410,22 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27428
27410
|
break;
|
|
27429
27411
|
}
|
|
27430
27412
|
|
|
27431
|
-
case
|
|
27432
|
-
case
|
|
27413
|
+
case 120:
|
|
27414
|
+
case 121: {
|
|
27433
27415
|
if (this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()) {
|
|
27434
27416
|
const token = this.state.type;
|
|
27435
27417
|
const node = this.startNode();
|
|
27436
27418
|
this.next();
|
|
27437
|
-
const declaration = token ===
|
|
27419
|
+
const declaration = token === 121 ? this.tsTryParseDeclare(node) : this.tsParseAbstractDeclaration(node, decorators);
|
|
27438
27420
|
|
|
27439
27421
|
if (declaration) {
|
|
27440
|
-
if (token ===
|
|
27422
|
+
if (token === 121) {
|
|
27441
27423
|
declaration.declare = true;
|
|
27442
27424
|
}
|
|
27443
27425
|
|
|
27444
27426
|
return declaration;
|
|
27445
27427
|
} else {
|
|
27446
|
-
node.expression = this.createIdentifier(this.startNodeAt(node.loc.start), token ===
|
|
27428
|
+
node.expression = this.createIdentifier(this.startNodeAt(node.loc.start), token === 121 ? 'declare' : 'abstract');
|
|
27447
27429
|
this.semicolon(false);
|
|
27448
27430
|
return this.finishNode(node, 'ExpressionStatement');
|
|
27449
27431
|
}
|
|
@@ -27452,10 +27434,10 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27452
27434
|
break;
|
|
27453
27435
|
}
|
|
27454
27436
|
|
|
27455
|
-
case
|
|
27437
|
+
case 122:
|
|
27456
27438
|
return this.tsParseEnumDeclaration(this.startNode());
|
|
27457
27439
|
|
|
27458
|
-
case
|
|
27440
|
+
case 108: {
|
|
27459
27441
|
const nextCh = this.lookaheadCharCode();
|
|
27460
27442
|
|
|
27461
27443
|
if (nextCh === 123) {
|
|
@@ -27466,7 +27448,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27466
27448
|
break;
|
|
27467
27449
|
}
|
|
27468
27450
|
|
|
27469
|
-
case
|
|
27451
|
+
case 125: {
|
|
27470
27452
|
const result = this.tsParseInterfaceDeclaration(this.startNode());
|
|
27471
27453
|
|
|
27472
27454
|
if (result)
|
|
@@ -27475,27 +27457,27 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27475
27457
|
break;
|
|
27476
27458
|
}
|
|
27477
27459
|
|
|
27478
|
-
case
|
|
27460
|
+
case 123: {
|
|
27479
27461
|
if (this.nextTokenIsIdentifierOrStringLiteralOnSameLine()) {
|
|
27480
27462
|
const node = this.startNode();
|
|
27481
27463
|
this.next();
|
|
27482
|
-
return this.tsParseDeclaration(node,
|
|
27464
|
+
return this.tsParseDeclaration(node, 123, false, decorators);
|
|
27483
27465
|
}
|
|
27484
27466
|
|
|
27485
27467
|
break;
|
|
27486
27468
|
}
|
|
27487
27469
|
|
|
27488
|
-
case
|
|
27470
|
+
case 124: {
|
|
27489
27471
|
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
27490
27472
|
const node = this.startNode();
|
|
27491
27473
|
this.next();
|
|
27492
|
-
return this.tsParseDeclaration(node,
|
|
27474
|
+
return this.tsParseDeclaration(node, 124, false, decorators);
|
|
27493
27475
|
}
|
|
27494
27476
|
|
|
27495
27477
|
break;
|
|
27496
27478
|
}
|
|
27497
27479
|
|
|
27498
|
-
case
|
|
27480
|
+
case 126: {
|
|
27499
27481
|
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
27500
27482
|
const node = this.startNode();
|
|
27501
27483
|
this.next();
|
|
@@ -27525,7 +27507,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27525
27507
|
}
|
|
27526
27508
|
|
|
27527
27509
|
tsIsStartOfStaticBlocks() {
|
|
27528
|
-
return this.isContextual(
|
|
27510
|
+
return this.isContextual(102) && this.lookaheadCharCode() === 123;
|
|
27529
27511
|
}
|
|
27530
27512
|
|
|
27531
27513
|
parseClassMember(classBody2, member, state) {
|
|
@@ -27609,16 +27591,16 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27609
27591
|
}
|
|
27610
27592
|
|
|
27611
27593
|
parsePostMemberNameModifiers(methodOrProp) {
|
|
27612
|
-
const optional = this.eat(
|
|
27594
|
+
const optional = this.eat(13);
|
|
27613
27595
|
|
|
27614
27596
|
if (optional)
|
|
27615
27597
|
methodOrProp.optional = true;
|
|
27616
27598
|
|
|
27617
|
-
if (methodOrProp.readonly && this.match(
|
|
27599
|
+
if (methodOrProp.readonly && this.match(6)) {
|
|
27618
27600
|
this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp);
|
|
27619
27601
|
}
|
|
27620
27602
|
|
|
27621
|
-
if (methodOrProp.declare && this.match(
|
|
27603
|
+
if (methodOrProp.declare && this.match(6)) {
|
|
27622
27604
|
this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp);
|
|
27623
27605
|
}
|
|
27624
27606
|
}
|
|
@@ -27631,7 +27613,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27631
27613
|
}
|
|
27632
27614
|
|
|
27633
27615
|
parseConditional(expr, startLoc, refExpressionErrors) {
|
|
27634
|
-
if (!this.match(
|
|
27616
|
+
if (!this.match(13))
|
|
27635
27617
|
return expr;
|
|
27636
27618
|
|
|
27637
27619
|
if (this.state.maybeInArrowParameters) {
|
|
@@ -27649,12 +27631,12 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27649
27631
|
parseParenItem(node, startLoc) {
|
|
27650
27632
|
const newNode = super.parseParenItem(node, startLoc);
|
|
27651
27633
|
|
|
27652
|
-
if (this.eat(
|
|
27634
|
+
if (this.eat(13)) {
|
|
27653
27635
|
newNode.optional = true;
|
|
27654
27636
|
this.resetEndLocation(node);
|
|
27655
27637
|
}
|
|
27656
27638
|
|
|
27657
|
-
if (this.match(
|
|
27639
|
+
if (this.match(10)) {
|
|
27658
27640
|
const typeCastNode = this.startNodeAt(startLoc);
|
|
27659
27641
|
|
|
27660
27642
|
typeCastNode.expression = node;
|
|
@@ -27666,14 +27648,14 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27666
27648
|
}
|
|
27667
27649
|
|
|
27668
27650
|
parseExportDeclaration(node) {
|
|
27669
|
-
if (!this.state.isAmbientContext && this.isContextual(
|
|
27651
|
+
if (!this.state.isAmbientContext && this.isContextual(121)) {
|
|
27670
27652
|
return this.tsInAmbientContext(() => this.parseExportDeclaration(node));
|
|
27671
27653
|
}
|
|
27672
27654
|
|
|
27673
27655
|
const startLoc = this.state.startLoc;
|
|
27674
|
-
const isDeclare = this.eatContextual(
|
|
27656
|
+
const isDeclare = this.eatContextual(121);
|
|
27675
27657
|
|
|
27676
|
-
if (isDeclare && (this.isContextual(
|
|
27658
|
+
if (isDeclare && (this.isContextual(121) || !this.shouldParseExportDeclaration())) {
|
|
27677
27659
|
throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc);
|
|
27678
27660
|
}
|
|
27679
27661
|
|
|
@@ -27696,7 +27678,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27696
27678
|
}
|
|
27697
27679
|
|
|
27698
27680
|
parseClassId(node, isStatement5, optionalId) {
|
|
27699
|
-
if ((!isStatement5 || optionalId) && this.isContextual(
|
|
27681
|
+
if ((!isStatement5 || optionalId) && this.isContextual(109)) {
|
|
27700
27682
|
return;
|
|
27701
27683
|
}
|
|
27702
27684
|
|
|
@@ -27709,9 +27691,9 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27709
27691
|
|
|
27710
27692
|
parseClassPropertyAnnotation(node) {
|
|
27711
27693
|
if (!node.optional) {
|
|
27712
|
-
if (this.eat(
|
|
27694
|
+
if (this.eat(31)) {
|
|
27713
27695
|
node.definite = true;
|
|
27714
|
-
} else if (this.eat(
|
|
27696
|
+
} else if (this.eat(13)) {
|
|
27715
27697
|
node.optional = true;
|
|
27716
27698
|
}
|
|
27717
27699
|
}
|
|
@@ -27725,11 +27707,11 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27725
27707
|
parseClassProperty(node) {
|
|
27726
27708
|
this.parseClassPropertyAnnotation(node);
|
|
27727
27709
|
|
|
27728
|
-
if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(
|
|
27710
|
+
if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(25)) {
|
|
27729
27711
|
this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc);
|
|
27730
27712
|
}
|
|
27731
27713
|
|
|
27732
|
-
if (node.abstract && this.match(
|
|
27714
|
+
if (node.abstract && this.match(25)) {
|
|
27733
27715
|
const {key} = node;
|
|
27734
27716
|
|
|
27735
27717
|
this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, {
|
|
@@ -27809,11 +27791,11 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27809
27791
|
parseClassSuper(node) {
|
|
27810
27792
|
super.parseClassSuper(node);
|
|
27811
27793
|
|
|
27812
|
-
if (node.superClass && (this.match(
|
|
27794
|
+
if (node.superClass && (this.match(43) || this.match(47))) {
|
|
27813
27795
|
node.superTypeArguments = this.tsParseTypeArgumentsInExpression();
|
|
27814
27796
|
}
|
|
27815
27797
|
|
|
27816
|
-
if (this.eatContextual(
|
|
27798
|
+
if (this.eatContextual(109)) {
|
|
27817
27799
|
node.implements = this.tsParseHeritageClause('implements');
|
|
27818
27800
|
}
|
|
27819
27801
|
}
|
|
@@ -27839,7 +27821,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27839
27821
|
parseVarId(decl, kind) {
|
|
27840
27822
|
super.parseVarId(decl, kind);
|
|
27841
27823
|
|
|
27842
|
-
if (decl.id.type === 'Identifier' && !this.hasPrecedingLineBreak() && this.eat(
|
|
27824
|
+
if (decl.id.type === 'Identifier' && !this.hasPrecedingLineBreak() && this.eat(31)) {
|
|
27843
27825
|
decl.definite = true;
|
|
27844
27826
|
}
|
|
27845
27827
|
|
|
@@ -27852,7 +27834,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27852
27834
|
}
|
|
27853
27835
|
|
|
27854
27836
|
parseAsyncArrowFromCallExpression(node, call2) {
|
|
27855
|
-
if (this.match(
|
|
27837
|
+
if (this.match(10)) {
|
|
27856
27838
|
node.returnType = this.tsParseTypeAnnotation();
|
|
27857
27839
|
}
|
|
27858
27840
|
|
|
@@ -27864,7 +27846,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27864
27846
|
let jsx2;
|
|
27865
27847
|
let typeCast;
|
|
27866
27848
|
|
|
27867
|
-
if (this.hasPlugin('jsx') && (this.match(
|
|
27849
|
+
if (this.hasPlugin('jsx') && (this.match(138) || this.match(43))) {
|
|
27868
27850
|
state = this.state.clone();
|
|
27869
27851
|
jsx2 = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
|
|
27870
27852
|
|
|
@@ -27880,7 +27862,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27880
27862
|
}
|
|
27881
27863
|
}
|
|
27882
27864
|
|
|
27883
|
-
if (!jsx2?.error && !this.match(
|
|
27865
|
+
if (!jsx2?.error && !this.match(43)) {
|
|
27884
27866
|
return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
|
|
27885
27867
|
}
|
|
27886
27868
|
|
|
@@ -27960,7 +27942,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27960
27942
|
}
|
|
27961
27943
|
|
|
27962
27944
|
parseMaybeUnary(refExpressionErrors, sawUnary) {
|
|
27963
|
-
if (!this.hasPlugin('jsx') && this.match(
|
|
27945
|
+
if (!this.hasPlugin('jsx') && this.match(43)) {
|
|
27964
27946
|
return this.tsParseTypeAssertion();
|
|
27965
27947
|
}
|
|
27966
27948
|
|
|
@@ -27968,11 +27950,11 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27968
27950
|
}
|
|
27969
27951
|
|
|
27970
27952
|
parseArrow(node) {
|
|
27971
|
-
if (this.match(
|
|
27953
|
+
if (this.match(10)) {
|
|
27972
27954
|
const result = this.tryParse((abort) => {
|
|
27973
|
-
const returnType = this.tsParseTypeOrTypePredicateAnnotation(
|
|
27955
|
+
const returnType = this.tsParseTypeOrTypePredicateAnnotation(10);
|
|
27974
27956
|
|
|
27975
|
-
if (this.canInsertSemicolon() || !this.match(
|
|
27957
|
+
if (this.canInsertSemicolon() || !this.match(15))
|
|
27976
27958
|
abort();
|
|
27977
27959
|
|
|
27978
27960
|
return returnType;
|
|
@@ -27993,7 +27975,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
27993
27975
|
}
|
|
27994
27976
|
|
|
27995
27977
|
parseFunctionParamType(param) {
|
|
27996
|
-
if (this.eat(
|
|
27978
|
+
if (this.eat(13)) {
|
|
27997
27979
|
param.optional = true;
|
|
27998
27980
|
}
|
|
27999
27981
|
|
|
@@ -28102,7 +28084,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28102
28084
|
}
|
|
28103
28085
|
|
|
28104
28086
|
parseBindingAtom() {
|
|
28105
|
-
if (this.state.type ===
|
|
28087
|
+
if (this.state.type === 74) {
|
|
28106
28088
|
return this.parseIdentifier(true);
|
|
28107
28089
|
}
|
|
28108
28090
|
|
|
@@ -28110,24 +28092,24 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28110
28092
|
}
|
|
28111
28093
|
|
|
28112
28094
|
parseMaybeDecoratorArguments(expr, startLoc) {
|
|
28113
|
-
if (this.match(
|
|
28095
|
+
if (this.match(43) || this.match(47)) {
|
|
28114
28096
|
const typeArguments = this.tsParseTypeArgumentsInExpression();
|
|
28115
28097
|
|
|
28116
|
-
if (this.match(
|
|
28098
|
+
if (this.match(6)) {
|
|
28117
28099
|
const call2 = super.parseMaybeDecoratorArguments(expr, startLoc);
|
|
28118
28100
|
|
|
28119
28101
|
call2.typeArguments = typeArguments;
|
|
28120
28102
|
return call2;
|
|
28121
28103
|
}
|
|
28122
28104
|
|
|
28123
|
-
this.unexpected(null,
|
|
28105
|
+
this.unexpected(null, 6);
|
|
28124
28106
|
}
|
|
28125
28107
|
|
|
28126
28108
|
return super.parseMaybeDecoratorArguments(expr, startLoc);
|
|
28127
28109
|
}
|
|
28128
28110
|
|
|
28129
28111
|
checkCommaAfterRest(close) {
|
|
28130
|
-
if (this.state.isAmbientContext && this.match(
|
|
28112
|
+
if (this.state.isAmbientContext && this.match(8) && this.lookaheadCharCode() === close) {
|
|
28131
28113
|
this.next();
|
|
28132
28114
|
return false;
|
|
28133
28115
|
}
|
|
@@ -28136,11 +28118,11 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28136
28118
|
}
|
|
28137
28119
|
|
|
28138
28120
|
isClassMethod() {
|
|
28139
|
-
return this.match(
|
|
28121
|
+
return this.match(43) || super.isClassMethod();
|
|
28140
28122
|
}
|
|
28141
28123
|
|
|
28142
28124
|
isClassProperty() {
|
|
28143
|
-
return this.match(
|
|
28125
|
+
return this.match(31) || this.match(10) || super.isClassProperty();
|
|
28144
28126
|
}
|
|
28145
28127
|
|
|
28146
28128
|
parseMaybeDefault(startLoc, left) {
|
|
@@ -28156,12 +28138,12 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28156
28138
|
getTokenFromCode(code2) {
|
|
28157
28139
|
if (this.state.inType) {
|
|
28158
28140
|
if (code2 === 62) {
|
|
28159
|
-
this.finishOp(
|
|
28141
|
+
this.finishOp(44, 1);
|
|
28160
28142
|
return;
|
|
28161
28143
|
}
|
|
28162
28144
|
|
|
28163
28145
|
if (code2 === 60) {
|
|
28164
|
-
this.finishOp(
|
|
28146
|
+
this.finishOp(43, 1);
|
|
28165
28147
|
return;
|
|
28166
28148
|
}
|
|
28167
28149
|
}
|
|
@@ -28172,10 +28154,10 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28172
28154
|
reScan_lt_gt() {
|
|
28173
28155
|
const {type} = this.state;
|
|
28174
28156
|
|
|
28175
|
-
if (type ===
|
|
28157
|
+
if (type === 43) {
|
|
28176
28158
|
this.state.pos -= 1;
|
|
28177
28159
|
this.readToken_lt();
|
|
28178
|
-
} else if (type ===
|
|
28160
|
+
} else if (type === 44) {
|
|
28179
28161
|
this.state.pos -= 1;
|
|
28180
28162
|
this.readToken_gt();
|
|
28181
28163
|
}
|
|
@@ -28184,10 +28166,10 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28184
28166
|
reScan_lt() {
|
|
28185
28167
|
const {type} = this.state;
|
|
28186
28168
|
|
|
28187
|
-
if (type ===
|
|
28169
|
+
if (type === 47) {
|
|
28188
28170
|
this.state.pos -= 2;
|
|
28189
|
-
this.finishOp(
|
|
28190
|
-
return
|
|
28171
|
+
this.finishOp(43, 1);
|
|
28172
|
+
return 43;
|
|
28191
28173
|
}
|
|
28192
28174
|
|
|
28193
28175
|
return type;
|
|
@@ -28210,7 +28192,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28210
28192
|
}
|
|
28211
28193
|
|
|
28212
28194
|
shouldParseArrow(params) {
|
|
28213
|
-
if (this.match(
|
|
28195
|
+
if (this.match(10)) {
|
|
28214
28196
|
return params.every((expr) => this.isAssignable(expr, true));
|
|
28215
28197
|
}
|
|
28216
28198
|
|
|
@@ -28218,7 +28200,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28218
28200
|
}
|
|
28219
28201
|
|
|
28220
28202
|
shouldParseAsyncArrow() {
|
|
28221
|
-
return this.match(
|
|
28203
|
+
return this.match(10) || super.shouldParseAsyncArrow();
|
|
28222
28204
|
}
|
|
28223
28205
|
|
|
28224
28206
|
canHaveLeadingDecorator() {
|
|
@@ -28226,7 +28208,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28226
28208
|
}
|
|
28227
28209
|
|
|
28228
28210
|
jsxParseOpeningElementAfterName(node) {
|
|
28229
|
-
if (this.match(
|
|
28211
|
+
if (this.match(43) || this.match(47)) {
|
|
28230
28212
|
const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression());
|
|
28231
28213
|
|
|
28232
28214
|
if (typeArguments) {
|
|
@@ -28286,10 +28268,10 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28286
28268
|
}
|
|
28287
28269
|
|
|
28288
28270
|
tsParseAbstractDeclaration(node, decorators) {
|
|
28289
|
-
if (this.match(
|
|
28271
|
+
if (this.match(76)) {
|
|
28290
28272
|
node.abstract = true;
|
|
28291
28273
|
return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));
|
|
28292
|
-
} else if (this.isContextual(
|
|
28274
|
+
} else if (this.isContextual(125)) {
|
|
28293
28275
|
if (!this.hasFollowingLineBreak()) {
|
|
28294
28276
|
node.abstract = true;
|
|
28295
28277
|
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node);
|
|
@@ -28299,7 +28281,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28299
28281
|
}
|
|
28300
28282
|
}
|
|
28301
28283
|
|
|
28302
|
-
throw this.unexpected(null,
|
|
28284
|
+
throw this.unexpected(null, 76);
|
|
28303
28285
|
}
|
|
28304
28286
|
|
|
28305
28287
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
|
|
@@ -28322,8 +28304,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28322
28304
|
}
|
|
28323
28305
|
|
|
28324
28306
|
tsParseTypeParameterName() {
|
|
28325
|
-
|
|
28326
|
-
return typeName;
|
|
28307
|
+
return this.parseIdentifier();
|
|
28327
28308
|
}
|
|
28328
28309
|
|
|
28329
28310
|
shouldParseAsAmbientContext() {
|
|
@@ -28375,10 +28356,10 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28375
28356
|
let canParseAsKeyword = true;
|
|
28376
28357
|
const loc = leftOfAs.loc.start;
|
|
28377
28358
|
|
|
28378
|
-
if (this.isContextual(
|
|
28359
|
+
if (this.isContextual(89)) {
|
|
28379
28360
|
const firstAs = this.parseIdentifier();
|
|
28380
28361
|
|
|
28381
|
-
if (this.isContextual(
|
|
28362
|
+
if (this.isContextual(89)) {
|
|
28382
28363
|
const secondAs = this.parseIdentifier();
|
|
28383
28364
|
|
|
28384
28365
|
if (tokenIsKeywordOrIdentifier(this.state.type)) {
|
|
@@ -28403,7 +28384,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28403
28384
|
if (isImport2) {
|
|
28404
28385
|
leftOfAs = this.parseIdentifier(true);
|
|
28405
28386
|
|
|
28406
|
-
if (!this.isContextual(
|
|
28387
|
+
if (!this.isContextual(89)) {
|
|
28407
28388
|
this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true);
|
|
28408
28389
|
}
|
|
28409
28390
|
} else {
|
|
@@ -28421,7 +28402,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
28421
28402
|
|
|
28422
28403
|
node[kindKey] = hasTypeSpecifier ? 'type' : 'value';
|
|
28423
28404
|
|
|
28424
|
-
if (canParseAsKeyword && this.eatContextual(
|
|
28405
|
+
if (canParseAsKeyword && this.eatContextual(89)) {
|
|
28425
28406
|
node[rightOfAsKey] = isImport2 ? this.parseIdentifier() : this.parseModuleExportName();
|
|
28426
28407
|
}
|
|
28427
28408
|
|
|
@@ -28685,13 +28666,13 @@ var PlaceholderErrors = ParseErrorEnum`placeholders`({
|
|
|
28685
28666
|
|
|
28686
28667
|
var placeholders = (superClass) => class PlaceholdersParserMixin extends superClass {
|
|
28687
28668
|
parsePlaceholder(expectedNode) {
|
|
28688
|
-
if (this.match(
|
|
28669
|
+
if (this.match(129)) {
|
|
28689
28670
|
const node = this.startNode();
|
|
28690
28671
|
this.next();
|
|
28691
28672
|
this.assertNoSpace();
|
|
28692
28673
|
node.name = super.parseIdentifier(true);
|
|
28693
28674
|
this.assertNoSpace();
|
|
28694
|
-
this.expect(
|
|
28675
|
+
this.expect(129);
|
|
28695
28676
|
return this.finishPlaceholder(node, expectedNode);
|
|
28696
28677
|
}
|
|
28697
28678
|
}
|
|
@@ -28709,7 +28690,7 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
|
|
|
28709
28690
|
|
|
28710
28691
|
getTokenFromCode(code2) {
|
|
28711
28692
|
if (code2 === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
|
|
28712
|
-
this.finishOp(
|
|
28693
|
+
this.finishOp(129, 2);
|
|
28713
28694
|
} else {
|
|
28714
28695
|
super.getTokenFromCode(code2);
|
|
28715
28696
|
}
|
|
@@ -28789,7 +28770,7 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
|
|
|
28789
28770
|
return super.parseExpressionStatement(node, expr);
|
|
28790
28771
|
}
|
|
28791
28772
|
|
|
28792
|
-
if (this.match(
|
|
28773
|
+
if (this.match(10)) {
|
|
28793
28774
|
const stmt = node;
|
|
28794
28775
|
|
|
28795
28776
|
stmt.label = this.finishPlaceholder(expr, 'Identifier');
|
|
@@ -28820,7 +28801,7 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
|
|
|
28820
28801
|
const placeholder2 = this.parsePlaceholder('Identifier');
|
|
28821
28802
|
|
|
28822
28803
|
if (placeholder2) {
|
|
28823
|
-
if (this.match(
|
|
28804
|
+
if (this.match(77) || this.match(129) || this.match(2)) {
|
|
28824
28805
|
node.id = placeholder2;
|
|
28825
28806
|
} else if (optionalId || !isStatement5) {
|
|
28826
28807
|
node.id = null;
|
|
@@ -28846,7 +28827,7 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
|
|
|
28846
28827
|
|
|
28847
28828
|
const node2 = node;
|
|
28848
28829
|
|
|
28849
|
-
if (!this.isContextual(
|
|
28830
|
+
if (!this.isContextual(94) && !this.match(8)) {
|
|
28850
28831
|
node2.specifiers = [];
|
|
28851
28832
|
node2.source = null;
|
|
28852
28833
|
node2.declaration = this.finishPlaceholder(placeholder2, 'Declaration');
|
|
@@ -28864,11 +28845,11 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
|
|
|
28864
28845
|
}
|
|
28865
28846
|
|
|
28866
28847
|
isExportDefaultSpecifier() {
|
|
28867
|
-
if (this.match(
|
|
28848
|
+
if (this.match(61)) {
|
|
28868
28849
|
const next = this.nextTokenStart();
|
|
28869
28850
|
|
|
28870
28851
|
if (this.isUnparsedContextual(next, 'from')) {
|
|
28871
|
-
if (this.input.startsWith(tokenLabelName(
|
|
28852
|
+
if (this.input.startsWith(tokenLabelName(129), this.nextTokenStartSince(next + 4))) {
|
|
28872
28853
|
return true;
|
|
28873
28854
|
}
|
|
28874
28855
|
}
|
|
@@ -28904,7 +28885,7 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
|
|
|
28904
28885
|
|
|
28905
28886
|
node.specifiers = [];
|
|
28906
28887
|
|
|
28907
|
-
if (!this.isContextual(
|
|
28888
|
+
if (!this.isContextual(94) && !this.match(8)) {
|
|
28908
28889
|
node.source = this.finishPlaceholder(placeholder2, 'StringLiteral');
|
|
28909
28890
|
this.semicolon();
|
|
28910
28891
|
return this.finishNode(node, 'ImportDeclaration');
|
|
@@ -28915,14 +28896,14 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
|
|
|
28915
28896
|
specifier.local = placeholder2;
|
|
28916
28897
|
node.specifiers.push(this.finishNode(specifier, 'ImportDefaultSpecifier'));
|
|
28917
28898
|
|
|
28918
|
-
if (this.eat(
|
|
28899
|
+
if (this.eat(8)) {
|
|
28919
28900
|
const hasStarImport = this.maybeParseStarImportSpecifier(node);
|
|
28920
28901
|
|
|
28921
28902
|
if (!hasStarImport)
|
|
28922
28903
|
this.parseNamedImportSpecifiers(node);
|
|
28923
28904
|
}
|
|
28924
28905
|
|
|
28925
|
-
this.expectContextual(
|
|
28906
|
+
this.expectContextual(94);
|
|
28926
28907
|
node.source = this.parseImportSource();
|
|
28927
28908
|
this.semicolon();
|
|
28928
28909
|
return this.finishNode(node, 'ImportDeclaration');
|
|
@@ -28941,7 +28922,7 @@ var placeholders = (superClass) => class PlaceholdersParserMixin extends superCl
|
|
|
28941
28922
|
|
|
28942
28923
|
var v8intrinsic = (superClass) => class V8IntrinsicMixin extends superClass {
|
|
28943
28924
|
parseV8Intrinsic() {
|
|
28944
|
-
if (this.match(
|
|
28925
|
+
if (this.match(50)) {
|
|
28945
28926
|
const v8IntrinsicStartLoc = this.state.startLoc;
|
|
28946
28927
|
const node = this.startNode();
|
|
28947
28928
|
this.next();
|
|
@@ -28951,7 +28932,7 @@ var v8intrinsic = (superClass) => class V8IntrinsicMixin extends superClass {
|
|
|
28951
28932
|
const identifier4 = this.createIdentifier(node, name);
|
|
28952
28933
|
this.castNodeTo(identifier4, 'V8IntrinsicIdentifier');
|
|
28953
28934
|
|
|
28954
|
-
if (this.match(
|
|
28935
|
+
if (this.match(6)) {
|
|
28955
28936
|
return identifier4;
|
|
28956
28937
|
}
|
|
28957
28938
|
}
|
|
@@ -29108,13 +29089,13 @@ var ExpressionParser = class extends LValParser {
|
|
|
29108
29089
|
this.enterInitialScopes();
|
|
29109
29090
|
this.nextToken();
|
|
29110
29091
|
|
|
29111
|
-
if (this.match(
|
|
29092
|
+
if (this.match(135)) {
|
|
29112
29093
|
throw this.raise(Errors.ParseExpressionEmptyInput, this.state.startLoc);
|
|
29113
29094
|
}
|
|
29114
29095
|
|
|
29115
29096
|
const expr = this.parseExpression();
|
|
29116
29097
|
|
|
29117
|
-
if (!this.match(
|
|
29098
|
+
if (!this.match(135)) {
|
|
29118
29099
|
throw this.raise(Errors.ParseExpressionExpectsEOF, this.state.startLoc, {
|
|
29119
29100
|
unexpected: this.input.codePointAt(this.state.start),
|
|
29120
29101
|
});
|
|
@@ -29125,7 +29106,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29125
29106
|
expr.errors = this.state.errors;
|
|
29126
29107
|
|
|
29127
29108
|
if (this.optionFlags & 256) {
|
|
29128
|
-
expr.tokens = this.tokens;
|
|
29109
|
+
expr.tokens = createExportedTokens(this.tokens);
|
|
29129
29110
|
}
|
|
29130
29111
|
|
|
29131
29112
|
return expr;
|
|
@@ -29143,11 +29124,11 @@ var ExpressionParser = class extends LValParser {
|
|
|
29143
29124
|
const startLoc = this.state.startLoc;
|
|
29144
29125
|
const expr = this.parseMaybeAssign(refExpressionErrors);
|
|
29145
29126
|
|
|
29146
|
-
if (this.match(
|
|
29127
|
+
if (this.match(8)) {
|
|
29147
29128
|
const node = this.startNodeAt(startLoc);
|
|
29148
29129
|
|
|
29149
29130
|
node.expressions = [expr];
|
|
29150
|
-
while (this.eat(
|
|
29131
|
+
while (this.eat(8)) {
|
|
29151
29132
|
node.expressions.push(this.parseMaybeAssign(refExpressionErrors));
|
|
29152
29133
|
}
|
|
29153
29134
|
|
|
@@ -29172,7 +29153,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29172
29153
|
|
|
29173
29154
|
parseMaybeAssign(refExpressionErrors, afterLeftParse) {
|
|
29174
29155
|
const startLoc = this.state.startLoc;
|
|
29175
|
-
const isYield = this.isContextual(
|
|
29156
|
+
const isYield = this.isContextual(104);
|
|
29176
29157
|
|
|
29177
29158
|
if (isYield) {
|
|
29178
29159
|
if (this.prodParam.hasYield) {
|
|
@@ -29198,7 +29179,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29198
29179
|
|
|
29199
29180
|
const {type} = this.state;
|
|
29200
29181
|
|
|
29201
|
-
if (type ===
|
|
29182
|
+
if (type === 6 || tokenIsIdentifier(type)) {
|
|
29202
29183
|
this.state.potentialArrowAt = this.state.start;
|
|
29203
29184
|
}
|
|
29204
29185
|
|
|
@@ -29214,7 +29195,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29214
29195
|
|
|
29215
29196
|
node.operator = operator;
|
|
29216
29197
|
|
|
29217
|
-
if (this.match(
|
|
29198
|
+
if (this.match(25)) {
|
|
29218
29199
|
this.toAssignable(left, true);
|
|
29219
29200
|
node.left = left;
|
|
29220
29201
|
const startIndex = startLoc.index;
|
|
@@ -29250,7 +29231,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29250
29231
|
if (isYield) {
|
|
29251
29232
|
const {type: type2} = this.state;
|
|
29252
29233
|
|
|
29253
|
-
const startsExpr2 = this.hasPlugin('v8intrinsic') ? tokenCanStartExpression(type2) : tokenCanStartExpression(type2) && !this.match(
|
|
29234
|
+
const startsExpr2 = this.hasPlugin('v8intrinsic') ? tokenCanStartExpression(type2) : tokenCanStartExpression(type2) && !this.match(50);
|
|
29254
29235
|
|
|
29255
29236
|
if (startsExpr2 && !this.isAmbiguousPrefixOrIdentifier()) {
|
|
29256
29237
|
this.raiseOverwrite(Errors.YieldNotInGeneratorFunction, startLoc);
|
|
@@ -29274,12 +29255,12 @@ var ExpressionParser = class extends LValParser {
|
|
|
29274
29255
|
}
|
|
29275
29256
|
|
|
29276
29257
|
parseConditional(expr, startLoc) {
|
|
29277
|
-
if (this.eat(
|
|
29258
|
+
if (this.eat(13)) {
|
|
29278
29259
|
const node = this.startNodeAt(startLoc);
|
|
29279
29260
|
|
|
29280
29261
|
node.test = expr;
|
|
29281
29262
|
node.consequent = this.parseMaybeAssignAllowIn();
|
|
29282
|
-
this.expect(
|
|
29263
|
+
this.expect(10);
|
|
29283
29264
|
node.alternate = this.parseMaybeAssign();
|
|
29284
29265
|
return this.finishNode(node, 'ConditionalExpression');
|
|
29285
29266
|
}
|
|
@@ -29288,7 +29269,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29288
29269
|
}
|
|
29289
29270
|
|
|
29290
29271
|
parseMaybeUnaryOrPrivate(refExpressionErrors) {
|
|
29291
|
-
return this.match(
|
|
29272
|
+
return this.match(134) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
|
|
29292
29273
|
}
|
|
29293
29274
|
|
|
29294
29275
|
parseExprOps(refExpressionErrors) {
|
|
@@ -29307,7 +29288,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29307
29288
|
if (this.isPrivateName(left)) {
|
|
29308
29289
|
const value = this.getPrivateNameSV(left);
|
|
29309
29290
|
|
|
29310
|
-
if (minPrec >= tokenOperatorPrecedence(
|
|
29291
|
+
if (minPrec >= tokenOperatorPrecedence(54) || !this.prodParam.hasIn || !this.match(54)) {
|
|
29311
29292
|
this.raise(Errors.PrivateInExpectedIn, left, {
|
|
29312
29293
|
identifierName: value,
|
|
29313
29294
|
});
|
|
@@ -29318,11 +29299,11 @@ var ExpressionParser = class extends LValParser {
|
|
|
29318
29299
|
|
|
29319
29300
|
const op = this.state.type;
|
|
29320
29301
|
|
|
29321
|
-
if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(
|
|
29302
|
+
if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(54))) {
|
|
29322
29303
|
let prec = tokenOperatorPrecedence(op);
|
|
29323
29304
|
|
|
29324
29305
|
if (prec > minPrec) {
|
|
29325
|
-
if (op ===
|
|
29306
|
+
if (op === 35) {
|
|
29326
29307
|
this.expectPlugin('pipelineOperator');
|
|
29327
29308
|
|
|
29328
29309
|
if (this.state.inFSharpPipelineDirectBody) {
|
|
@@ -29334,11 +29315,11 @@ var ExpressionParser = class extends LValParser {
|
|
|
29334
29315
|
|
|
29335
29316
|
node.left = left;
|
|
29336
29317
|
node.operator = this.state.value;
|
|
29337
|
-
const logical = op ===
|
|
29338
|
-
const coalesce = op ===
|
|
29318
|
+
const logical = op === 37 || op === 38;
|
|
29319
|
+
const coalesce = op === 36;
|
|
29339
29320
|
|
|
29340
29321
|
if (coalesce) {
|
|
29341
|
-
prec = tokenOperatorPrecedence(
|
|
29322
|
+
prec = tokenOperatorPrecedence(38);
|
|
29342
29323
|
}
|
|
29343
29324
|
|
|
29344
29325
|
this.next();
|
|
@@ -29346,7 +29327,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29346
29327
|
const finishedNode = this.finishNode(node, logical || coalesce ? 'LogicalExpression' : 'BinaryExpression');
|
|
29347
29328
|
const nextOp = this.state.type;
|
|
29348
29329
|
|
|
29349
|
-
if (coalesce && (nextOp ===
|
|
29330
|
+
if (coalesce && (nextOp === 37 || nextOp === 38) || logical && nextOp === 36) {
|
|
29350
29331
|
throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc);
|
|
29351
29332
|
}
|
|
29352
29333
|
|
|
@@ -29359,7 +29340,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29359
29340
|
|
|
29360
29341
|
parseExprOpRightExpr(op, prec) {
|
|
29361
29342
|
switch(op) {
|
|
29362
|
-
case
|
|
29343
|
+
case 35:
|
|
29363
29344
|
switch(this.getPluginOption('pipelineOperator', 'proposal')) {
|
|
29364
29345
|
case 'hack':
|
|
29365
29346
|
return this.withTopicBindingContext(() => {
|
|
@@ -29402,14 +29383,14 @@ var ExpressionParser = class extends LValParser {
|
|
|
29402
29383
|
}
|
|
29403
29384
|
|
|
29404
29385
|
checkExponentialAfterUnary(node) {
|
|
29405
|
-
if (this.match(
|
|
29386
|
+
if (this.match(53)) {
|
|
29406
29387
|
this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument);
|
|
29407
29388
|
}
|
|
29408
29389
|
}
|
|
29409
29390
|
|
|
29410
29391
|
parseMaybeUnary(refExpressionErrors, sawUnary) {
|
|
29411
29392
|
const startLoc = this.state.startLoc;
|
|
29412
|
-
const isAwait = this.isContextual(
|
|
29393
|
+
const isAwait = this.isContextual(92);
|
|
29413
29394
|
|
|
29414
29395
|
if (isAwait && this.recordAwaitIfAllowed()) {
|
|
29415
29396
|
this.next();
|
|
@@ -29421,18 +29402,18 @@ var ExpressionParser = class extends LValParser {
|
|
|
29421
29402
|
return expr2;
|
|
29422
29403
|
}
|
|
29423
29404
|
|
|
29424
|
-
const update = this.match(
|
|
29405
|
+
const update = this.match(30);
|
|
29425
29406
|
const node = this.startNode();
|
|
29426
29407
|
|
|
29427
29408
|
if (tokenIsPrefix(this.state.type)) {
|
|
29428
29409
|
node.operator = this.state.value;
|
|
29429
29410
|
node.prefix = true;
|
|
29430
29411
|
|
|
29431
|
-
if (this.match(
|
|
29412
|
+
if (this.match(68)) {
|
|
29432
29413
|
this.expectPlugin('throwExpressions');
|
|
29433
29414
|
}
|
|
29434
29415
|
|
|
29435
|
-
const isDelete = this.match(
|
|
29416
|
+
const isDelete = this.match(85);
|
|
29436
29417
|
this.next();
|
|
29437
29418
|
node.argument = this.parseMaybeUnary(null, true);
|
|
29438
29419
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
@@ -29461,7 +29442,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29461
29442
|
if (isAwait) {
|
|
29462
29443
|
const {type} = this.state;
|
|
29463
29444
|
|
|
29464
|
-
const startsExpr2 = this.hasPlugin('v8intrinsic') ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(
|
|
29445
|
+
const startsExpr2 = this.hasPlugin('v8intrinsic') ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(50);
|
|
29465
29446
|
|
|
29466
29447
|
if (startsExpr2 && !this.isAmbiguousPrefixOrIdentifier()) {
|
|
29467
29448
|
this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc);
|
|
@@ -29531,7 +29512,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29531
29512
|
parseSubscript(base, startLoc, noCalls, state) {
|
|
29532
29513
|
const {type} = this.state;
|
|
29533
29514
|
|
|
29534
|
-
if (!noCalls && type ===
|
|
29515
|
+
if (!noCalls && type === 11) {
|
|
29535
29516
|
return this.parseBind(base, startLoc, noCalls, state);
|
|
29536
29517
|
} else if (tokenIsTemplate(type)) {
|
|
29537
29518
|
return this.parseTaggedTemplateExpression(base, startLoc, state);
|
|
@@ -29539,7 +29520,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29539
29520
|
|
|
29540
29521
|
let optional = false;
|
|
29541
29522
|
|
|
29542
|
-
if (type ===
|
|
29523
|
+
if (type === 14) {
|
|
29543
29524
|
if (noCalls) {
|
|
29544
29525
|
this.raise(Errors.OptionalChainingNoNew, this.state.startLoc);
|
|
29545
29526
|
|
|
@@ -29553,12 +29534,12 @@ var ExpressionParser = class extends LValParser {
|
|
|
29553
29534
|
this.next();
|
|
29554
29535
|
}
|
|
29555
29536
|
|
|
29556
|
-
if (!noCalls && this.match(
|
|
29537
|
+
if (!noCalls && this.match(6)) {
|
|
29557
29538
|
return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional);
|
|
29558
29539
|
} else {
|
|
29559
29540
|
const computed = this.eat(0);
|
|
29560
29541
|
|
|
29561
|
-
if (computed || optional || this.eat(
|
|
29542
|
+
if (computed || optional || this.eat(12)) {
|
|
29562
29543
|
return this.parseMember(base, startLoc, state, computed, optional);
|
|
29563
29544
|
} else {
|
|
29564
29545
|
return this.stopParseSubscript(base, state);
|
|
@@ -29579,8 +29560,8 @@ var ExpressionParser = class extends LValParser {
|
|
|
29579
29560
|
|
|
29580
29561
|
if (computed) {
|
|
29581
29562
|
node.property = this.parseExpression();
|
|
29582
|
-
this.expect(
|
|
29583
|
-
} else if (this.match(
|
|
29563
|
+
this.expect(1);
|
|
29564
|
+
} else if (this.match(134)) {
|
|
29584
29565
|
if (base.type === 'Super') {
|
|
29585
29566
|
this.raise(Errors.SuperPrivateField, startLoc);
|
|
29586
29567
|
}
|
|
@@ -29707,13 +29688,13 @@ var ExpressionParser = class extends LValParser {
|
|
|
29707
29688
|
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
29708
29689
|
|
|
29709
29690
|
this.state.inFSharpPipelineDirectBody = false;
|
|
29710
|
-
while (!this.eat(
|
|
29691
|
+
while (!this.eat(7)) {
|
|
29711
29692
|
if (first) {
|
|
29712
29693
|
first = false;
|
|
29713
29694
|
} else {
|
|
29714
|
-
this.expect(
|
|
29695
|
+
this.expect(8);
|
|
29715
29696
|
|
|
29716
|
-
if (this.match(
|
|
29697
|
+
if (this.match(7)) {
|
|
29717
29698
|
if (nodeForExtra) {
|
|
29718
29699
|
this.addTrailingCommaExtraToNode(nodeForExtra);
|
|
29719
29700
|
}
|
|
@@ -29724,7 +29705,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29724
29705
|
}
|
|
29725
29706
|
|
|
29726
29707
|
elts.push(this.parseExprListItem(
|
|
29727
|
-
|
|
29708
|
+
7,
|
|
29728
29709
|
false,
|
|
29729
29710
|
refExpressionErrors,
|
|
29730
29711
|
allowPlaceholder,
|
|
@@ -29736,12 +29717,12 @@ var ExpressionParser = class extends LValParser {
|
|
|
29736
29717
|
}
|
|
29737
29718
|
|
|
29738
29719
|
shouldParseAsyncArrow() {
|
|
29739
|
-
return this.match(
|
|
29720
|
+
return this.match(15) && !this.canInsertSemicolon();
|
|
29740
29721
|
}
|
|
29741
29722
|
|
|
29742
29723
|
parseAsyncArrowFromCallExpression(node, call2) {
|
|
29743
29724
|
this.resetPreviousNodeTrailingComments(call2);
|
|
29744
|
-
this.expect(
|
|
29725
|
+
this.expect(15);
|
|
29745
29726
|
this.parseArrowExpression(node, call2.arguments, true, call2.extra?.trailingCommaLoc);
|
|
29746
29727
|
|
|
29747
29728
|
if (call2.innerComments) {
|
|
@@ -29766,18 +29747,18 @@ var ExpressionParser = class extends LValParser {
|
|
|
29766
29747
|
const {type} = this.state;
|
|
29767
29748
|
|
|
29768
29749
|
switch(type) {
|
|
29769
|
-
case
|
|
29750
|
+
case 75:
|
|
29770
29751
|
return this.parseSuper();
|
|
29771
29752
|
|
|
29772
|
-
case
|
|
29753
|
+
case 79:
|
|
29773
29754
|
node = this.startNode();
|
|
29774
29755
|
this.next();
|
|
29775
29756
|
|
|
29776
|
-
if (this.match(
|
|
29757
|
+
if (this.match(12)) {
|
|
29777
29758
|
return this.parseImportMetaPropertyOrPhaseCall(node);
|
|
29778
29759
|
}
|
|
29779
29760
|
|
|
29780
|
-
if (this.match(
|
|
29761
|
+
if (this.match(6)) {
|
|
29781
29762
|
if (this.optionFlags & 512) {
|
|
29782
29763
|
return this.parseImportCall(node);
|
|
29783
29764
|
} else {
|
|
@@ -29788,69 +29769,69 @@ var ExpressionParser = class extends LValParser {
|
|
|
29788
29769
|
return this.finishNode(node, 'Import');
|
|
29789
29770
|
}
|
|
29790
29771
|
|
|
29791
|
-
case
|
|
29772
|
+
case 74:
|
|
29792
29773
|
node = this.startNode();
|
|
29793
29774
|
this.next();
|
|
29794
29775
|
return this.finishNode(node, 'ThisExpression');
|
|
29795
29776
|
|
|
29796
|
-
case
|
|
29777
|
+
case 86: {
|
|
29797
29778
|
return this.parseDo(this.startNode(), false);
|
|
29798
29779
|
}
|
|
29799
29780
|
|
|
29800
|
-
case
|
|
29801
|
-
case
|
|
29781
|
+
case 52:
|
|
29782
|
+
case 27: {
|
|
29802
29783
|
this.readRegexp();
|
|
29803
29784
|
return this.parseRegExpLiteral(this.state.value);
|
|
29804
29785
|
}
|
|
29805
29786
|
|
|
29806
|
-
case
|
|
29787
|
+
case 131:
|
|
29807
29788
|
return this.parseNumericLiteral(this.state.value);
|
|
29808
29789
|
|
|
29809
|
-
case
|
|
29790
|
+
case 132:
|
|
29810
29791
|
return this.parseBigIntLiteral(this.state.value);
|
|
29811
29792
|
|
|
29812
|
-
case
|
|
29793
|
+
case 130:
|
|
29813
29794
|
return this.parseStringLiteral(this.state.value);
|
|
29814
29795
|
|
|
29815
|
-
case
|
|
29796
|
+
case 80:
|
|
29816
29797
|
return this.parseNullLiteral();
|
|
29817
29798
|
|
|
29818
|
-
case
|
|
29799
|
+
case 81:
|
|
29819
29800
|
return this.parseBooleanLiteral(true);
|
|
29820
29801
|
|
|
29821
|
-
case
|
|
29802
|
+
case 82:
|
|
29822
29803
|
return this.parseBooleanLiteral(false);
|
|
29823
29804
|
|
|
29824
|
-
case
|
|
29805
|
+
case 6: {
|
|
29825
29806
|
const canBeArrow = this.state.potentialArrowAt === this.state.start;
|
|
29826
29807
|
return this.parseParenAndDistinguishExpression(canBeArrow);
|
|
29827
29808
|
}
|
|
29828
29809
|
|
|
29829
29810
|
case 0: {
|
|
29830
|
-
return this.parseArrayLike(
|
|
29811
|
+
return this.parseArrayLike(1, refExpressionErrors);
|
|
29831
29812
|
}
|
|
29832
29813
|
|
|
29833
|
-
case
|
|
29834
|
-
return this.parseObjectLike(
|
|
29814
|
+
case 2: {
|
|
29815
|
+
return this.parseObjectLike(4, false, refExpressionErrors);
|
|
29835
29816
|
}
|
|
29836
29817
|
|
|
29837
|
-
case
|
|
29818
|
+
case 64:
|
|
29838
29819
|
return this.parseFunctionOrFunctionSent();
|
|
29839
29820
|
|
|
29840
|
-
case
|
|
29821
|
+
case 22:
|
|
29841
29822
|
decorators = this.parseDecorators();
|
|
29842
29823
|
|
|
29843
|
-
case
|
|
29824
|
+
case 76:
|
|
29844
29825
|
return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false);
|
|
29845
29826
|
|
|
29846
|
-
case
|
|
29827
|
+
case 73:
|
|
29847
29828
|
return this.parseNewOrNewTarget();
|
|
29848
29829
|
|
|
29849
|
-
case
|
|
29850
|
-
case
|
|
29830
|
+
case 21:
|
|
29831
|
+
case 20:
|
|
29851
29832
|
return this.parseTemplate(false);
|
|
29852
29833
|
|
|
29853
|
-
case
|
|
29834
|
+
case 11: {
|
|
29854
29835
|
node = this.startNode();
|
|
29855
29836
|
this.next();
|
|
29856
29837
|
node.object = null;
|
|
@@ -29863,29 +29844,29 @@ var ExpressionParser = class extends LValParser {
|
|
|
29863
29844
|
}
|
|
29864
29845
|
}
|
|
29865
29846
|
|
|
29866
|
-
case
|
|
29847
|
+
case 134: {
|
|
29867
29848
|
this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, {
|
|
29868
29849
|
identifierName: this.state.value,
|
|
29869
29850
|
});
|
|
29870
29851
|
return this.parsePrivateName();
|
|
29871
29852
|
}
|
|
29872
29853
|
|
|
29873
|
-
case
|
|
29874
|
-
return this.parseTopicReferenceThenEqualsSign(
|
|
29854
|
+
case 29: {
|
|
29855
|
+
return this.parseTopicReferenceThenEqualsSign(50, '%');
|
|
29875
29856
|
}
|
|
29876
29857
|
|
|
29877
|
-
case
|
|
29878
|
-
return this.parseTopicReferenceThenEqualsSign(
|
|
29858
|
+
case 28: {
|
|
29859
|
+
return this.parseTopicReferenceThenEqualsSign(40, '^');
|
|
29879
29860
|
}
|
|
29880
29861
|
|
|
29881
|
-
case
|
|
29882
|
-
case
|
|
29862
|
+
case 33:
|
|
29863
|
+
case 34: {
|
|
29883
29864
|
return this.parseTopicReference('hack');
|
|
29884
29865
|
}
|
|
29885
29866
|
|
|
29886
|
-
case
|
|
29887
|
-
case
|
|
29888
|
-
case
|
|
29867
|
+
case 40:
|
|
29868
|
+
case 50:
|
|
29869
|
+
case 23: {
|
|
29889
29870
|
const pipeProposal = this.getPluginOption('pipelineOperator', 'proposal');
|
|
29890
29871
|
|
|
29891
29872
|
if (pipeProposal) {
|
|
@@ -29895,7 +29876,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29895
29876
|
throw this.unexpected();
|
|
29896
29877
|
}
|
|
29897
29878
|
|
|
29898
|
-
case
|
|
29879
|
+
case 43: {
|
|
29899
29880
|
const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
|
|
29900
29881
|
|
|
29901
29882
|
if (isIdentifierStart2(lookaheadCh) || lookaheadCh === 62) {
|
|
@@ -29907,7 +29888,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29907
29888
|
|
|
29908
29889
|
default:
|
|
29909
29890
|
if (tokenIsIdentifier(type)) {
|
|
29910
|
-
if (this.isContextual(
|
|
29891
|
+
if (this.isContextual(123) && this.lookaheadInLineCharCode() === 123) {
|
|
29911
29892
|
return this.parseModuleExpression();
|
|
29912
29893
|
}
|
|
29913
29894
|
|
|
@@ -29918,7 +29899,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
29918
29899
|
if (!containsEsc && id.name === 'async' && !this.canInsertSemicolon()) {
|
|
29919
29900
|
const {type: type2} = this.state;
|
|
29920
29901
|
|
|
29921
|
-
if (type2 ===
|
|
29902
|
+
if (type2 === 64) {
|
|
29922
29903
|
this.resetPreviousNodeTrailingComments(id);
|
|
29923
29904
|
this.next();
|
|
29924
29905
|
return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
|
|
@@ -29928,14 +29909,14 @@ var ExpressionParser = class extends LValParser {
|
|
|
29928
29909
|
} else {
|
|
29929
29910
|
return id;
|
|
29930
29911
|
}
|
|
29931
|
-
} else if (type2 ===
|
|
29912
|
+
} else if (type2 === 86) {
|
|
29932
29913
|
this.resetPreviousNodeTrailingComments(id);
|
|
29933
29914
|
return this.parseDo(this.startNodeAtNode(id), true);
|
|
29934
29915
|
}
|
|
29935
29916
|
|
|
29936
29917
|
}
|
|
29937
29918
|
|
|
29938
|
-
if (canBeArrow && this.match(
|
|
29919
|
+
if (canBeArrow && this.match(15) && !this.canInsertSemicolon()) {
|
|
29939
29920
|
this.next();
|
|
29940
29921
|
return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);
|
|
29941
29922
|
}
|
|
@@ -30010,7 +29991,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30010
29991
|
this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition());
|
|
30011
29992
|
}
|
|
30012
29993
|
|
|
30013
|
-
this.expect(
|
|
29994
|
+
this.expect(15);
|
|
30014
29995
|
return this.parseArrowExpression(node, params, true);
|
|
30015
29996
|
}
|
|
30016
29997
|
|
|
@@ -30043,13 +30024,13 @@ var ExpressionParser = class extends LValParser {
|
|
|
30043
30024
|
const node = this.startNode();
|
|
30044
30025
|
this.next();
|
|
30045
30026
|
|
|
30046
|
-
if (this.match(
|
|
30027
|
+
if (this.match(6) && !this.scope.allowDirectSuper) {
|
|
30047
30028
|
this.raise(Errors.SuperNotAllowed, node);
|
|
30048
30029
|
} else if (!this.scope.allowSuper) {
|
|
30049
30030
|
this.raise(Errors.UnexpectedSuper, node);
|
|
30050
30031
|
}
|
|
30051
30032
|
|
|
30052
|
-
if (!this.match(
|
|
30033
|
+
if (!this.match(6) && !this.match(0) && !this.match(12)) {
|
|
30053
30034
|
this.raise(Errors.UnsupportedSuper, node);
|
|
30054
30035
|
}
|
|
30055
30036
|
|
|
@@ -30070,11 +30051,11 @@ var ExpressionParser = class extends LValParser {
|
|
|
30070
30051
|
const node = this.startNode();
|
|
30071
30052
|
this.next();
|
|
30072
30053
|
|
|
30073
|
-
if (this.prodParam.hasYield && this.match(
|
|
30054
|
+
if (this.prodParam.hasYield && this.match(12)) {
|
|
30074
30055
|
const meta = this.createIdentifier(this.startNodeAtNode(node), 'function');
|
|
30075
30056
|
this.next();
|
|
30076
30057
|
|
|
30077
|
-
if (this.match(
|
|
30058
|
+
if (this.match(99)) {
|
|
30078
30059
|
this.expectPlugin('functionSent');
|
|
30079
30060
|
} else if (!this.hasPlugin('functionSent')) {
|
|
30080
30061
|
this.unexpected();
|
|
@@ -30105,8 +30086,8 @@ var ExpressionParser = class extends LValParser {
|
|
|
30105
30086
|
parseImportMetaPropertyOrPhaseCall(node) {
|
|
30106
30087
|
this.next();
|
|
30107
30088
|
|
|
30108
|
-
if (this.isContextual(
|
|
30109
|
-
const isSource = this.isContextual(
|
|
30089
|
+
if (this.isContextual(101) || this.isContextual(93)) {
|
|
30090
|
+
const isSource = this.isContextual(101);
|
|
30110
30091
|
this.expectPlugin(isSource ? 'sourcePhaseImports' : 'deferredImportEvaluation');
|
|
30111
30092
|
this.next();
|
|
30112
30093
|
node.phase = isSource ? 'source' : 'defer';
|
|
@@ -30114,7 +30095,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30114
30095
|
} else {
|
|
30115
30096
|
const id = this.createIdentifierAt(this.startNodeAtNode(node), 'import', this.state.lastTokStartLoc);
|
|
30116
30097
|
|
|
30117
|
-
if (this.isContextual(
|
|
30098
|
+
if (this.isContextual(97)) {
|
|
30118
30099
|
if (!this.inModule) {
|
|
30119
30100
|
this.raise(Errors.ImportMetaOutsideModule, id);
|
|
30120
30101
|
}
|
|
@@ -30202,19 +30183,19 @@ var ExpressionParser = class extends LValParser {
|
|
|
30202
30183
|
let spreadStartLoc;
|
|
30203
30184
|
let optionalCommaStartLoc;
|
|
30204
30185
|
|
|
30205
|
-
while (!this.match(
|
|
30186
|
+
while (!this.match(7)) {
|
|
30206
30187
|
if (first) {
|
|
30207
30188
|
first = false;
|
|
30208
30189
|
} else {
|
|
30209
|
-
this.expect(
|
|
30190
|
+
this.expect(8, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc);
|
|
30210
30191
|
|
|
30211
|
-
if (this.match(
|
|
30192
|
+
if (this.match(7)) {
|
|
30212
30193
|
optionalCommaStartLoc = this.state.startLoc;
|
|
30213
30194
|
break;
|
|
30214
30195
|
}
|
|
30215
30196
|
}
|
|
30216
30197
|
|
|
30217
|
-
if (this.match(
|
|
30198
|
+
if (this.match(17)) {
|
|
30218
30199
|
const spreadNodeStartLoc = this.state.startLoc;
|
|
30219
30200
|
|
|
30220
30201
|
spreadStartLoc = this.state.startLoc;
|
|
@@ -30228,7 +30209,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30228
30209
|
}
|
|
30229
30210
|
} else {
|
|
30230
30211
|
exprList.push(this.parseMaybeAssignAllowInOrVoidPattern(
|
|
30231
|
-
|
|
30212
|
+
7,
|
|
30232
30213
|
refExpressionErrors,
|
|
30233
30214
|
this.parseParenItem,
|
|
30234
30215
|
));
|
|
@@ -30236,7 +30217,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30236
30217
|
}
|
|
30237
30218
|
|
|
30238
30219
|
const innerEndLoc = this.state.lastTokEndLoc;
|
|
30239
|
-
this.expect(
|
|
30220
|
+
this.expect(7);
|
|
30240
30221
|
this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
|
|
30241
30222
|
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
30242
30223
|
let arrowNode = this.startNodeAt(startLoc);
|
|
@@ -30295,7 +30276,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30295
30276
|
}
|
|
30296
30277
|
|
|
30297
30278
|
parseArrow(node) {
|
|
30298
|
-
if (this.eat(
|
|
30279
|
+
if (this.eat(15)) {
|
|
30299
30280
|
return node;
|
|
30300
30281
|
}
|
|
30301
30282
|
}
|
|
@@ -30308,7 +30289,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30308
30289
|
const node = this.startNode();
|
|
30309
30290
|
this.next();
|
|
30310
30291
|
|
|
30311
|
-
if (this.match(
|
|
30292
|
+
if (this.match(12)) {
|
|
30312
30293
|
const meta = this.createIdentifier(this.startNodeAtNode(node), 'new');
|
|
30313
30294
|
this.next();
|
|
30314
30295
|
const metaProp = this.parseMetaProperty(node, meta, 'target');
|
|
@@ -30326,8 +30307,8 @@ var ExpressionParser = class extends LValParser {
|
|
|
30326
30307
|
parseNew(node) {
|
|
30327
30308
|
this.parseNewCallee(node);
|
|
30328
30309
|
|
|
30329
|
-
if (this.eat(
|
|
30330
|
-
const args = this.parseExprList(
|
|
30310
|
+
if (this.eat(6)) {
|
|
30311
|
+
const args = this.parseExprList(7);
|
|
30331
30312
|
this.toReferencedList(args);
|
|
30332
30313
|
node.arguments = args;
|
|
30333
30314
|
} else {
|
|
@@ -30338,7 +30319,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30338
30319
|
}
|
|
30339
30320
|
|
|
30340
30321
|
parseNewCallee(node) {
|
|
30341
|
-
const isImport2 = this.match(
|
|
30322
|
+
const isImport2 = this.match(79);
|
|
30342
30323
|
const callee = this.parseNoCallExpr();
|
|
30343
30324
|
|
|
30344
30325
|
node.callee = callee;
|
|
@@ -30365,7 +30346,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30365
30346
|
}
|
|
30366
30347
|
}
|
|
30367
30348
|
|
|
30368
|
-
const isTail = this.match(
|
|
30349
|
+
const isTail = this.match(20);
|
|
30369
30350
|
const endOffset = isTail ? -1 : -2;
|
|
30370
30351
|
const elemEnd = end + endOffset;
|
|
30371
30352
|
|
|
@@ -30418,7 +30399,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30418
30399
|
if (first) {
|
|
30419
30400
|
first = false;
|
|
30420
30401
|
} else {
|
|
30421
|
-
this.expect(
|
|
30402
|
+
this.expect(8);
|
|
30422
30403
|
|
|
30423
30404
|
if (this.match(close)) {
|
|
30424
30405
|
this.addTrailingCommaExtraToNode(node);
|
|
@@ -30454,18 +30435,18 @@ var ExpressionParser = class extends LValParser {
|
|
|
30454
30435
|
return !prop.computed && prop.key.type === 'Identifier'
|
|
30455
30436
|
&& (this.isLiteralPropertyName()
|
|
30456
30437
|
|| this.match(0)
|
|
30457
|
-
|| this.match(
|
|
30438
|
+
|| this.match(51));
|
|
30458
30439
|
}
|
|
30459
30440
|
|
|
30460
30441
|
parsePropertyDefinition(refExpressionErrors) {
|
|
30461
30442
|
let decorators = [];
|
|
30462
30443
|
|
|
30463
|
-
if (this.match(
|
|
30444
|
+
if (this.match(22)) {
|
|
30464
30445
|
if (this.hasPlugin('decorators')) {
|
|
30465
30446
|
this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc);
|
|
30466
30447
|
}
|
|
30467
30448
|
|
|
30468
|
-
while (this.match(
|
|
30449
|
+
while (this.match(22)) {
|
|
30469
30450
|
decorators.push(this.parseDecorator());
|
|
30470
30451
|
}
|
|
30471
30452
|
}
|
|
@@ -30475,7 +30456,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30475
30456
|
let isAccessor2 = false;
|
|
30476
30457
|
let startLoc;
|
|
30477
30458
|
|
|
30478
|
-
if (this.match(
|
|
30459
|
+
if (this.match(17)) {
|
|
30479
30460
|
if (decorators.length)
|
|
30480
30461
|
this.unexpected();
|
|
30481
30462
|
|
|
@@ -30493,7 +30474,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30493
30474
|
startLoc = this.state.startLoc;
|
|
30494
30475
|
}
|
|
30495
30476
|
|
|
30496
|
-
let isGenerator = this.eat(
|
|
30477
|
+
let isGenerator = this.eat(51);
|
|
30497
30478
|
this.parsePropertyNamePrefixOperator(prop);
|
|
30498
30479
|
const containsEsc = this.state.containsEsc;
|
|
30499
30480
|
this.parsePropertyName(prop, refExpressionErrors);
|
|
@@ -30506,7 +30487,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30506
30487
|
if (keyName === 'async' && !this.hasPrecedingLineBreak()) {
|
|
30507
30488
|
isAsync = true;
|
|
30508
30489
|
this.resetPreviousNodeTrailingComments(key);
|
|
30509
|
-
isGenerator = this.eat(
|
|
30490
|
+
isGenerator = this.eat(51);
|
|
30510
30491
|
this.parsePropertyName(prop);
|
|
30511
30492
|
}
|
|
30512
30493
|
|
|
@@ -30515,7 +30496,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30515
30496
|
this.resetPreviousNodeTrailingComments(key);
|
|
30516
30497
|
prop.kind = keyName;
|
|
30517
30498
|
|
|
30518
|
-
if (this.match(
|
|
30499
|
+
if (this.match(51)) {
|
|
30519
30500
|
isGenerator = true;
|
|
30520
30501
|
this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), {
|
|
30521
30502
|
kind: keyName,
|
|
@@ -30558,7 +30539,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30558
30539
|
return finishedProp;
|
|
30559
30540
|
}
|
|
30560
30541
|
|
|
30561
|
-
if (isAsync || isGenerator || this.match(
|
|
30542
|
+
if (isAsync || isGenerator || this.match(6)) {
|
|
30562
30543
|
if (isPattern3)
|
|
30563
30544
|
this.unexpected();
|
|
30564
30545
|
|
|
@@ -30571,8 +30552,8 @@ var ExpressionParser = class extends LValParser {
|
|
|
30571
30552
|
parseObjectProperty(prop, startLoc, isPattern3, refExpressionErrors) {
|
|
30572
30553
|
prop.shorthand = false;
|
|
30573
30554
|
|
|
30574
|
-
if (this.eat(
|
|
30575
|
-
prop.value = isPattern3 ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowInOrVoidPattern(
|
|
30555
|
+
if (this.eat(10)) {
|
|
30556
|
+
prop.value = isPattern3 ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowInOrVoidPattern(4, refExpressionErrors);
|
|
30576
30557
|
return this.finishObjectProperty(prop);
|
|
30577
30558
|
}
|
|
30578
30559
|
|
|
@@ -30581,7 +30562,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30581
30562
|
|
|
30582
30563
|
if (isPattern3) {
|
|
30583
30564
|
prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key));
|
|
30584
|
-
} else if (this.match(
|
|
30565
|
+
} else if (this.match(25)) {
|
|
30585
30566
|
const shorthandAssignLoc = this.state.startLoc;
|
|
30586
30567
|
|
|
30587
30568
|
if (refExpressionErrors != null) {
|
|
@@ -30619,7 +30600,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30619
30600
|
if (this.eat(0)) {
|
|
30620
30601
|
prop.computed = true;
|
|
30621
30602
|
prop.key = this.parseMaybeAssignAllowIn();
|
|
30622
|
-
this.expect(
|
|
30603
|
+
this.expect(1);
|
|
30623
30604
|
} else {
|
|
30624
30605
|
const {type, value} = this.state;
|
|
30625
30606
|
|
|
@@ -30629,19 +30610,19 @@ var ExpressionParser = class extends LValParser {
|
|
|
30629
30610
|
key = this.parseIdentifier(true);
|
|
30630
30611
|
} else {
|
|
30631
30612
|
switch(type) {
|
|
30632
|
-
case
|
|
30613
|
+
case 131:
|
|
30633
30614
|
key = this.parseNumericLiteral(value);
|
|
30634
30615
|
break;
|
|
30635
30616
|
|
|
30636
|
-
case
|
|
30617
|
+
case 130:
|
|
30637
30618
|
key = this.parseStringLiteral(value);
|
|
30638
30619
|
break;
|
|
30639
30620
|
|
|
30640
|
-
case
|
|
30621
|
+
case 132:
|
|
30641
30622
|
key = this.parseBigIntLiteral(value);
|
|
30642
30623
|
break;
|
|
30643
30624
|
|
|
30644
|
-
case
|
|
30625
|
+
case 134: {
|
|
30645
30626
|
const privateKeyLoc = this.state.startLoc;
|
|
30646
30627
|
|
|
30647
30628
|
if (refExpressionErrors != null) {
|
|
@@ -30663,7 +30644,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30663
30644
|
|
|
30664
30645
|
prop.key = key;
|
|
30665
30646
|
|
|
30666
|
-
if (type !==
|
|
30647
|
+
if (type !== 134) {
|
|
30667
30648
|
prop.computed = false;
|
|
30668
30649
|
}
|
|
30669
30650
|
}
|
|
@@ -30702,7 +30683,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30702
30683
|
this.scope.enter(514 | 4);
|
|
30703
30684
|
let flags = functionFlags(isAsync, false);
|
|
30704
30685
|
|
|
30705
|
-
if (!this.match(
|
|
30686
|
+
if (!this.match(2) && this.prodParam.hasIn) {
|
|
30706
30687
|
flags |= 8;
|
|
30707
30688
|
}
|
|
30708
30689
|
|
|
@@ -30734,7 +30715,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30734
30715
|
}
|
|
30735
30716
|
|
|
30736
30717
|
parseFunctionBody(node, allowExpression, isMethod3 = false) {
|
|
30737
|
-
const isExpression4 = allowExpression && !this.match(
|
|
30718
|
+
const isExpression4 = allowExpression && !this.match(2);
|
|
30738
30719
|
this.expressionScope.enter(newExpressionScope());
|
|
30739
30720
|
|
|
30740
30721
|
if (isExpression4) {
|
|
@@ -30799,7 +30780,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30799
30780
|
if (first) {
|
|
30800
30781
|
first = false;
|
|
30801
30782
|
} else {
|
|
30802
|
-
this.expect(
|
|
30783
|
+
this.expect(8);
|
|
30803
30784
|
|
|
30804
30785
|
if (this.match(close)) {
|
|
30805
30786
|
if (nodeForExtra) {
|
|
@@ -30824,7 +30805,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30824
30805
|
parseExprListItem(close, allowEmpty, refExpressionErrors, allowPlaceholder) {
|
|
30825
30806
|
let elt;
|
|
30826
30807
|
|
|
30827
|
-
if (this.match(
|
|
30808
|
+
if (this.match(8)) {
|
|
30828
30809
|
if (!allowEmpty) {
|
|
30829
30810
|
this.raise(Errors.UnexpectedToken, this.state.curPosition(), {
|
|
30830
30811
|
unexpected: ',',
|
|
@@ -30832,10 +30813,10 @@ var ExpressionParser = class extends LValParser {
|
|
|
30832
30813
|
}
|
|
30833
30814
|
|
|
30834
30815
|
elt = null;
|
|
30835
|
-
} else if (this.match(
|
|
30816
|
+
} else if (this.match(17)) {
|
|
30836
30817
|
const spreadNodeStartLoc = this.state.startLoc;
|
|
30837
30818
|
elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc);
|
|
30838
|
-
} else if (this.match(
|
|
30819
|
+
} else if (this.match(13)) {
|
|
30839
30820
|
this.expectPlugin('partialApplication');
|
|
30840
30821
|
|
|
30841
30822
|
if (!allowPlaceholder) {
|
|
@@ -30885,7 +30866,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30885
30866
|
|
|
30886
30867
|
if (liberal) {
|
|
30887
30868
|
if (tokenIsKeyword2) {
|
|
30888
|
-
this.replaceToken(
|
|
30869
|
+
this.replaceToken(128);
|
|
30889
30870
|
}
|
|
30890
30871
|
} else {
|
|
30891
30872
|
this.checkReservedWord(name, startLoc, tokenIsKeyword2, false);
|
|
@@ -30959,7 +30940,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
30959
30940
|
const node = this.startNodeAt(startLoc);
|
|
30960
30941
|
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node);
|
|
30961
30942
|
|
|
30962
|
-
if (this.eat(
|
|
30943
|
+
if (this.eat(51)) {
|
|
30963
30944
|
this.raise(Errors.ObsoleteAwaitStar, node);
|
|
30964
30945
|
}
|
|
30965
30946
|
|
|
@@ -30984,15 +30965,15 @@ var ExpressionParser = class extends LValParser {
|
|
|
30984
30965
|
|
|
30985
30966
|
const {type} = this.state;
|
|
30986
30967
|
|
|
30987
|
-
return type ===
|
|
30988
|
-
|| type ===
|
|
30968
|
+
return type === 49
|
|
30969
|
+
|| type === 6
|
|
30989
30970
|
|| type === 0
|
|
30990
30971
|
|| tokenIsTemplate(type)
|
|
30991
|
-
|| type ===
|
|
30972
|
+
|| type === 98
|
|
30992
30973
|
&& !this.state.containsEsc
|
|
30993
|
-
|| type ===
|
|
30994
|
-
|| type ===
|
|
30995
|
-
|| this.hasPlugin('v8intrinsic') && type ===
|
|
30974
|
+
|| type === 133
|
|
30975
|
+
|| type === 52
|
|
30976
|
+
|| this.hasPlugin('v8intrinsic') && type === 50;
|
|
30996
30977
|
}
|
|
30997
30978
|
|
|
30998
30979
|
parseYield(startLoc) {
|
|
@@ -31002,16 +30983,16 @@ var ExpressionParser = class extends LValParser {
|
|
|
31002
30983
|
let argument = null;
|
|
31003
30984
|
|
|
31004
30985
|
if (!this.hasPrecedingLineBreak()) {
|
|
31005
|
-
delegating = this.eat(
|
|
30986
|
+
delegating = this.eat(51);
|
|
31006
30987
|
switch(this.state.type) {
|
|
31007
|
-
case 13:
|
|
31008
|
-
case 140:
|
|
31009
|
-
case 8:
|
|
31010
|
-
case 11:
|
|
31011
|
-
case 3:
|
|
31012
30988
|
case 9:
|
|
31013
|
-
case
|
|
31014
|
-
case
|
|
30989
|
+
case 135:
|
|
30990
|
+
case 4:
|
|
30991
|
+
case 7:
|
|
30992
|
+
case 1:
|
|
30993
|
+
case 5:
|
|
30994
|
+
case 10:
|
|
30995
|
+
case 8:
|
|
31015
30996
|
if (!delegating)
|
|
31016
30997
|
break;
|
|
31017
30998
|
|
|
@@ -31030,17 +31011,17 @@ var ExpressionParser = class extends LValParser {
|
|
|
31030
31011
|
node.source = this.parseMaybeAssignAllowIn();
|
|
31031
31012
|
node.options = null;
|
|
31032
31013
|
|
|
31033
|
-
if (this.eat(
|
|
31034
|
-
if (!this.match(
|
|
31014
|
+
if (this.eat(8)) {
|
|
31015
|
+
if (!this.match(7)) {
|
|
31035
31016
|
node.options = this.parseMaybeAssignAllowIn();
|
|
31036
31017
|
|
|
31037
|
-
if (this.eat(
|
|
31018
|
+
if (this.eat(8)) {
|
|
31038
31019
|
this.addTrailingCommaExtraToNode(node.options);
|
|
31039
31020
|
|
|
31040
|
-
if (!this.match(
|
|
31021
|
+
if (!this.match(7)) {
|
|
31041
31022
|
do {
|
|
31042
31023
|
this.parseMaybeAssignAllowIn();
|
|
31043
|
-
} while (this.eat(
|
|
31024
|
+
} while (this.eat(8) && !this.match(7))
|
|
31044
31025
|
this.raise(Errors.ImportCallArity, node);
|
|
31045
31026
|
}
|
|
31046
31027
|
}
|
|
@@ -31049,7 +31030,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
31049
31030
|
}
|
|
31050
31031
|
}
|
|
31051
31032
|
|
|
31052
|
-
this.expect(
|
|
31033
|
+
this.expect(7);
|
|
31053
31034
|
return this.finishNode(node, 'ImportExpression');
|
|
31054
31035
|
}
|
|
31055
31036
|
|
|
@@ -31140,8 +31121,8 @@ var ExpressionParser = class extends LValParser {
|
|
|
31140
31121
|
const node = this.startNode();
|
|
31141
31122
|
this.next();
|
|
31142
31123
|
|
|
31143
|
-
if (!this.match(
|
|
31144
|
-
this.unexpected(null,
|
|
31124
|
+
if (!this.match(2)) {
|
|
31125
|
+
this.unexpected(null, 2);
|
|
31145
31126
|
}
|
|
31146
31127
|
|
|
31147
31128
|
const program3 = this.startNodeAt(this.state.endLoc);
|
|
@@ -31149,7 +31130,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
31149
31130
|
const revertScopes = this.initializeScopes(true);
|
|
31150
31131
|
this.enterInitialScopes();
|
|
31151
31132
|
try {
|
|
31152
|
-
node.body = this.parseProgram(program3,
|
|
31133
|
+
node.body = this.parseProgram(program3, 4, 'module');
|
|
31153
31134
|
} finally {
|
|
31154
31135
|
revertScopes();
|
|
31155
31136
|
}
|
|
@@ -31171,10 +31152,10 @@ var ExpressionParser = class extends LValParser {
|
|
|
31171
31152
|
}
|
|
31172
31153
|
|
|
31173
31154
|
parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, afterLeftParse) {
|
|
31174
|
-
if (refExpressionErrors != null && this.match(
|
|
31155
|
+
if (refExpressionErrors != null && this.match(84)) {
|
|
31175
31156
|
const nextCode = this.lookaheadCharCode();
|
|
31176
31157
|
|
|
31177
|
-
if (nextCode === 44 || nextCode === (close ===
|
|
31158
|
+
if (nextCode === 44 || nextCode === (close === 1 ? 93 : close === 4 ? 125 : 41) || nextCode === 61) {
|
|
31178
31159
|
return this.parseMaybeDefault(this.state.startLoc, this.parseVoidPattern(refExpressionErrors));
|
|
31179
31160
|
}
|
|
31180
31161
|
}
|
|
@@ -31196,7 +31177,7 @@ var switchLabel = {
|
|
|
31196
31177
|
var loneSurrogate = /[\uD800-\uDFFF]/u;
|
|
31197
31178
|
var keywordRelationalOperator = /in(?:stanceof)?/y;
|
|
31198
31179
|
|
|
31199
|
-
function
|
|
31180
|
+
function createExportedTokens(tokens) {
|
|
31200
31181
|
for (let i = 0; i < tokens.length; i++) {
|
|
31201
31182
|
const token = tokens[i];
|
|
31202
31183
|
const {type} = token;
|
|
@@ -31211,11 +31192,11 @@ function babel7CompatTokens(tokens) {
|
|
|
31211
31192
|
|
|
31212
31193
|
var StatementParser = class extends ExpressionParser {
|
|
31213
31194
|
parseTopLevel(file2, program3) {
|
|
31214
|
-
file2.program = this.parseProgram(program3,
|
|
31195
|
+
file2.program = this.parseProgram(program3, 135, this.options.sourceType === 'module' ? 'module' : 'script');
|
|
31215
31196
|
file2.comments = this.comments;
|
|
31216
31197
|
|
|
31217
31198
|
if (this.optionFlags & 256) {
|
|
31218
|
-
file2.tokens =
|
|
31199
|
+
file2.tokens = createExportedTokens(this.tokens);
|
|
31219
31200
|
}
|
|
31220
31201
|
|
|
31221
31202
|
return this.finishNode(file2, 'File');
|
|
@@ -31240,7 +31221,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31240
31221
|
|
|
31241
31222
|
let finishedProgram;
|
|
31242
31223
|
|
|
31243
|
-
if (end ===
|
|
31224
|
+
if (end === 135) {
|
|
31244
31225
|
finishedProgram = this.finishNode(program3, 'Program');
|
|
31245
31226
|
} else {
|
|
31246
31227
|
finishedProgram = this.finishNodeAt(program3, 'Program', createPositionWithColumnOffset(this.state.startLoc, -1));
|
|
@@ -31265,7 +31246,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31265
31246
|
}
|
|
31266
31247
|
|
|
31267
31248
|
parseInterpreterDirective() {
|
|
31268
|
-
if (!this.match(
|
|
31249
|
+
if (!this.match(24)) {
|
|
31269
31250
|
return null;
|
|
31270
31251
|
}
|
|
31271
31252
|
|
|
@@ -31277,7 +31258,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31277
31258
|
}
|
|
31278
31259
|
|
|
31279
31260
|
isLet() {
|
|
31280
|
-
if (!this.isContextual(
|
|
31261
|
+
if (!this.isContextual(96)) {
|
|
31281
31262
|
return false;
|
|
31282
31263
|
}
|
|
31283
31264
|
|
|
@@ -31285,7 +31266,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31285
31266
|
}
|
|
31286
31267
|
|
|
31287
31268
|
isUsing() {
|
|
31288
|
-
if (!this.isContextual(
|
|
31269
|
+
if (!this.isContextual(103)) {
|
|
31289
31270
|
return false;
|
|
31290
31271
|
}
|
|
31291
31272
|
|
|
@@ -31293,7 +31274,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31293
31274
|
}
|
|
31294
31275
|
|
|
31295
31276
|
isForUsing() {
|
|
31296
|
-
if (!this.isContextual(
|
|
31277
|
+
if (!this.isContextual(103)) {
|
|
31297
31278
|
return false;
|
|
31298
31279
|
}
|
|
31299
31280
|
|
|
@@ -31323,7 +31304,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31323
31304
|
}
|
|
31324
31305
|
|
|
31325
31306
|
isAwaitUsing() {
|
|
31326
|
-
if (!this.isContextual(
|
|
31307
|
+
if (!this.isContextual(92)) {
|
|
31327
31308
|
return false;
|
|
31328
31309
|
}
|
|
31329
31310
|
|
|
@@ -31412,7 +31393,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31412
31393
|
parseStatementLike(flags) {
|
|
31413
31394
|
let decorators = null;
|
|
31414
31395
|
|
|
31415
|
-
if (this.match(
|
|
31396
|
+
if (this.match(22)) {
|
|
31416
31397
|
decorators = this.parseDecorators(true);
|
|
31417
31398
|
}
|
|
31418
31399
|
|
|
@@ -31427,22 +31408,22 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31427
31408
|
const topLevel = flags & 1;
|
|
31428
31409
|
|
|
31429
31410
|
switch(startType) {
|
|
31430
|
-
case
|
|
31411
|
+
case 56:
|
|
31431
31412
|
return this.parseBreakContinueStatement(node, true);
|
|
31432
31413
|
|
|
31433
|
-
case
|
|
31414
|
+
case 59:
|
|
31434
31415
|
return this.parseBreakContinueStatement(node, false);
|
|
31435
31416
|
|
|
31436
|
-
case
|
|
31417
|
+
case 60:
|
|
31437
31418
|
return this.parseDebuggerStatement(node);
|
|
31438
31419
|
|
|
31439
|
-
case
|
|
31420
|
+
case 86:
|
|
31440
31421
|
return this.parseDoWhileStatement(node);
|
|
31441
31422
|
|
|
31442
|
-
case
|
|
31423
|
+
case 87:
|
|
31443
31424
|
return this.parseForStatement(node);
|
|
31444
31425
|
|
|
31445
|
-
case
|
|
31426
|
+
case 64:
|
|
31446
31427
|
if (this.lookaheadCharCode() === 46)
|
|
31447
31428
|
break;
|
|
31448
31429
|
|
|
@@ -31452,28 +31433,28 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31452
31433
|
|
|
31453
31434
|
return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration);
|
|
31454
31435
|
|
|
31455
|
-
case
|
|
31436
|
+
case 76:
|
|
31456
31437
|
if (!allowDeclaration)
|
|
31457
31438
|
this.unexpected();
|
|
31458
31439
|
|
|
31459
31440
|
return this.parseClass(this.maybeTakeDecorators(decorators, node), true);
|
|
31460
31441
|
|
|
31461
|
-
case
|
|
31442
|
+
case 65:
|
|
31462
31443
|
return this.parseIfStatement(node);
|
|
31463
31444
|
|
|
31464
|
-
case
|
|
31445
|
+
case 66:
|
|
31465
31446
|
return this.parseReturnStatement(node);
|
|
31466
31447
|
|
|
31467
|
-
case
|
|
31448
|
+
case 67:
|
|
31468
31449
|
return this.parseSwitchStatement(node);
|
|
31469
31450
|
|
|
31470
|
-
case
|
|
31451
|
+
case 68:
|
|
31471
31452
|
return this.parseThrowStatement(node);
|
|
31472
31453
|
|
|
31473
|
-
case
|
|
31454
|
+
case 69:
|
|
31474
31455
|
return this.parseTryStatement(node);
|
|
31475
31456
|
|
|
31476
|
-
case
|
|
31457
|
+
case 92:
|
|
31477
31458
|
if (this.isAwaitUsing()) {
|
|
31478
31459
|
if (!this.allowsUsing()) {
|
|
31479
31460
|
this.raise(Errors.UnexpectedUsingDeclaration, node);
|
|
@@ -31489,7 +31470,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31489
31470
|
|
|
31490
31471
|
break;
|
|
31491
31472
|
|
|
31492
|
-
case
|
|
31473
|
+
case 103:
|
|
31493
31474
|
if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) {
|
|
31494
31475
|
break;
|
|
31495
31476
|
}
|
|
@@ -31502,7 +31483,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31502
31483
|
|
|
31503
31484
|
return this.parseVarStatement(node, 'using');
|
|
31504
31485
|
|
|
31505
|
-
case
|
|
31486
|
+
case 96: {
|
|
31506
31487
|
if (this.state.containsEsc) {
|
|
31507
31488
|
break;
|
|
31508
31489
|
}
|
|
@@ -31520,30 +31501,30 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31520
31501
|
}
|
|
31521
31502
|
}
|
|
31522
31503
|
|
|
31523
|
-
case
|
|
31504
|
+
case 71: {
|
|
31524
31505
|
if (!allowDeclaration) {
|
|
31525
31506
|
this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
|
|
31526
31507
|
}
|
|
31527
31508
|
}
|
|
31528
31509
|
|
|
31529
|
-
case
|
|
31510
|
+
case 70: {
|
|
31530
31511
|
const kind = this.state.value;
|
|
31531
31512
|
return this.parseVarStatement(node, kind);
|
|
31532
31513
|
}
|
|
31533
31514
|
|
|
31534
|
-
case
|
|
31515
|
+
case 88:
|
|
31535
31516
|
return this.parseWhileStatement(node);
|
|
31536
31517
|
|
|
31537
|
-
case
|
|
31518
|
+
case 72:
|
|
31538
31519
|
return this.parseWithStatement(node);
|
|
31539
31520
|
|
|
31540
|
-
case
|
|
31521
|
+
case 2:
|
|
31541
31522
|
return this.parseBlock();
|
|
31542
31523
|
|
|
31543
|
-
case
|
|
31524
|
+
case 9:
|
|
31544
31525
|
return this.parseEmptyStatement(node);
|
|
31545
31526
|
|
|
31546
|
-
case
|
|
31527
|
+
case 79: {
|
|
31547
31528
|
const nextTokenCharCode = this.lookaheadCharCode();
|
|
31548
31529
|
|
|
31549
31530
|
if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
|
|
@@ -31551,7 +31532,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31551
31532
|
}
|
|
31552
31533
|
}
|
|
31553
31534
|
|
|
31554
|
-
case
|
|
31535
|
+
case 78: {
|
|
31555
31536
|
if (!(this.optionFlags & 8) && !topLevel) {
|
|
31556
31537
|
this.raise(Errors.UnexpectedImportExport, this.state.startLoc);
|
|
31557
31538
|
}
|
|
@@ -31559,7 +31540,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31559
31540
|
this.next();
|
|
31560
31541
|
let result;
|
|
31561
31542
|
|
|
31562
|
-
if (startType ===
|
|
31543
|
+
if (startType === 79) {
|
|
31563
31544
|
result = this.parseImport(node);
|
|
31564
31545
|
} else {
|
|
31565
31546
|
result = this.parseExport(node, decorators);
|
|
@@ -31584,7 +31565,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31584
31565
|
const maybeName = this.state.value;
|
|
31585
31566
|
const expr = this.parseExpression();
|
|
31586
31567
|
|
|
31587
|
-
if (tokenIsIdentifier(startType) && expr.type === 'Identifier' && this.eat(
|
|
31568
|
+
if (tokenIsIdentifier(startType) && expr.type === 'Identifier' && this.eat(10)) {
|
|
31588
31569
|
return this.parseLabeledStatement(node, maybeName, expr, flags);
|
|
31589
31570
|
} else {
|
|
31590
31571
|
return this.parseExpressionStatement(node, expr, decorators);
|
|
@@ -31616,7 +31597,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31616
31597
|
}
|
|
31617
31598
|
|
|
31618
31599
|
canHaveLeadingDecorator() {
|
|
31619
|
-
return this.match(
|
|
31600
|
+
return this.match(76);
|
|
31620
31601
|
}
|
|
31621
31602
|
|
|
31622
31603
|
parseDecorators(allowExport) {
|
|
@@ -31624,8 +31605,8 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31624
31605
|
|
|
31625
31606
|
do {
|
|
31626
31607
|
decorators.push(this.parseDecorator());
|
|
31627
|
-
} while (this.match(
|
|
31628
|
-
if (this.match(
|
|
31608
|
+
} while (this.match(22))
|
|
31609
|
+
if (this.match(78)) {
|
|
31629
31610
|
if (!allowExport) {
|
|
31630
31611
|
this.unexpected();
|
|
31631
31612
|
}
|
|
@@ -31645,11 +31626,11 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31645
31626
|
const startLoc = this.state.startLoc;
|
|
31646
31627
|
let expr;
|
|
31647
31628
|
|
|
31648
|
-
if (this.match(
|
|
31629
|
+
if (this.match(6)) {
|
|
31649
31630
|
const startLoc2 = this.state.startLoc;
|
|
31650
31631
|
this.next();
|
|
31651
31632
|
expr = this.parseExpression();
|
|
31652
|
-
this.expect(
|
|
31633
|
+
this.expect(7);
|
|
31653
31634
|
expr = this.wrapParenthesis(startLoc2, expr);
|
|
31654
31635
|
const paramsStartLoc = this.state.startLoc;
|
|
31655
31636
|
|
|
@@ -31660,12 +31641,12 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31660
31641
|
}
|
|
31661
31642
|
} else {
|
|
31662
31643
|
expr = this.parseIdentifier(false);
|
|
31663
|
-
while (this.eat(
|
|
31644
|
+
while (this.eat(12)) {
|
|
31664
31645
|
const node2 = this.startNodeAt(startLoc);
|
|
31665
31646
|
|
|
31666
31647
|
node2.object = expr;
|
|
31667
31648
|
|
|
31668
|
-
if (this.match(
|
|
31649
|
+
if (this.match(134)) {
|
|
31669
31650
|
this.classScope.usePrivateName(this.state.value, this.state.startLoc);
|
|
31670
31651
|
node2.property = this.parsePrivateName();
|
|
31671
31652
|
} else {
|
|
@@ -31686,7 +31667,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31686
31667
|
}
|
|
31687
31668
|
|
|
31688
31669
|
parseMaybeDecoratorArguments(expr, startLoc) {
|
|
31689
|
-
if (this.eat(
|
|
31670
|
+
if (this.eat(6)) {
|
|
31690
31671
|
const node = this.startNodeAt(startLoc);
|
|
31691
31672
|
|
|
31692
31673
|
node.callee = expr;
|
|
@@ -31744,9 +31725,9 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31744
31725
|
}
|
|
31745
31726
|
|
|
31746
31727
|
parseHeaderExpression() {
|
|
31747
|
-
this.expect(
|
|
31728
|
+
this.expect(6);
|
|
31748
31729
|
const val = this.parseExpression();
|
|
31749
|
-
this.expect(
|
|
31730
|
+
this.expect(7);
|
|
31750
31731
|
return val;
|
|
31751
31732
|
}
|
|
31752
31733
|
|
|
@@ -31755,9 +31736,9 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31755
31736
|
this.state.labels.push(loopLabel);
|
|
31756
31737
|
node.body = this.parseStatement();
|
|
31757
31738
|
this.state.labels.pop();
|
|
31758
|
-
this.expect(
|
|
31739
|
+
this.expect(88);
|
|
31759
31740
|
node.test = this.parseHeaderExpression();
|
|
31760
|
-
this.eat(
|
|
31741
|
+
this.eat(9);
|
|
31761
31742
|
return this.finishNode(node, 'DoWhileStatement');
|
|
31762
31743
|
}
|
|
31763
31744
|
|
|
@@ -31766,15 +31747,15 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31766
31747
|
this.state.labels.push(loopLabel);
|
|
31767
31748
|
let awaitAt = null;
|
|
31768
31749
|
|
|
31769
|
-
if (this.isContextual(
|
|
31750
|
+
if (this.isContextual(92) && this.recordAwaitIfAllowed()) {
|
|
31770
31751
|
awaitAt = this.state.startLoc;
|
|
31771
31752
|
this.next();
|
|
31772
31753
|
}
|
|
31773
31754
|
|
|
31774
31755
|
this.scope.enter(0);
|
|
31775
|
-
this.expect(
|
|
31756
|
+
this.expect(6);
|
|
31776
31757
|
|
|
31777
|
-
if (this.match(
|
|
31758
|
+
if (this.match(9)) {
|
|
31778
31759
|
if (awaitAt !== null) {
|
|
31779
31760
|
this.unexpected(awaitAt);
|
|
31780
31761
|
}
|
|
@@ -31782,14 +31763,14 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31782
31763
|
return this.parseFor(node, null);
|
|
31783
31764
|
}
|
|
31784
31765
|
|
|
31785
|
-
const startsWithLet = this.isContextual(
|
|
31766
|
+
const startsWithLet = this.isContextual(96);
|
|
31786
31767
|
|
|
31787
31768
|
{
|
|
31788
31769
|
const startsWithAwaitUsing = this.isAwaitUsing();
|
|
31789
31770
|
const starsWithUsingDeclaration = startsWithAwaitUsing || this.isForUsing();
|
|
31790
31771
|
const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration;
|
|
31791
31772
|
|
|
31792
|
-
if (this.match(
|
|
31773
|
+
if (this.match(70) || this.match(71) || isLetOrUsing) {
|
|
31793
31774
|
const initNode = this.startNode();
|
|
31794
31775
|
let kind;
|
|
31795
31776
|
|
|
@@ -31808,13 +31789,13 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31808
31789
|
this.next();
|
|
31809
31790
|
this.parseVar(initNode, true, kind);
|
|
31810
31791
|
const init2 = this.finishNode(initNode, 'VariableDeclaration');
|
|
31811
|
-
const isForIn = this.match(
|
|
31792
|
+
const isForIn = this.match(54);
|
|
31812
31793
|
|
|
31813
31794
|
if (isForIn && starsWithUsingDeclaration) {
|
|
31814
31795
|
this.raise(Errors.ForInUsing, init2);
|
|
31815
31796
|
}
|
|
31816
31797
|
|
|
31817
|
-
if ((isForIn || this.isContextual(
|
|
31798
|
+
if ((isForIn || this.isContextual(98)) && init2.declarations.length === 1) {
|
|
31818
31799
|
return this.parseForIn(node, init2, awaitAt);
|
|
31819
31800
|
}
|
|
31820
31801
|
|
|
@@ -31825,10 +31806,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31825
31806
|
return this.parseFor(node, init2);
|
|
31826
31807
|
}
|
|
31827
31808
|
}
|
|
31828
|
-
const startsWithAsync = this.isContextual(
|
|
31809
|
+
const startsWithAsync = this.isContextual(91);
|
|
31829
31810
|
const refExpressionErrors = new ExpressionErrors();
|
|
31830
31811
|
const init = this.parseExpression(true, refExpressionErrors);
|
|
31831
|
-
const isForOf = this.isContextual(
|
|
31812
|
+
const isForOf = this.isContextual(98);
|
|
31832
31813
|
|
|
31833
31814
|
if (isForOf) {
|
|
31834
31815
|
if (startsWithLet) {
|
|
@@ -31840,7 +31821,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31840
31821
|
}
|
|
31841
31822
|
}
|
|
31842
31823
|
|
|
31843
|
-
if (isForOf || this.match(
|
|
31824
|
+
if (isForOf || this.match(54)) {
|
|
31844
31825
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
31845
31826
|
this.toAssignable(init, true);
|
|
31846
31827
|
const type = isForOf ? 'ForOfStatement' : 'ForInStatement';
|
|
@@ -31869,7 +31850,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31869
31850
|
this.next();
|
|
31870
31851
|
node.test = this.parseHeaderExpression();
|
|
31871
31852
|
node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration();
|
|
31872
|
-
node.alternate = this.eat(
|
|
31853
|
+
node.alternate = this.eat(62) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null;
|
|
31873
31854
|
return this.finishNode(node, 'IfStatement');
|
|
31874
31855
|
}
|
|
31875
31856
|
|
|
@@ -31894,14 +31875,14 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31894
31875
|
this.next();
|
|
31895
31876
|
node.discriminant = this.parseHeaderExpression();
|
|
31896
31877
|
const cases = node.cases = [];
|
|
31897
|
-
this.expect(
|
|
31878
|
+
this.expect(2);
|
|
31898
31879
|
this.state.labels.push(switchLabel);
|
|
31899
31880
|
this.scope.enter(256);
|
|
31900
31881
|
let cur;
|
|
31901
31882
|
|
|
31902
|
-
for (let sawDefault; !this.match(
|
|
31903
|
-
if (this.match(
|
|
31904
|
-
const isCase = this.match(
|
|
31883
|
+
for (let sawDefault; !this.match(4);) {
|
|
31884
|
+
if (this.match(57) || this.match(61)) {
|
|
31885
|
+
const isCase = this.match(57);
|
|
31905
31886
|
|
|
31906
31887
|
if (cur)
|
|
31907
31888
|
this.finishNode(cur, 'SwitchCase');
|
|
@@ -31921,7 +31902,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31921
31902
|
cur.test = null;
|
|
31922
31903
|
}
|
|
31923
31904
|
|
|
31924
|
-
this.expect(
|
|
31905
|
+
this.expect(10);
|
|
31925
31906
|
} else {
|
|
31926
31907
|
if (cur) {
|
|
31927
31908
|
cur.consequent.push(this.parseStatementListItem());
|
|
@@ -31967,14 +31948,14 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31967
31948
|
node.block = this.parseBlock();
|
|
31968
31949
|
node.handler = null;
|
|
31969
31950
|
|
|
31970
|
-
if (this.match(
|
|
31951
|
+
if (this.match(58)) {
|
|
31971
31952
|
const clause = this.startNode();
|
|
31972
31953
|
this.next();
|
|
31973
31954
|
|
|
31974
|
-
if (this.match(
|
|
31975
|
-
this.expect(
|
|
31955
|
+
if (this.match(6)) {
|
|
31956
|
+
this.expect(6);
|
|
31976
31957
|
clause.param = this.parseCatchClauseParam();
|
|
31977
|
-
this.expect(
|
|
31958
|
+
this.expect(7);
|
|
31978
31959
|
} else {
|
|
31979
31960
|
clause.param = null;
|
|
31980
31961
|
this.scope.enter(0);
|
|
@@ -31985,7 +31966,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
31985
31966
|
node.handler = this.finishNode(clause, 'CatchClause');
|
|
31986
31967
|
}
|
|
31987
31968
|
|
|
31988
|
-
node.finalizer = this.eat(
|
|
31969
|
+
node.finalizer = this.eat(63) ? this.parseBlock() : null;
|
|
31989
31970
|
|
|
31990
31971
|
if (!node.handler && !node.finalizer) {
|
|
31991
31972
|
this.raise(Errors.NoCatchOrFinally, node);
|
|
@@ -32035,7 +32016,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32035
32016
|
}
|
|
32036
32017
|
}
|
|
32037
32018
|
|
|
32038
|
-
const kind = tokenIsLoop(this.state.type) ? 1 : this.match(
|
|
32019
|
+
const kind = tokenIsLoop(this.state.type) ? 1 : this.match(67) ? 2 : null;
|
|
32039
32020
|
|
|
32040
32021
|
for (let i = this.state.labels.length - 1; i >= 0; i--) {
|
|
32041
32022
|
const label = this.state.labels[i];
|
|
@@ -32072,13 +32053,13 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32072
32053
|
this.state.strictErrors.clear();
|
|
32073
32054
|
}
|
|
32074
32055
|
|
|
32075
|
-
this.expect(
|
|
32056
|
+
this.expect(2);
|
|
32076
32057
|
|
|
32077
32058
|
if (createNewLexicalScope) {
|
|
32078
32059
|
this.scope.enter(0);
|
|
32079
32060
|
}
|
|
32080
32061
|
|
|
32081
|
-
this.parseBlockBody(node, allowDirectives, false,
|
|
32062
|
+
this.parseBlockBody(node, allowDirectives, false, 4, afterBlockParse);
|
|
32082
32063
|
|
|
32083
32064
|
if (createNewLexicalScope) {
|
|
32084
32065
|
this.scope.exit();
|
|
@@ -32137,10 +32118,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32137
32118
|
parseFor(node, init) {
|
|
32138
32119
|
node.init = init;
|
|
32139
32120
|
this.semicolon(false);
|
|
32140
|
-
node.test = this.match(
|
|
32121
|
+
node.test = this.match(9) ? null : this.parseExpression();
|
|
32141
32122
|
this.semicolon(false);
|
|
32142
|
-
node.update = this.match(
|
|
32143
|
-
this.expect(
|
|
32123
|
+
node.update = this.match(7) ? null : this.parseExpression();
|
|
32124
|
+
this.expect(7);
|
|
32144
32125
|
node.body = this.parseStatement();
|
|
32145
32126
|
this.scope.exit();
|
|
32146
32127
|
this.state.labels.pop();
|
|
@@ -32148,7 +32129,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32148
32129
|
}
|
|
32149
32130
|
|
|
32150
32131
|
parseForIn(node, init, awaitAt) {
|
|
32151
|
-
const isForIn = this.match(
|
|
32132
|
+
const isForIn = this.match(54);
|
|
32152
32133
|
this.next();
|
|
32153
32134
|
|
|
32154
32135
|
if (isForIn) {
|
|
@@ -32174,7 +32155,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32174
32155
|
|
|
32175
32156
|
node.left = init;
|
|
32176
32157
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
32177
|
-
this.expect(
|
|
32158
|
+
this.expect(7);
|
|
32178
32159
|
node.body = this.parseStatement();
|
|
32179
32160
|
this.scope.exit();
|
|
32180
32161
|
this.state.labels.pop();
|
|
@@ -32188,14 +32169,14 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32188
32169
|
for (;;) {
|
|
32189
32170
|
const decl = this.startNode();
|
|
32190
32171
|
this.parseVarId(decl, kind);
|
|
32191
|
-
decl.init = !this.eat(
|
|
32172
|
+
decl.init = !this.eat(25) ? null : isFor3 ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();
|
|
32192
32173
|
|
|
32193
32174
|
if (decl.init === null && !allowMissingInitializer) {
|
|
32194
|
-
if (decl.id.type !== 'Identifier' && !(isFor3 && (this.match(
|
|
32175
|
+
if (decl.id.type !== 'Identifier' && !(isFor3 && (this.match(54) || this.isContextual(98)))) {
|
|
32195
32176
|
this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
|
|
32196
32177
|
kind: 'destructuring',
|
|
32197
32178
|
});
|
|
32198
|
-
} else if ((kind === 'const' || kind === 'using' || kind === 'await using') && !(this.match(
|
|
32179
|
+
} else if ((kind === 'const' || kind === 'using' || kind === 'await using') && !(this.match(54) || this.isContextual(98))) {
|
|
32199
32180
|
this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, {
|
|
32200
32181
|
kind,
|
|
32201
32182
|
});
|
|
@@ -32204,7 +32185,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32204
32185
|
|
|
32205
32186
|
declarations.push(this.finishNode(decl, 'VariableDeclarator'));
|
|
32206
32187
|
|
|
32207
|
-
if (!this.eat(
|
|
32188
|
+
if (!this.eat(8))
|
|
32208
32189
|
break;
|
|
32209
32190
|
}
|
|
32210
32191
|
|
|
@@ -32242,7 +32223,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32242
32223
|
|
|
32243
32224
|
this.initFunction(node, isAsync);
|
|
32244
32225
|
|
|
32245
|
-
if (this.match(
|
|
32226
|
+
if (this.match(51)) {
|
|
32246
32227
|
if (hangingDeclaration) {
|
|
32247
32228
|
this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc);
|
|
32248
32229
|
}
|
|
@@ -32283,9 +32264,9 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32283
32264
|
}
|
|
32284
32265
|
|
|
32285
32266
|
parseFunctionParams(node, isConstructor) {
|
|
32286
|
-
this.expect(
|
|
32267
|
+
this.expect(6);
|
|
32287
32268
|
this.expressionScope.enter(newParameterDeclarationScope());
|
|
32288
|
-
node.params = this.parseBindingList(
|
|
32269
|
+
node.params = this.parseBindingList(7, 41, 2 | (isConstructor ? 4 : 0));
|
|
32289
32270
|
this.expressionScope.exit();
|
|
32290
32271
|
}
|
|
32291
32272
|
|
|
@@ -32308,11 +32289,11 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32308
32289
|
}
|
|
32309
32290
|
|
|
32310
32291
|
isClassProperty() {
|
|
32311
|
-
return this.match(
|
|
32292
|
+
return this.match(25) || this.match(9) || this.match(4);
|
|
32312
32293
|
}
|
|
32313
32294
|
|
|
32314
32295
|
isClassMethod() {
|
|
32315
|
-
return this.match(
|
|
32296
|
+
return this.match(6);
|
|
32316
32297
|
}
|
|
32317
32298
|
|
|
32318
32299
|
nameIsConstructor(key) {
|
|
@@ -32335,9 +32316,9 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32335
32316
|
const classBody2 = this.startNode();
|
|
32336
32317
|
|
|
32337
32318
|
classBody2.body = [];
|
|
32338
|
-
this.expect(
|
|
32339
|
-
while (!this.match(
|
|
32340
|
-
if (this.eat(
|
|
32319
|
+
this.expect(2);
|
|
32320
|
+
while (!this.match(4)) {
|
|
32321
|
+
if (this.eat(9)) {
|
|
32341
32322
|
if (decorators.length > 0) {
|
|
32342
32323
|
throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc);
|
|
32343
32324
|
}
|
|
@@ -32345,7 +32326,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32345
32326
|
continue;
|
|
32346
32327
|
}
|
|
32347
32328
|
|
|
32348
|
-
if (this.match(
|
|
32329
|
+
if (this.match(22)) {
|
|
32349
32330
|
decorators.push(this.parseDecorator());
|
|
32350
32331
|
continue;
|
|
32351
32332
|
}
|
|
@@ -32403,14 +32384,14 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32403
32384
|
}
|
|
32404
32385
|
|
|
32405
32386
|
parseClassMember(classBody2, member, state) {
|
|
32406
|
-
const isStatic2 = this.isContextual(
|
|
32387
|
+
const isStatic2 = this.isContextual(102);
|
|
32407
32388
|
|
|
32408
32389
|
if (isStatic2) {
|
|
32409
32390
|
if (this.parseClassMemberFromModifier(classBody2, member)) {
|
|
32410
32391
|
return;
|
|
32411
32392
|
}
|
|
32412
32393
|
|
|
32413
|
-
if (this.eat(
|
|
32394
|
+
if (this.eat(2)) {
|
|
32414
32395
|
this.parseClassStaticBlock(classBody2, member);
|
|
32415
32396
|
return;
|
|
32416
32397
|
}
|
|
@@ -32431,9 +32412,9 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32431
32412
|
member.static = isStatic2;
|
|
32432
32413
|
this.parsePropertyNamePrefixOperator(member);
|
|
32433
32414
|
|
|
32434
|
-
if (this.eat(
|
|
32415
|
+
if (this.eat(51)) {
|
|
32435
32416
|
method.kind = 'method';
|
|
32436
|
-
const isPrivateName3 = this.match(
|
|
32417
|
+
const isPrivateName3 = this.match(134);
|
|
32437
32418
|
this.parseClassElementName(method);
|
|
32438
32419
|
this.parsePostMemberNameModifiers(method);
|
|
32439
32420
|
|
|
@@ -32493,14 +32474,14 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32493
32474
|
}
|
|
32494
32475
|
} else if (maybeContextualKw === 'async' && !this.isLineTerminator()) {
|
|
32495
32476
|
this.resetPreviousNodeTrailingComments(key);
|
|
32496
|
-
const isGenerator = this.eat(
|
|
32477
|
+
const isGenerator = this.eat(51);
|
|
32497
32478
|
|
|
32498
32479
|
if (publicMember.optional) {
|
|
32499
32480
|
this.unexpected(maybeQuestionTokenStartLoc);
|
|
32500
32481
|
}
|
|
32501
32482
|
|
|
32502
32483
|
method.kind = 'method';
|
|
32503
|
-
const isPrivate3 = this.match(
|
|
32484
|
+
const isPrivate3 = this.match(134);
|
|
32504
32485
|
this.parseClassElementName(method);
|
|
32505
32486
|
this.parsePostMemberNameModifiers(publicMember);
|
|
32506
32487
|
|
|
@@ -32513,10 +32494,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32513
32494
|
|
|
32514
32495
|
this.pushClassMethod(classBody2, publicMethod, isGenerator, true, false, false);
|
|
32515
32496
|
}
|
|
32516
|
-
} else if ((maybeContextualKw === 'get' || maybeContextualKw === 'set') && !(this.match(
|
|
32497
|
+
} else if ((maybeContextualKw === 'get' || maybeContextualKw === 'set') && !(this.match(51) && this.isLineTerminator())) {
|
|
32517
32498
|
this.resetPreviousNodeTrailingComments(key);
|
|
32518
32499
|
method.kind = maybeContextualKw;
|
|
32519
|
-
const isPrivate3 = this.match(
|
|
32500
|
+
const isPrivate3 = this.match(134);
|
|
32520
32501
|
this.parseClassElementName(publicMethod);
|
|
32521
32502
|
|
|
32522
32503
|
if (isPrivate3) {
|
|
@@ -32533,7 +32514,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32533
32514
|
} else if (maybeContextualKw === 'accessor' && !this.isLineTerminator()) {
|
|
32534
32515
|
this.expectPlugin('decoratorAutoAccessors');
|
|
32535
32516
|
this.resetPreviousNodeTrailingComments(key);
|
|
32536
|
-
const isPrivate3 = this.match(
|
|
32517
|
+
const isPrivate3 = this.match(134);
|
|
32537
32518
|
this.parseClassElementName(publicProp);
|
|
32538
32519
|
this.pushClassAccessorProperty(classBody2, accessorProp, isPrivate3);
|
|
32539
32520
|
} else if (this.isLineTerminator()) {
|
|
@@ -32554,11 +32535,11 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32554
32535
|
parseClassElementName(member) {
|
|
32555
32536
|
const {type, value} = this.state;
|
|
32556
32537
|
|
|
32557
|
-
if ((type ===
|
|
32538
|
+
if ((type === 128 || type === 130) && member.static && value === 'prototype') {
|
|
32558
32539
|
this.raise(Errors.StaticPrototype, this.state.startLoc);
|
|
32559
32540
|
}
|
|
32560
32541
|
|
|
32561
|
-
if (type ===
|
|
32542
|
+
if (type === 134) {
|
|
32562
32543
|
if (value === 'constructor') {
|
|
32563
32544
|
this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
|
|
32564
32545
|
}
|
|
@@ -32580,7 +32561,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32580
32561
|
this.state.labels = [];
|
|
32581
32562
|
this.prodParam.enter(0);
|
|
32582
32563
|
const body = member.body = [];
|
|
32583
|
-
this.parseBlockOrModuleBlockBody(body, void 0, false,
|
|
32564
|
+
this.parseBlockOrModuleBlockBody(body, void 0, false, 4);
|
|
32584
32565
|
this.prodParam.exit();
|
|
32585
32566
|
this.scope.exit();
|
|
32586
32567
|
this.state.labels = oldLabels;
|
|
@@ -32665,7 +32646,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32665
32646
|
this.scope.enter(576 | 16);
|
|
32666
32647
|
this.expressionScope.enter(newExpressionScope());
|
|
32667
32648
|
this.prodParam.enter(0);
|
|
32668
|
-
node.value = this.eat(
|
|
32649
|
+
node.value = this.eat(25) ? this.parseMaybeAssignAllowIn() : null;
|
|
32669
32650
|
this.expressionScope.exit();
|
|
32670
32651
|
this.prodParam.exit();
|
|
32671
32652
|
this.scope.exit();
|
|
@@ -32688,16 +32669,16 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32688
32669
|
}
|
|
32689
32670
|
|
|
32690
32671
|
parseClassSuper(node) {
|
|
32691
|
-
node.superClass = this.eat(
|
|
32672
|
+
node.superClass = this.eat(77) ? this.parseExprSubscripts() : null;
|
|
32692
32673
|
}
|
|
32693
32674
|
|
|
32694
32675
|
parseExport(node, decorators) {
|
|
32695
32676
|
const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true);
|
|
32696
32677
|
const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier);
|
|
32697
|
-
const parseAfterDefault = !hasDefault || this.eat(
|
|
32678
|
+
const parseAfterDefault = !hasDefault || this.eat(8);
|
|
32698
32679
|
const hasStar = parseAfterDefault && this.eatExportStar(node);
|
|
32699
32680
|
const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
|
|
32700
|
-
const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(
|
|
32681
|
+
const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(8));
|
|
32701
32682
|
const isFromRequired = hasDefault || hasStar;
|
|
32702
32683
|
|
|
32703
32684
|
if (hasStar && !hasNamespace) {
|
|
@@ -32716,11 +32697,11 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32716
32697
|
const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
|
|
32717
32698
|
|
|
32718
32699
|
if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) {
|
|
32719
|
-
this.unexpected(null,
|
|
32700
|
+
this.unexpected(null, 2);
|
|
32720
32701
|
}
|
|
32721
32702
|
|
|
32722
32703
|
if (hasNamespace && parseAfterNamespace) {
|
|
32723
|
-
this.unexpected(null,
|
|
32704
|
+
this.unexpected(null, 94);
|
|
32724
32705
|
}
|
|
32725
32706
|
|
|
32726
32707
|
let hasDeclaration;
|
|
@@ -32751,7 +32732,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32751
32732
|
return this.finishNode(node2, 'ExportNamedDeclaration');
|
|
32752
32733
|
}
|
|
32753
32734
|
|
|
32754
|
-
if (this.eat(
|
|
32735
|
+
if (this.eat(61)) {
|
|
32755
32736
|
const node2 = node;
|
|
32756
32737
|
const decl = this.parseExportDefaultExpression();
|
|
32757
32738
|
|
|
@@ -32768,11 +32749,11 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32768
32749
|
return this.finishNode(node2, 'ExportDefaultDeclaration');
|
|
32769
32750
|
}
|
|
32770
32751
|
|
|
32771
|
-
throw this.unexpected(null,
|
|
32752
|
+
throw this.unexpected(null, 2);
|
|
32772
32753
|
}
|
|
32773
32754
|
|
|
32774
32755
|
eatExportStar() {
|
|
32775
|
-
return this.eat(
|
|
32756
|
+
return this.eat(51);
|
|
32776
32757
|
}
|
|
32777
32758
|
|
|
32778
32759
|
maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) {
|
|
@@ -32792,7 +32773,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32792
32773
|
}
|
|
32793
32774
|
|
|
32794
32775
|
maybeParseExportNamespaceSpecifier(node) {
|
|
32795
|
-
if (this.isContextual(
|
|
32776
|
+
if (this.isContextual(89)) {
|
|
32796
32777
|
node.specifiers ?? (node.specifiers = []);
|
|
32797
32778
|
const specifier = this.startNodeAt(this.state.lastTokStartLoc);
|
|
32798
32779
|
this.next();
|
|
@@ -32805,7 +32786,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32805
32786
|
}
|
|
32806
32787
|
|
|
32807
32788
|
maybeParseExportNamedSpecifiers(node) {
|
|
32808
|
-
if (this.match(
|
|
32789
|
+
if (this.match(2)) {
|
|
32809
32790
|
const node2 = node;
|
|
32810
32791
|
|
|
32811
32792
|
if (!node2.specifiers)
|
|
@@ -32835,7 +32816,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32835
32816
|
}
|
|
32836
32817
|
|
|
32837
32818
|
isAsyncFunction() {
|
|
32838
|
-
if (!this.isContextual(
|
|
32819
|
+
if (!this.isContextual(91))
|
|
32839
32820
|
return false;
|
|
32840
32821
|
|
|
32841
32822
|
const next = this.nextTokenInLineStart();
|
|
@@ -32846,7 +32827,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32846
32827
|
parseExportDefaultExpression() {
|
|
32847
32828
|
const expr = this.startNode();
|
|
32848
32829
|
|
|
32849
|
-
if (this.match(
|
|
32830
|
+
if (this.match(64)) {
|
|
32850
32831
|
this.next();
|
|
32851
32832
|
return this.parseFunction(expr, 1 | 4);
|
|
32852
32833
|
} else if (this.isAsyncFunction()) {
|
|
@@ -32855,15 +32836,15 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32855
32836
|
return this.parseFunction(expr, 1 | 4 | 8);
|
|
32856
32837
|
}
|
|
32857
32838
|
|
|
32858
|
-
if (this.match(
|
|
32839
|
+
if (this.match(76)) {
|
|
32859
32840
|
return this.parseClass(expr, true, true);
|
|
32860
32841
|
}
|
|
32861
32842
|
|
|
32862
|
-
if (this.match(
|
|
32843
|
+
if (this.match(22)) {
|
|
32863
32844
|
return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);
|
|
32864
32845
|
}
|
|
32865
32846
|
|
|
32866
|
-
if (this.match(
|
|
32847
|
+
if (this.match(71) || this.match(70) || this.isLet() || this.isUsing() || this.isAwaitUsing()) {
|
|
32867
32848
|
throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc);
|
|
32868
32849
|
}
|
|
32869
32850
|
|
|
@@ -32873,7 +32854,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32873
32854
|
}
|
|
32874
32855
|
|
|
32875
32856
|
parseExportDeclaration() {
|
|
32876
|
-
if (this.match(
|
|
32857
|
+
if (this.match(76)) {
|
|
32877
32858
|
const node2 = this.parseClass(this.startNode(), true, false);
|
|
32878
32859
|
return node2;
|
|
32879
32860
|
}
|
|
@@ -32885,11 +32866,11 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32885
32866
|
const {type} = this.state;
|
|
32886
32867
|
|
|
32887
32868
|
if (tokenIsIdentifier(type)) {
|
|
32888
|
-
if (type ===
|
|
32869
|
+
if (type === 91 && !this.state.containsEsc || type === 96) {
|
|
32889
32870
|
return false;
|
|
32890
32871
|
}
|
|
32891
32872
|
|
|
32892
|
-
if ((type ===
|
|
32873
|
+
if ((type === 126 || type === 125) && !this.state.containsEsc) {
|
|
32893
32874
|
const next2 = this.nextTokenStart();
|
|
32894
32875
|
const nextChar = this.input.charCodeAt(next2);
|
|
32895
32876
|
|
|
@@ -32898,7 +32879,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32898
32879
|
return false;
|
|
32899
32880
|
}
|
|
32900
32881
|
}
|
|
32901
|
-
} else if (!this.match(
|
|
32882
|
+
} else if (!this.match(61)) {
|
|
32902
32883
|
return false;
|
|
32903
32884
|
}
|
|
32904
32885
|
|
|
@@ -32909,7 +32890,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32909
32890
|
return true;
|
|
32910
32891
|
}
|
|
32911
32892
|
|
|
32912
|
-
if (this.match(
|
|
32893
|
+
if (this.match(61) && hasFrom) {
|
|
32913
32894
|
const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));
|
|
32914
32895
|
return nextAfterFrom === 34 || nextAfterFrom === 39;
|
|
32915
32896
|
}
|
|
@@ -32918,7 +32899,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32918
32899
|
}
|
|
32919
32900
|
|
|
32920
32901
|
parseExportFrom(node, expect) {
|
|
32921
|
-
if (this.eatContextual(
|
|
32902
|
+
if (this.eatContextual(94)) {
|
|
32922
32903
|
node.source = this.parseImportSource();
|
|
32923
32904
|
this.checkExport(node);
|
|
32924
32905
|
this.maybeParseImportAttributes(node);
|
|
@@ -32932,7 +32913,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32932
32913
|
shouldParseExportDeclaration() {
|
|
32933
32914
|
const {type} = this.state;
|
|
32934
32915
|
|
|
32935
|
-
if (type ===
|
|
32916
|
+
if (type === 22) {
|
|
32936
32917
|
this.expectOnePlugin(['decorators', 'decorators-legacy']);
|
|
32937
32918
|
|
|
32938
32919
|
if (this.hasPlugin('decorators')) {
|
|
@@ -32950,10 +32931,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
32950
32931
|
return true;
|
|
32951
32932
|
}
|
|
32952
32933
|
|
|
32953
|
-
return type ===
|
|
32954
|
-
|| type ===
|
|
32955
|
-
|| type ===
|
|
32956
|
-
|| type ===
|
|
32934
|
+
return type === 70
|
|
32935
|
+
|| type === 71
|
|
32936
|
+
|| type === 64
|
|
32937
|
+
|| type === 76
|
|
32957
32938
|
|| this.isLet()
|
|
32958
32939
|
|| this.isAsyncFunction();
|
|
32959
32940
|
}
|
|
@@ -33054,19 +33035,19 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33054
33035
|
parseExportSpecifiers(isInTypeExport) {
|
|
33055
33036
|
const nodes2 = [];
|
|
33056
33037
|
let first = true;
|
|
33057
|
-
this.expect(
|
|
33058
|
-
while (!this.eat(
|
|
33038
|
+
this.expect(2);
|
|
33039
|
+
while (!this.eat(4)) {
|
|
33059
33040
|
if (first) {
|
|
33060
33041
|
first = false;
|
|
33061
33042
|
} else {
|
|
33062
|
-
this.expect(
|
|
33043
|
+
this.expect(8);
|
|
33063
33044
|
|
|
33064
|
-
if (this.eat(
|
|
33045
|
+
if (this.eat(4))
|
|
33065
33046
|
break;
|
|
33066
33047
|
}
|
|
33067
33048
|
|
|
33068
|
-
const isMaybeTypeOnly = this.isContextual(
|
|
33069
|
-
const isString = this.match(
|
|
33049
|
+
const isMaybeTypeOnly = this.isContextual(126);
|
|
33050
|
+
const isString = this.match(130);
|
|
33070
33051
|
const node = this.startNode();
|
|
33071
33052
|
|
|
33072
33053
|
node.local = this.parseModuleExportName();
|
|
@@ -33082,7 +33063,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33082
33063
|
}
|
|
33083
33064
|
|
|
33084
33065
|
parseExportSpecifier(node, isString) {
|
|
33085
|
-
if (this.eatContextual(
|
|
33066
|
+
if (this.eatContextual(89)) {
|
|
33086
33067
|
node.exported = this.parseModuleExportName();
|
|
33087
33068
|
} else if (isString) {
|
|
33088
33069
|
node.exported = this.cloneStringLiteral(node.local);
|
|
@@ -33094,7 +33075,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33094
33075
|
}
|
|
33095
33076
|
|
|
33096
33077
|
parseModuleExportName() {
|
|
33097
|
-
if (this.match(
|
|
33078
|
+
if (this.match(130)) {
|
|
33098
33079
|
const result = this.parseStringLiteral(this.state.value);
|
|
33099
33080
|
const surrogate = loneSurrogate.exec(result.value);
|
|
33100
33081
|
|
|
@@ -33130,7 +33111,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33130
33111
|
if (isExport)
|
|
33131
33112
|
return false;
|
|
33132
33113
|
|
|
33133
|
-
return this.isContextual(
|
|
33114
|
+
return this.isContextual(101) || this.isContextual(93);
|
|
33134
33115
|
}
|
|
33135
33116
|
|
|
33136
33117
|
applyImportPhase(node, isExport, phase, loc) {
|
|
@@ -33161,7 +33142,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33161
33142
|
|
|
33162
33143
|
const {type} = this.state;
|
|
33163
33144
|
|
|
33164
|
-
const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !==
|
|
33145
|
+
const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 94 || this.lookaheadCharCode() === 102 : type !== 8;
|
|
33165
33146
|
|
|
33166
33147
|
if (isImportPhase) {
|
|
33167
33148
|
this.applyImportPhase(node, isExport, phaseIdentifierName, phaseIdentifier.loc.start);
|
|
@@ -33175,11 +33156,11 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33175
33156
|
isPrecedingIdImportPhase() {
|
|
33176
33157
|
const {type} = this.state;
|
|
33177
33158
|
|
|
33178
|
-
return tokenIsIdentifier(type) ? type !==
|
|
33159
|
+
return tokenIsIdentifier(type) ? type !== 94 || this.lookaheadCharCode() === 102 : type !== 8;
|
|
33179
33160
|
}
|
|
33180
33161
|
|
|
33181
33162
|
parseImport(node) {
|
|
33182
|
-
if (this.match(
|
|
33163
|
+
if (this.match(130)) {
|
|
33183
33164
|
return this.parseImportSourceAndAttributes(node);
|
|
33184
33165
|
}
|
|
33185
33166
|
|
|
@@ -33189,13 +33170,13 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33189
33170
|
parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) {
|
|
33190
33171
|
node.specifiers = [];
|
|
33191
33172
|
const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier);
|
|
33192
|
-
const parseNext = !hasDefault || this.eat(
|
|
33173
|
+
const parseNext = !hasDefault || this.eat(8);
|
|
33193
33174
|
const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
|
|
33194
33175
|
|
|
33195
33176
|
if (parseNext && !hasStar)
|
|
33196
33177
|
this.parseNamedImportSpecifiers(node);
|
|
33197
33178
|
|
|
33198
|
-
this.expectContextual(
|
|
33179
|
+
this.expectContextual(94);
|
|
33199
33180
|
return this.parseImportSourceAndAttributes(node);
|
|
33200
33181
|
}
|
|
33201
33182
|
|
|
@@ -33210,7 +33191,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33210
33191
|
}
|
|
33211
33192
|
|
|
33212
33193
|
parseImportSource() {
|
|
33213
|
-
if (!this.match(
|
|
33194
|
+
if (!this.match(130))
|
|
33214
33195
|
this.unexpected();
|
|
33215
33196
|
|
|
33216
33197
|
return this.parseExprAtom();
|
|
@@ -33229,12 +33210,12 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33229
33210
|
}
|
|
33230
33211
|
|
|
33231
33212
|
parseImportAttributes() {
|
|
33232
|
-
this.expect(
|
|
33213
|
+
this.expect(2);
|
|
33233
33214
|
const attrs = [];
|
|
33234
33215
|
const attrNames = /* @__PURE__ */new Set();
|
|
33235
33216
|
|
|
33236
33217
|
do {
|
|
33237
|
-
if (this.match(
|
|
33218
|
+
if (this.match(4)) {
|
|
33238
33219
|
break;
|
|
33239
33220
|
}
|
|
33240
33221
|
|
|
@@ -33249,29 +33230,29 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33249
33230
|
|
|
33250
33231
|
attrNames.add(keyName);
|
|
33251
33232
|
|
|
33252
|
-
if (this.match(
|
|
33233
|
+
if (this.match(130)) {
|
|
33253
33234
|
node.key = this.parseStringLiteral(keyName);
|
|
33254
33235
|
} else {
|
|
33255
33236
|
node.key = this.parseIdentifier(true);
|
|
33256
33237
|
}
|
|
33257
33238
|
|
|
33258
|
-
this.expect(
|
|
33239
|
+
this.expect(10);
|
|
33259
33240
|
|
|
33260
|
-
if (!this.match(
|
|
33241
|
+
if (!this.match(130)) {
|
|
33261
33242
|
throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
|
33262
33243
|
}
|
|
33263
33244
|
|
|
33264
33245
|
node.value = this.parseStringLiteral(this.state.value);
|
|
33265
33246
|
attrs.push(this.finishNode(node, 'ImportAttribute'));
|
|
33266
|
-
} while (this.eat(
|
|
33267
|
-
this.expect(
|
|
33247
|
+
} while (this.eat(8))
|
|
33248
|
+
this.expect(4);
|
|
33268
33249
|
return attrs;
|
|
33269
33250
|
}
|
|
33270
33251
|
|
|
33271
33252
|
maybeParseImportAttributes(node) {
|
|
33272
33253
|
let attributes;
|
|
33273
33254
|
|
|
33274
|
-
if (this.match(
|
|
33255
|
+
if (this.match(72)) {
|
|
33275
33256
|
if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) {
|
|
33276
33257
|
return;
|
|
33277
33258
|
}
|
|
@@ -33301,10 +33282,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33301
33282
|
}
|
|
33302
33283
|
|
|
33303
33284
|
maybeParseStarImportSpecifier(node) {
|
|
33304
|
-
if (this.match(
|
|
33285
|
+
if (this.match(51)) {
|
|
33305
33286
|
const specifier = this.startNode();
|
|
33306
33287
|
this.next();
|
|
33307
|
-
this.expectContextual(
|
|
33288
|
+
this.expectContextual(89);
|
|
33308
33289
|
this.parseImportSpecifierLocal(node, specifier, 'ImportNamespaceSpecifier');
|
|
33309
33290
|
return true;
|
|
33310
33291
|
}
|
|
@@ -33314,24 +33295,24 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33314
33295
|
|
|
33315
33296
|
parseNamedImportSpecifiers(node) {
|
|
33316
33297
|
let first = true;
|
|
33317
|
-
this.expect(
|
|
33318
|
-
while (!this.eat(
|
|
33298
|
+
this.expect(2);
|
|
33299
|
+
while (!this.eat(4)) {
|
|
33319
33300
|
if (first) {
|
|
33320
33301
|
first = false;
|
|
33321
33302
|
} else {
|
|
33322
|
-
if (this.eat(
|
|
33303
|
+
if (this.eat(10)) {
|
|
33323
33304
|
throw this.raise(Errors.DestructureNamedImport, this.state.startLoc);
|
|
33324
33305
|
}
|
|
33325
33306
|
|
|
33326
|
-
this.expect(
|
|
33307
|
+
this.expect(8);
|
|
33327
33308
|
|
|
33328
|
-
if (this.eat(
|
|
33309
|
+
if (this.eat(4))
|
|
33329
33310
|
break;
|
|
33330
33311
|
}
|
|
33331
33312
|
|
|
33332
33313
|
const specifier = this.startNode();
|
|
33333
|
-
const importedIsString = this.match(
|
|
33334
|
-
const isMaybeTypeOnly = this.isContextual(
|
|
33314
|
+
const importedIsString = this.match(130);
|
|
33315
|
+
const isMaybeTypeOnly = this.isContextual(126);
|
|
33335
33316
|
|
|
33336
33317
|
specifier.imported = this.parseModuleExportName();
|
|
33337
33318
|
const importSpecifier2 = this.parseImportSpecifier(specifier, importedIsString, node.importKind === 'type' || node.importKind === 'typeof', isMaybeTypeOnly, void 0);
|
|
@@ -33340,7 +33321,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
33340
33321
|
}
|
|
33341
33322
|
|
|
33342
33323
|
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
|
|
33343
|
-
if (this.eatContextual(
|
|
33324
|
+
if (this.eatContextual(89)) {
|
|
33344
33325
|
specifier.local = this.parseIdentifier();
|
|
33345
33326
|
} else {
|
|
33346
33327
|
const {imported} = specifier;
|