@next-core/brick-utils 2.35.0 → 2.35.3
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/CHANGELOG.md +18 -13
- package/dist/index.bundle.js +773 -564
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +773 -564
- package/dist/index.esm.js.map +1 -1
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -3058,40 +3058,6 @@ Object.defineProperty(lib, '__esModule', {
|
|
|
3058
3058
|
value: true
|
|
3059
3059
|
});
|
|
3060
3060
|
|
|
3061
|
-
class Position {
|
|
3062
|
-
constructor(line, col, index) {
|
|
3063
|
-
this.line = void 0;
|
|
3064
|
-
this.column = void 0;
|
|
3065
|
-
this.index = void 0;
|
|
3066
|
-
this.line = line;
|
|
3067
|
-
this.column = col;
|
|
3068
|
-
indexes.set(this, index);
|
|
3069
|
-
}
|
|
3070
|
-
|
|
3071
|
-
}
|
|
3072
|
-
|
|
3073
|
-
class SourceLocation {
|
|
3074
|
-
constructor(start, end) {
|
|
3075
|
-
this.start = void 0;
|
|
3076
|
-
this.end = void 0;
|
|
3077
|
-
this.filename = void 0;
|
|
3078
|
-
this.identifierName = void 0;
|
|
3079
|
-
this.start = start;
|
|
3080
|
-
this.end = end;
|
|
3081
|
-
}
|
|
3082
|
-
|
|
3083
|
-
}
|
|
3084
|
-
|
|
3085
|
-
var indexes = new WeakMap();
|
|
3086
|
-
|
|
3087
|
-
function createPositionWithColumnOffset(position, columnOffset) {
|
|
3088
|
-
var {
|
|
3089
|
-
line,
|
|
3090
|
-
column
|
|
3091
|
-
} = position;
|
|
3092
|
-
return new Position(line, column + columnOffset, indexes.get(position) + columnOffset);
|
|
3093
|
-
}
|
|
3094
|
-
|
|
3095
3061
|
class BaseParser {
|
|
3096
3062
|
constructor() {
|
|
3097
3063
|
this.sawUnambiguousESM = false;
|
|
@@ -3374,6 +3340,7 @@ var ErrorMessages = makeErrorTemplates({
|
|
|
3374
3340
|
ImportCallArity: "`import()` requires exactly %0.",
|
|
3375
3341
|
ImportCallNotNewExpression: "Cannot use new with import(...).",
|
|
3376
3342
|
ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
|
|
3343
|
+
IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
|
|
3377
3344
|
InvalidBigIntLiteral: "Invalid BigIntLiteral.",
|
|
3378
3345
|
InvalidCodePoint: "Code point out of bounds.",
|
|
3379
3346
|
InvalidCoverInitializedName: "Invalid shorthand property initializer.",
|
|
@@ -3538,7 +3505,7 @@ class ParserError extends CommentsParser {
|
|
|
3538
3505
|
params[_key2 - 2] = arguments[_key2];
|
|
3539
3506
|
}
|
|
3540
3507
|
|
|
3541
|
-
var pos =
|
|
3508
|
+
var pos = loc.index;
|
|
3542
3509
|
var message = template.replace(/%(\d+)/g, (_, i) => params[i]) + " (".concat(loc.line, ":").concat(loc.column, ")");
|
|
3543
3510
|
|
|
3544
3511
|
if (this.options.errorRecovery) {
|
|
@@ -3569,7 +3536,7 @@ class ParserError extends CommentsParser {
|
|
|
3569
3536
|
params[_key3 - 3] = arguments[_key3];
|
|
3570
3537
|
}
|
|
3571
3538
|
|
|
3572
|
-
var pos =
|
|
3539
|
+
var pos = loc.index;
|
|
3573
3540
|
var message = errorTemplate.replace(/%(\d+)/g, (_, i) => params[i]) + " (".concat(loc.line, ":").concat(loc.column, ")");
|
|
3574
3541
|
return this._raise(Object.assign({
|
|
3575
3542
|
loc,
|
|
@@ -3591,7 +3558,32 @@ class ParserError extends CommentsParser {
|
|
|
3591
3558
|
|
|
3592
3559
|
}
|
|
3593
3560
|
|
|
3561
|
+
var {
|
|
3562
|
+
defineProperty
|
|
3563
|
+
} = Object;
|
|
3564
|
+
|
|
3565
|
+
var toUnenumerable = (object, key) => defineProperty(object, key, {
|
|
3566
|
+
enumerable: false,
|
|
3567
|
+
value: object[key]
|
|
3568
|
+
});
|
|
3569
|
+
|
|
3570
|
+
function toESTreeLocation(node) {
|
|
3571
|
+
toUnenumerable(node.loc.start, "index");
|
|
3572
|
+
toUnenumerable(node.loc.end, "index");
|
|
3573
|
+
return node;
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3594
3576
|
var estree = superClass => class extends superClass {
|
|
3577
|
+
parse() {
|
|
3578
|
+
var file = toESTreeLocation(super.parse());
|
|
3579
|
+
|
|
3580
|
+
if (this.options.tokens) {
|
|
3581
|
+
file.tokens = file.tokens.map(toESTreeLocation);
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
return file;
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3595
3587
|
parseRegExpLiteral(_ref3) {
|
|
3596
3588
|
var {
|
|
3597
3589
|
pattern,
|
|
@@ -3833,7 +3825,16 @@ var estree = superClass => class extends superClass {
|
|
|
3833
3825
|
var isLHS = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
3834
3826
|
|
|
3835
3827
|
if (node != null && this.isObjectProperty(node)) {
|
|
3836
|
-
|
|
3828
|
+
var {
|
|
3829
|
+
key,
|
|
3830
|
+
value
|
|
3831
|
+
} = node;
|
|
3832
|
+
|
|
3833
|
+
if (this.isPrivateName(key)) {
|
|
3834
|
+
this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
|
|
3835
|
+
}
|
|
3836
|
+
|
|
3837
|
+
this.toAssignable(value, isLHS);
|
|
3837
3838
|
return node;
|
|
3838
3839
|
}
|
|
3839
3840
|
|
|
@@ -3947,6 +3948,16 @@ var estree = superClass => class extends superClass {
|
|
|
3947
3948
|
return node.method || node.kind === "get" || node.kind === "set";
|
|
3948
3949
|
}
|
|
3949
3950
|
|
|
3951
|
+
finishNodeAt(node, type, endLoc) {
|
|
3952
|
+
return toESTreeLocation(super.finishNodeAt(node, type, endLoc));
|
|
3953
|
+
}
|
|
3954
|
+
|
|
3955
|
+
resetEndLocation(node) {
|
|
3956
|
+
var endLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state.lastTokEndLoc;
|
|
3957
|
+
super.resetEndLocation(node, endLoc);
|
|
3958
|
+
toESTreeLocation(node);
|
|
3959
|
+
}
|
|
3960
|
+
|
|
3950
3961
|
};
|
|
3951
3962
|
|
|
3952
3963
|
class TokContext {
|
|
@@ -4175,6 +4186,12 @@ var tt = {
|
|
|
4175
4186
|
prefix,
|
|
4176
4187
|
startsExpr
|
|
4177
4188
|
}),
|
|
4189
|
+
doubleCaret: createToken("^^", {
|
|
4190
|
+
startsExpr
|
|
4191
|
+
}),
|
|
4192
|
+
doubleAt: createToken("@@", {
|
|
4193
|
+
startsExpr
|
|
4194
|
+
}),
|
|
4178
4195
|
pipeline: createBinop("|>", 0),
|
|
4179
4196
|
nullishCoalescing: createBinop("??", 1),
|
|
4180
4197
|
logicalOR: createBinop("||", 1),
|
|
@@ -4187,6 +4204,8 @@ var tt = {
|
|
|
4187
4204
|
gt: createBinop("</>/<=/>=", 7),
|
|
4188
4205
|
relational: createBinop("</>/<=/>=", 7),
|
|
4189
4206
|
bitShift: createBinop("<</>>/>>>", 8),
|
|
4207
|
+
bitShiftL: createBinop("<</>>/>>>", 8),
|
|
4208
|
+
bitShiftR: createBinop("<</>>/>>>", 8),
|
|
4190
4209
|
plusMin: createToken("+/-", {
|
|
4191
4210
|
beforeExpr,
|
|
4192
4211
|
binop: 9,
|
|
@@ -4440,19 +4459,19 @@ var tt = {
|
|
|
4440
4459
|
};
|
|
4441
4460
|
|
|
4442
4461
|
function tokenIsIdentifier(token) {
|
|
4443
|
-
return token >=
|
|
4462
|
+
return token >= 93 && token <= 128;
|
|
4444
4463
|
}
|
|
4445
4464
|
|
|
4446
4465
|
function tokenKeywordOrIdentifierIsKeyword(token) {
|
|
4447
|
-
return token <=
|
|
4466
|
+
return token <= 92;
|
|
4448
4467
|
}
|
|
4449
4468
|
|
|
4450
4469
|
function tokenIsKeywordOrIdentifier(token) {
|
|
4451
|
-
return token >=
|
|
4470
|
+
return token >= 58 && token <= 128;
|
|
4452
4471
|
}
|
|
4453
4472
|
|
|
4454
4473
|
function tokenIsLiteralPropertyName(token) {
|
|
4455
|
-
return token >=
|
|
4474
|
+
return token >= 58 && token <= 132;
|
|
4456
4475
|
}
|
|
4457
4476
|
|
|
4458
4477
|
function tokenComesBeforeExpression(token) {
|
|
@@ -4468,19 +4487,19 @@ function tokenIsAssignment(token) {
|
|
|
4468
4487
|
}
|
|
4469
4488
|
|
|
4470
4489
|
function tokenIsFlowInterfaceOrTypeOrOpaque(token) {
|
|
4471
|
-
return token >=
|
|
4490
|
+
return token >= 125 && token <= 127;
|
|
4472
4491
|
}
|
|
4473
4492
|
|
|
4474
4493
|
function tokenIsLoop(token) {
|
|
4475
|
-
return token >=
|
|
4494
|
+
return token >= 90 && token <= 92;
|
|
4476
4495
|
}
|
|
4477
4496
|
|
|
4478
4497
|
function tokenIsKeyword(token) {
|
|
4479
|
-
return token >=
|
|
4498
|
+
return token >= 58 && token <= 92;
|
|
4480
4499
|
}
|
|
4481
4500
|
|
|
4482
4501
|
function tokenIsOperator(token) {
|
|
4483
|
-
return token >=
|
|
4502
|
+
return token >= 39 && token <= 59;
|
|
4484
4503
|
}
|
|
4485
4504
|
|
|
4486
4505
|
function tokenIsPostfix(token) {
|
|
@@ -4492,11 +4511,11 @@ function tokenIsPrefix(token) {
|
|
|
4492
4511
|
}
|
|
4493
4512
|
|
|
4494
4513
|
function tokenIsTSTypeOperator(token) {
|
|
4495
|
-
return token >=
|
|
4514
|
+
return token >= 117 && token <= 119;
|
|
4496
4515
|
}
|
|
4497
4516
|
|
|
4498
4517
|
function tokenIsTSDeclarationStart(token) {
|
|
4499
|
-
return token >=
|
|
4518
|
+
return token >= 120 && token <= 126;
|
|
4500
4519
|
}
|
|
4501
4520
|
|
|
4502
4521
|
function tokenLabelName(token) {
|
|
@@ -4508,7 +4527,7 @@ function tokenOperatorPrecedence(token) {
|
|
|
4508
4527
|
}
|
|
4509
4528
|
|
|
4510
4529
|
function tokenIsRightAssociative(token) {
|
|
4511
|
-
return token ===
|
|
4530
|
+
return token === 57;
|
|
4512
4531
|
}
|
|
4513
4532
|
|
|
4514
4533
|
function tokenIsTemplate(token) {
|
|
@@ -4536,10 +4555,44 @@ function getExportedToken(token) {
|
|
|
4536
4555
|
}
|
|
4537
4556
|
};
|
|
4538
4557
|
|
|
4539
|
-
tokenTypes[
|
|
4558
|
+
tokenTypes[138].updateContext = context => {
|
|
4540
4559
|
context.push(types.j_expr, types.j_oTag);
|
|
4541
4560
|
};
|
|
4542
4561
|
}
|
|
4562
|
+
|
|
4563
|
+
class Position {
|
|
4564
|
+
constructor(line, col, index) {
|
|
4565
|
+
this.line = void 0;
|
|
4566
|
+
this.column = void 0;
|
|
4567
|
+
this.index = void 0;
|
|
4568
|
+
this.line = line;
|
|
4569
|
+
this.column = col;
|
|
4570
|
+
this.index = index;
|
|
4571
|
+
}
|
|
4572
|
+
|
|
4573
|
+
}
|
|
4574
|
+
|
|
4575
|
+
class SourceLocation {
|
|
4576
|
+
constructor(start, end) {
|
|
4577
|
+
this.start = void 0;
|
|
4578
|
+
this.end = void 0;
|
|
4579
|
+
this.filename = void 0;
|
|
4580
|
+
this.identifierName = void 0;
|
|
4581
|
+
this.start = start;
|
|
4582
|
+
this.end = end;
|
|
4583
|
+
}
|
|
4584
|
+
|
|
4585
|
+
}
|
|
4586
|
+
|
|
4587
|
+
function createPositionWithColumnOffset(position, columnOffset) {
|
|
4588
|
+
var {
|
|
4589
|
+
line,
|
|
4590
|
+
column,
|
|
4591
|
+
index
|
|
4592
|
+
} = position;
|
|
4593
|
+
return new Position(line, column + columnOffset, index + columnOffset);
|
|
4594
|
+
}
|
|
4595
|
+
|
|
4543
4596
|
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
|
|
4544
4597
|
var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
|
|
4545
4598
|
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
@@ -4618,8 +4671,8 @@ function isKeyword(word) {
|
|
|
4618
4671
|
return keywords.has(word);
|
|
4619
4672
|
}
|
|
4620
4673
|
|
|
4621
|
-
function isIteratorStart(current, next) {
|
|
4622
|
-
return current === 64 && next === 64;
|
|
4674
|
+
function isIteratorStart(current, next, next2) {
|
|
4675
|
+
return current === 64 && next === 64 && isIdentifierStart(next2);
|
|
4623
4676
|
}
|
|
4624
4677
|
|
|
4625
4678
|
var reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]);
|
|
@@ -4973,7 +5026,7 @@ class State {
|
|
|
4973
5026
|
this.comments = [];
|
|
4974
5027
|
this.commentStack = [];
|
|
4975
5028
|
this.pos = 0;
|
|
4976
|
-
this.type =
|
|
5029
|
+
this.type = 135;
|
|
4977
5030
|
this.value = null;
|
|
4978
5031
|
this.start = 0;
|
|
4979
5032
|
this.end = 0;
|
|
@@ -5028,7 +5081,7 @@ var _isDigit = function isDigit(code) {
|
|
|
5028
5081
|
return code >= 48 && code <= 57;
|
|
5029
5082
|
};
|
|
5030
5083
|
|
|
5031
|
-
var VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100]);
|
|
5084
|
+
var VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]);
|
|
5032
5085
|
var forbiddenNumericSeparatorSiblings = {
|
|
5033
5086
|
decBinOct: [46, 66, 69, 79, 95, 98, 101, 111],
|
|
5034
5087
|
hex: [46, 88, 95, 120]
|
|
@@ -5176,7 +5229,7 @@ class Tokenizer extends ParserError {
|
|
|
5176
5229
|
if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
|
|
5177
5230
|
|
|
5178
5231
|
if (this.state.pos >= this.length) {
|
|
5179
|
-
this.finishToken(
|
|
5232
|
+
this.finishToken(135);
|
|
5180
5233
|
return;
|
|
5181
5234
|
}
|
|
5182
5235
|
|
|
@@ -5399,10 +5452,10 @@ class Tokenizer extends ParserError {
|
|
|
5399
5452
|
}
|
|
5400
5453
|
} else if (isIdentifierStart(next)) {
|
|
5401
5454
|
++this.state.pos;
|
|
5402
|
-
this.finishToken(
|
|
5455
|
+
this.finishToken(134, this.readWord1(next));
|
|
5403
5456
|
} else if (next === 92) {
|
|
5404
5457
|
++this.state.pos;
|
|
5405
|
-
this.finishToken(
|
|
5458
|
+
this.finishToken(134, this.readWord1());
|
|
5406
5459
|
} else {
|
|
5407
5460
|
this.finishOp(27, 1);
|
|
5408
5461
|
}
|
|
@@ -5431,7 +5484,7 @@ class Tokenizer extends ParserError {
|
|
|
5431
5484
|
if (next === 61) {
|
|
5432
5485
|
this.finishOp(31, 2);
|
|
5433
5486
|
} else {
|
|
5434
|
-
this.finishOp(
|
|
5487
|
+
this.finishOp(56, 1);
|
|
5435
5488
|
}
|
|
5436
5489
|
}
|
|
5437
5490
|
|
|
@@ -5452,14 +5505,14 @@ class Tokenizer extends ParserError {
|
|
|
5452
5505
|
}
|
|
5453
5506
|
|
|
5454
5507
|
readToken_mult_modulo(code) {
|
|
5455
|
-
var type = code === 42 ?
|
|
5508
|
+
var type = code === 42 ? 55 : 54;
|
|
5456
5509
|
var width = 1;
|
|
5457
5510
|
var next = this.input.charCodeAt(this.state.pos + 1);
|
|
5458
5511
|
|
|
5459
5512
|
if (code === 42 && next === 42) {
|
|
5460
5513
|
width++;
|
|
5461
5514
|
next = this.input.charCodeAt(this.state.pos + 2);
|
|
5462
|
-
type =
|
|
5515
|
+
type = 57;
|
|
5463
5516
|
}
|
|
5464
5517
|
|
|
5465
5518
|
if (next === 61 && !this.state.inType) {
|
|
@@ -5477,7 +5530,7 @@ class Tokenizer extends ParserError {
|
|
|
5477
5530
|
if (this.input.charCodeAt(this.state.pos + 2) === 61) {
|
|
5478
5531
|
this.finishOp(30, 3);
|
|
5479
5532
|
} else {
|
|
5480
|
-
this.finishOp(code === 124 ?
|
|
5533
|
+
this.finishOp(code === 124 ? 41 : 42, 2);
|
|
5481
5534
|
}
|
|
5482
5535
|
|
|
5483
5536
|
return;
|
|
@@ -5485,7 +5538,7 @@ class Tokenizer extends ParserError {
|
|
|
5485
5538
|
|
|
5486
5539
|
if (code === 124) {
|
|
5487
5540
|
if (next === 62) {
|
|
5488
|
-
this.finishOp(
|
|
5541
|
+
this.finishOp(39, 2);
|
|
5489
5542
|
return;
|
|
5490
5543
|
}
|
|
5491
5544
|
|
|
@@ -5519,7 +5572,7 @@ class Tokenizer extends ParserError {
|
|
|
5519
5572
|
return;
|
|
5520
5573
|
}
|
|
5521
5574
|
|
|
5522
|
-
this.finishOp(code === 124 ?
|
|
5575
|
+
this.finishOp(code === 124 ? 43 : 45, 1);
|
|
5523
5576
|
}
|
|
5524
5577
|
|
|
5525
5578
|
readToken_caret() {
|
|
@@ -5527,8 +5580,31 @@ class Tokenizer extends ParserError {
|
|
|
5527
5580
|
|
|
5528
5581
|
if (next === 61 && !this.state.inType) {
|
|
5529
5582
|
this.finishOp(32, 2);
|
|
5583
|
+
} else if (next === 94 && this.hasPlugin(["pipelineOperator", {
|
|
5584
|
+
proposal: "hack",
|
|
5585
|
+
topicToken: "^^"
|
|
5586
|
+
}])) {
|
|
5587
|
+
this.finishOp(37, 2);
|
|
5588
|
+
var lookaheadCh = this.input.codePointAt(this.state.pos);
|
|
5589
|
+
|
|
5590
|
+
if (lookaheadCh === 94) {
|
|
5591
|
+
throw this.unexpected();
|
|
5592
|
+
}
|
|
5530
5593
|
} else {
|
|
5531
|
-
this.finishOp(
|
|
5594
|
+
this.finishOp(44, 1);
|
|
5595
|
+
}
|
|
5596
|
+
}
|
|
5597
|
+
|
|
5598
|
+
readToken_atSign() {
|
|
5599
|
+
var next = this.input.charCodeAt(this.state.pos + 1);
|
|
5600
|
+
|
|
5601
|
+
if (next === 64 && this.hasPlugin(["pipelineOperator", {
|
|
5602
|
+
proposal: "hack",
|
|
5603
|
+
topicToken: "@@"
|
|
5604
|
+
}])) {
|
|
5605
|
+
this.finishOp(38, 2);
|
|
5606
|
+
} else {
|
|
5607
|
+
this.finishOp(26, 1);
|
|
5532
5608
|
}
|
|
5533
5609
|
}
|
|
5534
5610
|
|
|
@@ -5543,7 +5619,7 @@ class Tokenizer extends ParserError {
|
|
|
5543
5619
|
if (next === 61) {
|
|
5544
5620
|
this.finishOp(30, 2);
|
|
5545
5621
|
} else {
|
|
5546
|
-
this.finishOp(
|
|
5622
|
+
this.finishOp(53, 1);
|
|
5547
5623
|
}
|
|
5548
5624
|
}
|
|
5549
5625
|
|
|
@@ -5559,16 +5635,16 @@ class Tokenizer extends ParserError {
|
|
|
5559
5635
|
return;
|
|
5560
5636
|
}
|
|
5561
5637
|
|
|
5562
|
-
this.finishOp(
|
|
5638
|
+
this.finishOp(51, 2);
|
|
5563
5639
|
return;
|
|
5564
5640
|
}
|
|
5565
5641
|
|
|
5566
5642
|
if (next === 61) {
|
|
5567
|
-
this.finishOp(
|
|
5643
|
+
this.finishOp(49, 2);
|
|
5568
5644
|
return;
|
|
5569
5645
|
}
|
|
5570
5646
|
|
|
5571
|
-
this.finishOp(
|
|
5647
|
+
this.finishOp(47, 1);
|
|
5572
5648
|
}
|
|
5573
5649
|
|
|
5574
5650
|
readToken_gt() {
|
|
@@ -5585,23 +5661,23 @@ class Tokenizer extends ParserError {
|
|
|
5585
5661
|
return;
|
|
5586
5662
|
}
|
|
5587
5663
|
|
|
5588
|
-
this.finishOp(
|
|
5664
|
+
this.finishOp(52, size);
|
|
5589
5665
|
return;
|
|
5590
5666
|
}
|
|
5591
5667
|
|
|
5592
5668
|
if (next === 61) {
|
|
5593
|
-
this.finishOp(
|
|
5669
|
+
this.finishOp(49, 2);
|
|
5594
5670
|
return;
|
|
5595
5671
|
}
|
|
5596
5672
|
|
|
5597
|
-
this.finishOp(
|
|
5673
|
+
this.finishOp(48, 1);
|
|
5598
5674
|
}
|
|
5599
5675
|
|
|
5600
5676
|
readToken_eq_excl(code) {
|
|
5601
5677
|
var next = this.input.charCodeAt(this.state.pos + 1);
|
|
5602
5678
|
|
|
5603
5679
|
if (next === 61) {
|
|
5604
|
-
this.finishOp(
|
|
5680
|
+
this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
|
|
5605
5681
|
return;
|
|
5606
5682
|
}
|
|
5607
5683
|
|
|
@@ -5622,7 +5698,7 @@ class Tokenizer extends ParserError {
|
|
|
5622
5698
|
if (next2 === 61) {
|
|
5623
5699
|
this.finishOp(30, 3);
|
|
5624
5700
|
} else {
|
|
5625
|
-
this.finishOp(
|
|
5701
|
+
this.finishOp(40, 2);
|
|
5626
5702
|
}
|
|
5627
5703
|
} else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
|
|
5628
5704
|
this.state.pos += 2;
|
|
@@ -5799,8 +5875,7 @@ class Tokenizer extends ParserError {
|
|
|
5799
5875
|
return;
|
|
5800
5876
|
|
|
5801
5877
|
case 64:
|
|
5802
|
-
|
|
5803
|
-
this.finishToken(26);
|
|
5878
|
+
this.readToken_atSign();
|
|
5804
5879
|
return;
|
|
5805
5880
|
|
|
5806
5881
|
case 35:
|
|
@@ -5872,19 +5947,37 @@ class Tokenizer extends ParserError {
|
|
|
5872
5947
|
++pos;
|
|
5873
5948
|
var mods = "";
|
|
5874
5949
|
|
|
5950
|
+
var nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start);
|
|
5951
|
+
|
|
5875
5952
|
while (pos < this.length) {
|
|
5876
5953
|
var cp = this.codePointAtPos(pos);
|
|
5877
5954
|
var char = String.fromCharCode(cp);
|
|
5878
5955
|
|
|
5879
5956
|
if (VALID_REGEX_FLAGS.has(cp)) {
|
|
5957
|
+
if (cp === 118) {
|
|
5958
|
+
this.expectPlugin("regexpUnicodeSets", nextPos());
|
|
5959
|
+
|
|
5960
|
+
if (mods.includes("u")) {
|
|
5961
|
+
this.raise(ErrorMessages.IncompatibleRegExpUVFlags, {
|
|
5962
|
+
at: nextPos()
|
|
5963
|
+
});
|
|
5964
|
+
}
|
|
5965
|
+
} else if (cp === 117) {
|
|
5966
|
+
if (mods.includes("v")) {
|
|
5967
|
+
this.raise(ErrorMessages.IncompatibleRegExpUVFlags, {
|
|
5968
|
+
at: nextPos()
|
|
5969
|
+
});
|
|
5970
|
+
}
|
|
5971
|
+
}
|
|
5972
|
+
|
|
5880
5973
|
if (mods.includes(char)) {
|
|
5881
5974
|
this.raise(ErrorMessages.DuplicateRegExpFlags, {
|
|
5882
|
-
at:
|
|
5975
|
+
at: nextPos()
|
|
5883
5976
|
});
|
|
5884
5977
|
}
|
|
5885
5978
|
} else if (isIdentifierChar(cp) || cp === 92) {
|
|
5886
5979
|
this.raise(ErrorMessages.MalformedRegExpFlags, {
|
|
5887
|
-
at:
|
|
5980
|
+
at: nextPos()
|
|
5888
5981
|
});
|
|
5889
5982
|
} else {
|
|
5890
5983
|
break;
|
|
@@ -5895,7 +5988,7 @@ class Tokenizer extends ParserError {
|
|
|
5895
5988
|
}
|
|
5896
5989
|
|
|
5897
5990
|
this.state.pos = pos;
|
|
5898
|
-
this.finishToken(
|
|
5991
|
+
this.finishToken(133, {
|
|
5899
5992
|
pattern: content,
|
|
5900
5993
|
flags: mods
|
|
5901
5994
|
});
|
|
@@ -6002,12 +6095,12 @@ class Tokenizer extends ParserError {
|
|
|
6002
6095
|
}
|
|
6003
6096
|
|
|
6004
6097
|
if (isBigInt) {
|
|
6005
|
-
var str = this.input.slice(
|
|
6006
|
-
this.finishToken(
|
|
6098
|
+
var str = this.input.slice(startLoc.index, this.state.pos).replace(/[_n]/g, "");
|
|
6099
|
+
this.finishToken(131, str);
|
|
6007
6100
|
return;
|
|
6008
6101
|
}
|
|
6009
6102
|
|
|
6010
|
-
this.finishToken(
|
|
6103
|
+
this.finishToken(130, val);
|
|
6011
6104
|
}
|
|
6012
6105
|
|
|
6013
6106
|
readNumber(startsWithDot) {
|
|
@@ -6104,17 +6197,17 @@ class Tokenizer extends ParserError {
|
|
|
6104
6197
|
var str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
|
|
6105
6198
|
|
|
6106
6199
|
if (isBigInt) {
|
|
6107
|
-
this.finishToken(
|
|
6200
|
+
this.finishToken(131, str);
|
|
6108
6201
|
return;
|
|
6109
6202
|
}
|
|
6110
6203
|
|
|
6111
6204
|
if (isDecimal) {
|
|
6112
|
-
this.finishToken(
|
|
6205
|
+
this.finishToken(132, str);
|
|
6113
6206
|
return;
|
|
6114
6207
|
}
|
|
6115
6208
|
|
|
6116
6209
|
var val = isOctal ? parseInt(str, 8) : parseFloat(str);
|
|
6117
|
-
this.finishToken(
|
|
6210
|
+
this.finishToken(130, val);
|
|
6118
6211
|
}
|
|
6119
6212
|
|
|
6120
6213
|
readCodePoint(throwOnInvalid) {
|
|
@@ -6174,7 +6267,7 @@ class Tokenizer extends ParserError {
|
|
|
6174
6267
|
}
|
|
6175
6268
|
|
|
6176
6269
|
out += this.input.slice(chunkStart, this.state.pos++);
|
|
6177
|
-
this.finishToken(
|
|
6270
|
+
this.finishToken(129, out);
|
|
6178
6271
|
}
|
|
6179
6272
|
|
|
6180
6273
|
readTemplateContinuation() {
|
|
@@ -6255,14 +6348,12 @@ class Tokenizer extends ParserError {
|
|
|
6255
6348
|
}
|
|
6256
6349
|
|
|
6257
6350
|
recordStrictModeErrors(message, loc) {
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
if (this.state.strict && !this.state.strictErrors.has(index)) {
|
|
6351
|
+
if (this.state.strict && !this.state.strictErrors.has(loc.index)) {
|
|
6261
6352
|
this.raise(message, {
|
|
6262
6353
|
at: loc
|
|
6263
6354
|
});
|
|
6264
6355
|
} else {
|
|
6265
|
-
this.state.strictErrors.set(index, {
|
|
6356
|
+
this.state.strictErrors.set(loc.index, {
|
|
6266
6357
|
loc,
|
|
6267
6358
|
message
|
|
6268
6359
|
});
|
|
@@ -6367,7 +6458,7 @@ class Tokenizer extends ParserError {
|
|
|
6367
6458
|
at: codeLoc
|
|
6368
6459
|
});
|
|
6369
6460
|
} else {
|
|
6370
|
-
this.state.pos =
|
|
6461
|
+
this.state.pos = codeLoc.index - 1;
|
|
6371
6462
|
}
|
|
6372
6463
|
}
|
|
6373
6464
|
|
|
@@ -6432,7 +6523,7 @@ class Tokenizer extends ParserError {
|
|
|
6432
6523
|
if (type !== undefined) {
|
|
6433
6524
|
this.finishToken(type, tokenLabelName(type));
|
|
6434
6525
|
} else {
|
|
6435
|
-
this.finishToken(
|
|
6526
|
+
this.finishToken(128, word);
|
|
6436
6527
|
}
|
|
6437
6528
|
}
|
|
6438
6529
|
|
|
@@ -6573,14 +6664,14 @@ class ArrowHeadParsingScope extends ExpressionScope {
|
|
|
6573
6664
|
}
|
|
6574
6665
|
|
|
6575
6666
|
recordDeclarationError(message, loc) {
|
|
6576
|
-
this.errors.set(
|
|
6667
|
+
this.errors.set(loc.index, {
|
|
6577
6668
|
message,
|
|
6578
6669
|
loc
|
|
6579
6670
|
});
|
|
6580
6671
|
}
|
|
6581
6672
|
|
|
6582
6673
|
clearDeclarationError(loc) {
|
|
6583
|
-
this.errors.delete(
|
|
6674
|
+
this.errors.delete(loc.index);
|
|
6584
6675
|
}
|
|
6585
6676
|
|
|
6586
6677
|
iterateErrors(iterator) {
|
|
@@ -6803,11 +6894,11 @@ class UtilParser extends Tokenizer {
|
|
|
6803
6894
|
}
|
|
6804
6895
|
|
|
6805
6896
|
canInsertSemicolon() {
|
|
6806
|
-
return this.match(
|
|
6897
|
+
return this.match(135) || this.match(8) || this.hasPrecedingLineBreak();
|
|
6807
6898
|
}
|
|
6808
6899
|
|
|
6809
6900
|
hasPrecedingLineBreak() {
|
|
6810
|
-
return lineBreak.test(this.input.slice(
|
|
6901
|
+
return lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start));
|
|
6811
6902
|
}
|
|
6812
6903
|
|
|
6813
6904
|
hasFollowingLineBreak() {
|
|
@@ -6834,7 +6925,7 @@ class UtilParser extends Tokenizer {
|
|
|
6834
6925
|
assertNoSpace() {
|
|
6835
6926
|
var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "Unexpected space.";
|
|
6836
6927
|
|
|
6837
|
-
if (this.state.start >
|
|
6928
|
+
if (this.state.start > this.state.lastTokEndLoc.index) {
|
|
6838
6929
|
this.raise({
|
|
6839
6930
|
code: ErrorCodes.SyntaxError,
|
|
6840
6931
|
reasonCode: "UnexpectedSpace",
|
|
@@ -6949,9 +7040,10 @@ class UtilParser extends Tokenizer {
|
|
|
6949
7040
|
var {
|
|
6950
7041
|
shorthandAssignLoc,
|
|
6951
7042
|
doubleProtoLoc,
|
|
7043
|
+
privateKeyLoc,
|
|
6952
7044
|
optionalParametersLoc
|
|
6953
7045
|
} = refExpressionErrors;
|
|
6954
|
-
var hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc;
|
|
7046
|
+
var hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc;
|
|
6955
7047
|
|
|
6956
7048
|
if (!andThrow) {
|
|
6957
7049
|
return hasErrors;
|
|
@@ -6969,6 +7061,12 @@ class UtilParser extends Tokenizer {
|
|
|
6969
7061
|
});
|
|
6970
7062
|
}
|
|
6971
7063
|
|
|
7064
|
+
if (privateKeyLoc != null) {
|
|
7065
|
+
this.raise(ErrorMessages.UnexpectedPrivateField, {
|
|
7066
|
+
at: privateKeyLoc
|
|
7067
|
+
});
|
|
7068
|
+
}
|
|
7069
|
+
|
|
6972
7070
|
if (optionalParametersLoc != null) {
|
|
6973
7071
|
this.unexpected(optionalParametersLoc);
|
|
6974
7072
|
}
|
|
@@ -7041,12 +7139,23 @@ class UtilParser extends Tokenizer {
|
|
|
7041
7139
|
this.prodParam.enter(paramFlags);
|
|
7042
7140
|
}
|
|
7043
7141
|
|
|
7142
|
+
checkDestructuringPrivate(refExpressionErrors) {
|
|
7143
|
+
var {
|
|
7144
|
+
privateKeyLoc
|
|
7145
|
+
} = refExpressionErrors;
|
|
7146
|
+
|
|
7147
|
+
if (privateKeyLoc !== null) {
|
|
7148
|
+
this.expectPlugin("destructuringPrivate", privateKeyLoc);
|
|
7149
|
+
}
|
|
7150
|
+
}
|
|
7151
|
+
|
|
7044
7152
|
}
|
|
7045
7153
|
|
|
7046
7154
|
class ExpressionErrors {
|
|
7047
7155
|
constructor() {
|
|
7048
7156
|
this.shorthandAssignLoc = null;
|
|
7049
7157
|
this.doubleProtoLoc = null;
|
|
7158
|
+
this.privateKeyLoc = null;
|
|
7050
7159
|
this.optionalParametersLoc = null;
|
|
7051
7160
|
}
|
|
7052
7161
|
|
|
@@ -7162,9 +7271,9 @@ class NodeUtils extends UtilParser {
|
|
|
7162
7271
|
|
|
7163
7272
|
finishNodeAt(node, type, endLoc) {
|
|
7164
7273
|
node.type = type;
|
|
7165
|
-
node.end =
|
|
7274
|
+
node.end = endLoc.index;
|
|
7166
7275
|
node.loc.end = endLoc;
|
|
7167
|
-
if (this.options.ranges) node.range[1] =
|
|
7276
|
+
if (this.options.ranges) node.range[1] = endLoc.index;
|
|
7168
7277
|
if (this.options.attachComment) this.processComment(node);
|
|
7169
7278
|
return node;
|
|
7170
7279
|
}
|
|
@@ -7177,9 +7286,9 @@ class NodeUtils extends UtilParser {
|
|
|
7177
7286
|
|
|
7178
7287
|
resetEndLocation(node) {
|
|
7179
7288
|
var endLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.state.lastTokEndLoc;
|
|
7180
|
-
node.end =
|
|
7289
|
+
node.end = endLoc.index;
|
|
7181
7290
|
node.loc.end = endLoc;
|
|
7182
|
-
if (this.options.ranges) node.range[1] =
|
|
7291
|
+
if (this.options.ranges) node.range[1] = endLoc.index;
|
|
7183
7292
|
}
|
|
7184
7293
|
|
|
7185
7294
|
resetStartLocationFromNode(node, locationNode) {
|
|
@@ -7248,7 +7357,7 @@ function hasTypeImportKind(node) {
|
|
|
7248
7357
|
}
|
|
7249
7358
|
|
|
7250
7359
|
function isMaybeDefaultImport(type) {
|
|
7251
|
-
return tokenIsKeywordOrIdentifier(type) && type !==
|
|
7360
|
+
return tokenIsKeywordOrIdentifier(type) && type !== 97;
|
|
7252
7361
|
}
|
|
7253
7362
|
|
|
7254
7363
|
var exportSuggestions = {
|
|
@@ -7290,7 +7399,7 @@ var flow = superClass => class extends superClass {
|
|
|
7290
7399
|
}
|
|
7291
7400
|
|
|
7292
7401
|
finishToken(type, val) {
|
|
7293
|
-
if (type !==
|
|
7402
|
+
if (type !== 129 && type !== 13 && type !== 28) {
|
|
7294
7403
|
if (this.flowPragma === undefined) {
|
|
7295
7404
|
this.flowPragma = null;
|
|
7296
7405
|
}
|
|
@@ -7327,9 +7436,9 @@ var flow = superClass => class extends superClass {
|
|
|
7327
7436
|
var node = this.startNode();
|
|
7328
7437
|
var moduloLoc = this.state.startLoc;
|
|
7329
7438
|
this.next();
|
|
7330
|
-
this.expectContextual(
|
|
7439
|
+
this.expectContextual(107);
|
|
7331
7440
|
|
|
7332
|
-
if (this.state.lastTokStart >
|
|
7441
|
+
if (this.state.lastTokStart > moduloLoc.index + 1) {
|
|
7333
7442
|
this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, {
|
|
7334
7443
|
at: moduloLoc
|
|
7335
7444
|
});
|
|
@@ -7351,14 +7460,14 @@ var flow = superClass => class extends superClass {
|
|
|
7351
7460
|
var type = null;
|
|
7352
7461
|
var predicate = null;
|
|
7353
7462
|
|
|
7354
|
-
if (this.match(
|
|
7463
|
+
if (this.match(54)) {
|
|
7355
7464
|
this.state.inType = oldInType;
|
|
7356
7465
|
predicate = this.flowParsePredicate();
|
|
7357
7466
|
} else {
|
|
7358
7467
|
type = this.flowParseType();
|
|
7359
7468
|
this.state.inType = oldInType;
|
|
7360
7469
|
|
|
7361
|
-
if (this.match(
|
|
7470
|
+
if (this.match(54)) {
|
|
7362
7471
|
predicate = this.flowParsePredicate();
|
|
7363
7472
|
}
|
|
7364
7473
|
}
|
|
@@ -7378,7 +7487,7 @@ var flow = superClass => class extends superClass {
|
|
|
7378
7487
|
var typeNode = this.startNode();
|
|
7379
7488
|
var typeContainer = this.startNode();
|
|
7380
7489
|
|
|
7381
|
-
if (this.match(
|
|
7490
|
+
if (this.match(47)) {
|
|
7382
7491
|
typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
7383
7492
|
} else {
|
|
7384
7493
|
typeNode.typeParameters = null;
|
|
@@ -7400,13 +7509,13 @@ var flow = superClass => class extends superClass {
|
|
|
7400
7509
|
}
|
|
7401
7510
|
|
|
7402
7511
|
flowParseDeclare(node, insideModule) {
|
|
7403
|
-
if (this.match(
|
|
7512
|
+
if (this.match(80)) {
|
|
7404
7513
|
return this.flowParseDeclareClass(node);
|
|
7405
|
-
} else if (this.match(
|
|
7514
|
+
} else if (this.match(68)) {
|
|
7406
7515
|
return this.flowParseDeclareFunction(node);
|
|
7407
|
-
} else if (this.match(
|
|
7516
|
+
} else if (this.match(74)) {
|
|
7408
7517
|
return this.flowParseDeclareVariable(node);
|
|
7409
|
-
} else if (this.eatContextual(
|
|
7518
|
+
} else if (this.eatContextual(123)) {
|
|
7410
7519
|
if (this.match(16)) {
|
|
7411
7520
|
return this.flowParseDeclareModuleExports(node);
|
|
7412
7521
|
} else {
|
|
@@ -7418,13 +7527,13 @@ var flow = superClass => class extends superClass {
|
|
|
7418
7527
|
|
|
7419
7528
|
return this.flowParseDeclareModule(node);
|
|
7420
7529
|
}
|
|
7421
|
-
} else if (this.isContextual(
|
|
7530
|
+
} else if (this.isContextual(126)) {
|
|
7422
7531
|
return this.flowParseDeclareTypeAlias(node);
|
|
7423
|
-
} else if (this.isContextual(
|
|
7532
|
+
} else if (this.isContextual(127)) {
|
|
7424
7533
|
return this.flowParseDeclareOpaqueType(node);
|
|
7425
|
-
} else if (this.isContextual(
|
|
7534
|
+
} else if (this.isContextual(125)) {
|
|
7426
7535
|
return this.flowParseDeclareInterface(node);
|
|
7427
|
-
} else if (this.match(
|
|
7536
|
+
} else if (this.match(82)) {
|
|
7428
7537
|
return this.flowParseDeclareExportDeclaration(node, insideModule);
|
|
7429
7538
|
} else {
|
|
7430
7539
|
throw this.unexpected();
|
|
@@ -7442,7 +7551,7 @@ var flow = superClass => class extends superClass {
|
|
|
7442
7551
|
flowParseDeclareModule(node) {
|
|
7443
7552
|
this.scope.enter(SCOPE_OTHER);
|
|
7444
7553
|
|
|
7445
|
-
if (this.match(
|
|
7554
|
+
if (this.match(129)) {
|
|
7446
7555
|
node.id = this.parseExprAtom();
|
|
7447
7556
|
} else {
|
|
7448
7557
|
node.id = this.parseIdentifier();
|
|
@@ -7455,10 +7564,10 @@ var flow = superClass => class extends superClass {
|
|
|
7455
7564
|
while (!this.match(8)) {
|
|
7456
7565
|
var _bodyNode = this.startNode();
|
|
7457
7566
|
|
|
7458
|
-
if (this.match(
|
|
7567
|
+
if (this.match(83)) {
|
|
7459
7568
|
this.next();
|
|
7460
7569
|
|
|
7461
|
-
if (!this.isContextual(
|
|
7570
|
+
if (!this.isContextual(126) && !this.match(87)) {
|
|
7462
7571
|
this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, {
|
|
7463
7572
|
at: this.state.lastTokStartLoc
|
|
7464
7573
|
});
|
|
@@ -7466,7 +7575,7 @@ var flow = superClass => class extends superClass {
|
|
|
7466
7575
|
|
|
7467
7576
|
this.parseImport(_bodyNode);
|
|
7468
7577
|
} else {
|
|
7469
|
-
this.expectContextual(
|
|
7578
|
+
this.expectContextual(121, FlowErrors.UnsupportedStatementInDeclareModule);
|
|
7470
7579
|
_bodyNode = this.flowParseDeclare(_bodyNode, true);
|
|
7471
7580
|
}
|
|
7472
7581
|
|
|
@@ -7509,10 +7618,10 @@ var flow = superClass => class extends superClass {
|
|
|
7509
7618
|
}
|
|
7510
7619
|
|
|
7511
7620
|
flowParseDeclareExportDeclaration(node, insideModule) {
|
|
7512
|
-
this.expect(
|
|
7621
|
+
this.expect(82);
|
|
7513
7622
|
|
|
7514
|
-
if (this.eat(
|
|
7515
|
-
if (this.match(
|
|
7623
|
+
if (this.eat(65)) {
|
|
7624
|
+
if (this.match(68) || this.match(80)) {
|
|
7516
7625
|
node.declaration = this.flowParseDeclare(this.startNode());
|
|
7517
7626
|
} else {
|
|
7518
7627
|
node.declaration = this.flowParseType();
|
|
@@ -7522,7 +7631,7 @@ var flow = superClass => class extends superClass {
|
|
|
7522
7631
|
node.default = true;
|
|
7523
7632
|
return this.finishNode(node, "DeclareExportDeclaration");
|
|
7524
7633
|
} else {
|
|
7525
|
-
if (this.match(
|
|
7634
|
+
if (this.match(75) || this.isLet() || (this.isContextual(126) || this.isContextual(125)) && !insideModule) {
|
|
7526
7635
|
var label = this.state.value;
|
|
7527
7636
|
var suggestion = exportSuggestions[label];
|
|
7528
7637
|
throw this.raise(FlowErrors.UnsupportedDeclareExportKind, {
|
|
@@ -7530,11 +7639,11 @@ var flow = superClass => class extends superClass {
|
|
|
7530
7639
|
}, label, suggestion);
|
|
7531
7640
|
}
|
|
7532
7641
|
|
|
7533
|
-
if (this.match(
|
|
7642
|
+
if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(127)) {
|
|
7534
7643
|
node.declaration = this.flowParseDeclare(this.startNode());
|
|
7535
7644
|
node.default = false;
|
|
7536
7645
|
return this.finishNode(node, "DeclareExportDeclaration");
|
|
7537
|
-
} else if (this.match(
|
|
7646
|
+
} else if (this.match(55) || this.match(5) || this.isContextual(125) || this.isContextual(126) || this.isContextual(127)) {
|
|
7538
7647
|
node = this.parseExport(node);
|
|
7539
7648
|
|
|
7540
7649
|
if (node.type === "ExportNamedDeclaration") {
|
|
@@ -7553,7 +7662,7 @@ var flow = superClass => class extends superClass {
|
|
|
7553
7662
|
|
|
7554
7663
|
flowParseDeclareModuleExports(node) {
|
|
7555
7664
|
this.next();
|
|
7556
|
-
this.expectContextual(
|
|
7665
|
+
this.expectContextual(108);
|
|
7557
7666
|
node.typeAnnotation = this.flowParseTypeAnnotation();
|
|
7558
7667
|
this.semicolon();
|
|
7559
7668
|
return this.finishNode(node, "DeclareModuleExports");
|
|
@@ -7584,7 +7693,7 @@ var flow = superClass => class extends superClass {
|
|
|
7584
7693
|
node.id = this.flowParseRestrictedIdentifier(!isClass, true);
|
|
7585
7694
|
this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.loc.start);
|
|
7586
7695
|
|
|
7587
|
-
if (this.match(
|
|
7696
|
+
if (this.match(47)) {
|
|
7588
7697
|
node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
7589
7698
|
} else {
|
|
7590
7699
|
node.typeParameters = null;
|
|
@@ -7594,13 +7703,13 @@ var flow = superClass => class extends superClass {
|
|
|
7594
7703
|
node.implements = [];
|
|
7595
7704
|
node.mixins = [];
|
|
7596
7705
|
|
|
7597
|
-
if (this.eat(
|
|
7706
|
+
if (this.eat(81)) {
|
|
7598
7707
|
do {
|
|
7599
7708
|
node.extends.push(this.flowParseInterfaceExtends());
|
|
7600
7709
|
} while (!isClass && this.eat(12));
|
|
7601
7710
|
}
|
|
7602
7711
|
|
|
7603
|
-
if (this.isContextual(
|
|
7712
|
+
if (this.isContextual(114)) {
|
|
7604
7713
|
this.next();
|
|
7605
7714
|
|
|
7606
7715
|
do {
|
|
@@ -7608,7 +7717,7 @@ var flow = superClass => class extends superClass {
|
|
|
7608
7717
|
} while (this.eat(12));
|
|
7609
7718
|
}
|
|
7610
7719
|
|
|
7611
|
-
if (this.isContextual(
|
|
7720
|
+
if (this.isContextual(110)) {
|
|
7612
7721
|
this.next();
|
|
7613
7722
|
|
|
7614
7723
|
do {
|
|
@@ -7629,7 +7738,7 @@ var flow = superClass => class extends superClass {
|
|
|
7629
7738
|
var node = this.startNode();
|
|
7630
7739
|
node.id = this.flowParseQualifiedTypeIdentifier();
|
|
7631
7740
|
|
|
7632
|
-
if (this.match(
|
|
7741
|
+
if (this.match(47)) {
|
|
7633
7742
|
node.typeParameters = this.flowParseTypeParameterInstantiation();
|
|
7634
7743
|
} else {
|
|
7635
7744
|
node.typeParameters = null;
|
|
@@ -7667,7 +7776,7 @@ var flow = superClass => class extends superClass {
|
|
|
7667
7776
|
node.id = this.flowParseRestrictedIdentifier(false, true);
|
|
7668
7777
|
this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);
|
|
7669
7778
|
|
|
7670
|
-
if (this.match(
|
|
7779
|
+
if (this.match(47)) {
|
|
7671
7780
|
node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
7672
7781
|
} else {
|
|
7673
7782
|
node.typeParameters = null;
|
|
@@ -7679,11 +7788,11 @@ var flow = superClass => class extends superClass {
|
|
|
7679
7788
|
}
|
|
7680
7789
|
|
|
7681
7790
|
flowParseOpaqueType(node, declare) {
|
|
7682
|
-
this.expectContextual(
|
|
7791
|
+
this.expectContextual(126);
|
|
7683
7792
|
node.id = this.flowParseRestrictedIdentifier(true, true);
|
|
7684
7793
|
this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);
|
|
7685
7794
|
|
|
7686
|
-
if (this.match(
|
|
7795
|
+
if (this.match(47)) {
|
|
7687
7796
|
node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
7688
7797
|
} else {
|
|
7689
7798
|
node.typeParameters = null;
|
|
@@ -7735,7 +7844,7 @@ var flow = superClass => class extends superClass {
|
|
|
7735
7844
|
node.params = [];
|
|
7736
7845
|
this.state.inType = true;
|
|
7737
7846
|
|
|
7738
|
-
if (this.match(
|
|
7847
|
+
if (this.match(47) || this.match(138)) {
|
|
7739
7848
|
this.next();
|
|
7740
7849
|
} else {
|
|
7741
7850
|
this.unexpected();
|
|
@@ -7751,12 +7860,12 @@ var flow = superClass => class extends superClass {
|
|
|
7751
7860
|
defaultRequired = true;
|
|
7752
7861
|
}
|
|
7753
7862
|
|
|
7754
|
-
if (!this.match(
|
|
7863
|
+
if (!this.match(48)) {
|
|
7755
7864
|
this.expect(12);
|
|
7756
7865
|
}
|
|
7757
|
-
} while (!this.match(
|
|
7866
|
+
} while (!this.match(48));
|
|
7758
7867
|
|
|
7759
|
-
this.expect(
|
|
7868
|
+
this.expect(48);
|
|
7760
7869
|
this.state.inType = oldInType;
|
|
7761
7870
|
return this.finishNode(node, "TypeParameterDeclaration");
|
|
7762
7871
|
}
|
|
@@ -7766,20 +7875,20 @@ var flow = superClass => class extends superClass {
|
|
|
7766
7875
|
var oldInType = this.state.inType;
|
|
7767
7876
|
node.params = [];
|
|
7768
7877
|
this.state.inType = true;
|
|
7769
|
-
this.expect(
|
|
7878
|
+
this.expect(47);
|
|
7770
7879
|
var oldNoAnonFunctionType = this.state.noAnonFunctionType;
|
|
7771
7880
|
this.state.noAnonFunctionType = false;
|
|
7772
7881
|
|
|
7773
|
-
while (!this.match(
|
|
7882
|
+
while (!this.match(48)) {
|
|
7774
7883
|
node.params.push(this.flowParseType());
|
|
7775
7884
|
|
|
7776
|
-
if (!this.match(
|
|
7885
|
+
if (!this.match(48)) {
|
|
7777
7886
|
this.expect(12);
|
|
7778
7887
|
}
|
|
7779
7888
|
}
|
|
7780
7889
|
|
|
7781
7890
|
this.state.noAnonFunctionType = oldNoAnonFunctionType;
|
|
7782
|
-
this.expect(
|
|
7891
|
+
this.expect(48);
|
|
7783
7892
|
this.state.inType = oldInType;
|
|
7784
7893
|
return this.finishNode(node, "TypeParameterInstantiation");
|
|
7785
7894
|
}
|
|
@@ -7789,27 +7898,27 @@ var flow = superClass => class extends superClass {
|
|
|
7789
7898
|
var oldInType = this.state.inType;
|
|
7790
7899
|
node.params = [];
|
|
7791
7900
|
this.state.inType = true;
|
|
7792
|
-
this.expect(
|
|
7901
|
+
this.expect(47);
|
|
7793
7902
|
|
|
7794
|
-
while (!this.match(
|
|
7903
|
+
while (!this.match(48)) {
|
|
7795
7904
|
node.params.push(this.flowParseTypeOrImplicitInstantiation());
|
|
7796
7905
|
|
|
7797
|
-
if (!this.match(
|
|
7906
|
+
if (!this.match(48)) {
|
|
7798
7907
|
this.expect(12);
|
|
7799
7908
|
}
|
|
7800
7909
|
}
|
|
7801
7910
|
|
|
7802
|
-
this.expect(
|
|
7911
|
+
this.expect(48);
|
|
7803
7912
|
this.state.inType = oldInType;
|
|
7804
7913
|
return this.finishNode(node, "TypeParameterInstantiation");
|
|
7805
7914
|
}
|
|
7806
7915
|
|
|
7807
7916
|
flowParseInterfaceType() {
|
|
7808
7917
|
var node = this.startNode();
|
|
7809
|
-
this.expectContextual(
|
|
7918
|
+
this.expectContextual(125);
|
|
7810
7919
|
node.extends = [];
|
|
7811
7920
|
|
|
7812
|
-
if (this.eat(
|
|
7921
|
+
if (this.eat(81)) {
|
|
7813
7922
|
do {
|
|
7814
7923
|
node.extends.push(this.flowParseInterfaceExtends());
|
|
7815
7924
|
} while (this.eat(12));
|
|
@@ -7826,7 +7935,7 @@ var flow = superClass => class extends superClass {
|
|
|
7826
7935
|
}
|
|
7827
7936
|
|
|
7828
7937
|
flowParseObjectPropertyKey() {
|
|
7829
|
-
return this.match(
|
|
7938
|
+
return this.match(130) || this.match(129) ? this.parseExprAtom() : this.parseIdentifier(true);
|
|
7830
7939
|
}
|
|
7831
7940
|
|
|
7832
7941
|
flowParseObjectTypeIndexer(node, isStatic, variance) {
|
|
@@ -7852,7 +7961,7 @@ var flow = superClass => class extends superClass {
|
|
|
7852
7961
|
this.expect(3);
|
|
7853
7962
|
this.expect(3);
|
|
7854
7963
|
|
|
7855
|
-
if (this.match(
|
|
7964
|
+
if (this.match(47) || this.match(10)) {
|
|
7856
7965
|
node.method = true;
|
|
7857
7966
|
node.optional = false;
|
|
7858
7967
|
node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
|
|
@@ -7875,13 +7984,13 @@ var flow = superClass => class extends superClass {
|
|
|
7875
7984
|
node.typeParameters = null;
|
|
7876
7985
|
node.this = null;
|
|
7877
7986
|
|
|
7878
|
-
if (this.match(
|
|
7987
|
+
if (this.match(47)) {
|
|
7879
7988
|
node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
7880
7989
|
}
|
|
7881
7990
|
|
|
7882
7991
|
this.expect(10);
|
|
7883
7992
|
|
|
7884
|
-
if (this.match(
|
|
7993
|
+
if (this.match(78)) {
|
|
7885
7994
|
node.this = this.flowParseFunctionTypeParam(true);
|
|
7886
7995
|
node.this.name = null;
|
|
7887
7996
|
|
|
@@ -7951,7 +8060,7 @@ var flow = superClass => class extends superClass {
|
|
|
7951
8060
|
var inexactStartLoc = null;
|
|
7952
8061
|
var node = this.startNode();
|
|
7953
8062
|
|
|
7954
|
-
if (allowProto && this.isContextual(
|
|
8063
|
+
if (allowProto && this.isContextual(115)) {
|
|
7955
8064
|
var lookahead = this.lookahead();
|
|
7956
8065
|
|
|
7957
8066
|
if (lookahead.type !== 14 && lookahead.type !== 17) {
|
|
@@ -7961,7 +8070,7 @@ var flow = superClass => class extends superClass {
|
|
|
7961
8070
|
}
|
|
7962
8071
|
}
|
|
7963
8072
|
|
|
7964
|
-
if (allowStatic && this.isContextual(
|
|
8073
|
+
if (allowStatic && this.isContextual(104)) {
|
|
7965
8074
|
var _lookahead = this.lookahead();
|
|
7966
8075
|
|
|
7967
8076
|
if (_lookahead.type !== 14 && _lookahead.type !== 17) {
|
|
@@ -7986,7 +8095,7 @@ var flow = superClass => class extends superClass {
|
|
|
7986
8095
|
} else {
|
|
7987
8096
|
nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
|
|
7988
8097
|
}
|
|
7989
|
-
} else if (this.match(10) || this.match(
|
|
8098
|
+
} else if (this.match(10) || this.match(47)) {
|
|
7990
8099
|
if (protoStartLoc != null) {
|
|
7991
8100
|
this.unexpected(protoStartLoc);
|
|
7992
8101
|
}
|
|
@@ -7999,7 +8108,7 @@ var flow = superClass => class extends superClass {
|
|
|
7999
8108
|
} else {
|
|
8000
8109
|
var kind = "init";
|
|
8001
8110
|
|
|
8002
|
-
if (this.isContextual(
|
|
8111
|
+
if (this.isContextual(98) || this.isContextual(103)) {
|
|
8003
8112
|
var _lookahead2 = this.lookahead();
|
|
8004
8113
|
|
|
8005
8114
|
if (tokenIsLiteralPropertyName(_lookahead2.type)) {
|
|
@@ -8087,7 +8196,7 @@ var flow = superClass => class extends superClass {
|
|
|
8087
8196
|
node.kind = kind;
|
|
8088
8197
|
var optional = false;
|
|
8089
8198
|
|
|
8090
|
-
if (this.match(
|
|
8199
|
+
if (this.match(47) || this.match(10)) {
|
|
8091
8200
|
node.method = true;
|
|
8092
8201
|
|
|
8093
8202
|
if (protoStartLoc != null) {
|
|
@@ -8175,7 +8284,7 @@ var flow = superClass => class extends superClass {
|
|
|
8175
8284
|
node.typeParameters = null;
|
|
8176
8285
|
node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);
|
|
8177
8286
|
|
|
8178
|
-
if (this.match(
|
|
8287
|
+
if (this.match(47)) {
|
|
8179
8288
|
node.typeParameters = this.flowParseTypeParameterInstantiation();
|
|
8180
8289
|
}
|
|
8181
8290
|
|
|
@@ -8184,7 +8293,7 @@ var flow = superClass => class extends superClass {
|
|
|
8184
8293
|
|
|
8185
8294
|
flowParseTypeofType() {
|
|
8186
8295
|
var node = this.startNode();
|
|
8187
|
-
this.expect(
|
|
8296
|
+
this.expect(87);
|
|
8188
8297
|
node.argument = this.flowParsePrimaryType();
|
|
8189
8298
|
return this.finishNode(node, "TypeofTypeAnnotation");
|
|
8190
8299
|
}
|
|
@@ -8210,7 +8319,7 @@ var flow = superClass => class extends superClass {
|
|
|
8210
8319
|
var typeAnnotation = null;
|
|
8211
8320
|
var node = this.startNode();
|
|
8212
8321
|
var lh = this.lookahead();
|
|
8213
|
-
var isThis = this.state.type ===
|
|
8322
|
+
var isThis = this.state.type === 78;
|
|
8214
8323
|
|
|
8215
8324
|
if (lh.type === 14 || lh.type === 17) {
|
|
8216
8325
|
if (isThis && !first) {
|
|
@@ -8255,7 +8364,7 @@ var flow = superClass => class extends superClass {
|
|
|
8255
8364
|
var rest = null;
|
|
8256
8365
|
var _this = null;
|
|
8257
8366
|
|
|
8258
|
-
if (this.match(
|
|
8367
|
+
if (this.match(78)) {
|
|
8259
8368
|
_this = this.flowParseFunctionTypeParam(true);
|
|
8260
8369
|
_this.name = null;
|
|
8261
8370
|
|
|
@@ -8347,7 +8456,7 @@ var flow = superClass => class extends superClass {
|
|
|
8347
8456
|
this.state.noAnonFunctionType = oldNoAnonFunctionType;
|
|
8348
8457
|
return type;
|
|
8349
8458
|
|
|
8350
|
-
case
|
|
8459
|
+
case 47:
|
|
8351
8460
|
node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
8352
8461
|
this.expect(10);
|
|
8353
8462
|
tmp = this.flowParseFunctionTypeParams();
|
|
@@ -8363,7 +8472,7 @@ var flow = superClass => class extends superClass {
|
|
|
8363
8472
|
this.next();
|
|
8364
8473
|
|
|
8365
8474
|
if (!this.match(11) && !this.match(21)) {
|
|
8366
|
-
if (tokenIsIdentifier(this.state.type) || this.match(
|
|
8475
|
+
if (tokenIsIdentifier(this.state.type) || this.match(78)) {
|
|
8367
8476
|
var token = this.lookahead().type;
|
|
8368
8477
|
isGroupedType = token !== 17 && token !== 14;
|
|
8369
8478
|
} else {
|
|
@@ -8399,24 +8508,24 @@ var flow = superClass => class extends superClass {
|
|
|
8399
8508
|
node.typeParameters = null;
|
|
8400
8509
|
return this.finishNode(node, "FunctionTypeAnnotation");
|
|
8401
8510
|
|
|
8402
|
-
case
|
|
8511
|
+
case 129:
|
|
8403
8512
|
return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
|
|
8404
8513
|
|
|
8405
|
-
case
|
|
8406
|
-
case
|
|
8407
|
-
node.value = this.match(
|
|
8514
|
+
case 85:
|
|
8515
|
+
case 86:
|
|
8516
|
+
node.value = this.match(85);
|
|
8408
8517
|
this.next();
|
|
8409
8518
|
return this.finishNode(node, "BooleanLiteralTypeAnnotation");
|
|
8410
8519
|
|
|
8411
|
-
case
|
|
8520
|
+
case 53:
|
|
8412
8521
|
if (this.state.value === "-") {
|
|
8413
8522
|
this.next();
|
|
8414
8523
|
|
|
8415
|
-
if (this.match(
|
|
8524
|
+
if (this.match(130)) {
|
|
8416
8525
|
return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node);
|
|
8417
8526
|
}
|
|
8418
8527
|
|
|
8419
|
-
if (this.match(
|
|
8528
|
+
if (this.match(131)) {
|
|
8420
8529
|
return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
|
|
8421
8530
|
}
|
|
8422
8531
|
|
|
@@ -8427,29 +8536,29 @@ var flow = superClass => class extends superClass {
|
|
|
8427
8536
|
|
|
8428
8537
|
throw this.unexpected();
|
|
8429
8538
|
|
|
8430
|
-
case
|
|
8539
|
+
case 130:
|
|
8431
8540
|
return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
|
8432
8541
|
|
|
8433
|
-
case
|
|
8542
|
+
case 131:
|
|
8434
8543
|
return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
|
|
8435
8544
|
|
|
8436
|
-
case
|
|
8545
|
+
case 88:
|
|
8437
8546
|
this.next();
|
|
8438
8547
|
return this.finishNode(node, "VoidTypeAnnotation");
|
|
8439
8548
|
|
|
8440
|
-
case
|
|
8549
|
+
case 84:
|
|
8441
8550
|
this.next();
|
|
8442
8551
|
return this.finishNode(node, "NullLiteralTypeAnnotation");
|
|
8443
8552
|
|
|
8444
|
-
case
|
|
8553
|
+
case 78:
|
|
8445
8554
|
this.next();
|
|
8446
8555
|
return this.finishNode(node, "ThisTypeAnnotation");
|
|
8447
8556
|
|
|
8448
|
-
case
|
|
8557
|
+
case 55:
|
|
8449
8558
|
this.next();
|
|
8450
8559
|
return this.finishNode(node, "ExistsTypeAnnotation");
|
|
8451
8560
|
|
|
8452
|
-
case
|
|
8561
|
+
case 87:
|
|
8453
8562
|
return this.flowParseTypeofType();
|
|
8454
8563
|
|
|
8455
8564
|
default:
|
|
@@ -8458,7 +8567,7 @@ var flow = superClass => class extends superClass {
|
|
|
8458
8567
|
this.next();
|
|
8459
8568
|
return super.createIdentifier(node, label);
|
|
8460
8569
|
} else if (tokenIsIdentifier(this.state.type)) {
|
|
8461
|
-
if (this.isContextual(
|
|
8570
|
+
if (this.isContextual(125)) {
|
|
8462
8571
|
return this.flowParseInterfaceType();
|
|
8463
8572
|
}
|
|
8464
8573
|
|
|
@@ -8532,11 +8641,11 @@ var flow = superClass => class extends superClass {
|
|
|
8532
8641
|
|
|
8533
8642
|
flowParseIntersectionType() {
|
|
8534
8643
|
var node = this.startNode();
|
|
8535
|
-
this.eat(
|
|
8644
|
+
this.eat(45);
|
|
8536
8645
|
var type = this.flowParseAnonFunctionWithoutParens();
|
|
8537
8646
|
node.types = [type];
|
|
8538
8647
|
|
|
8539
|
-
while (this.eat(
|
|
8648
|
+
while (this.eat(45)) {
|
|
8540
8649
|
node.types.push(this.flowParseAnonFunctionWithoutParens());
|
|
8541
8650
|
}
|
|
8542
8651
|
|
|
@@ -8545,11 +8654,11 @@ var flow = superClass => class extends superClass {
|
|
|
8545
8654
|
|
|
8546
8655
|
flowParseUnionType() {
|
|
8547
8656
|
var node = this.startNode();
|
|
8548
|
-
this.eat(
|
|
8657
|
+
this.eat(43);
|
|
8549
8658
|
var type = this.flowParseIntersectionType();
|
|
8550
8659
|
node.types = [type];
|
|
8551
8660
|
|
|
8552
|
-
while (this.eat(
|
|
8661
|
+
while (this.eat(43)) {
|
|
8553
8662
|
node.types.push(this.flowParseIntersectionType());
|
|
8554
8663
|
}
|
|
8555
8664
|
|
|
@@ -8565,7 +8674,7 @@ var flow = superClass => class extends superClass {
|
|
|
8565
8674
|
}
|
|
8566
8675
|
|
|
8567
8676
|
flowParseTypeOrImplicitInstantiation() {
|
|
8568
|
-
if (this.state.type ===
|
|
8677
|
+
if (this.state.type === 128 && this.state.value === "_") {
|
|
8569
8678
|
var startPos = this.state.start;
|
|
8570
8679
|
var startLoc = this.state.startLoc;
|
|
8571
8680
|
var node = this.parseIdentifier();
|
|
@@ -8601,7 +8710,7 @@ var flow = superClass => class extends superClass {
|
|
|
8601
8710
|
flowParseVariance() {
|
|
8602
8711
|
var variance = null;
|
|
8603
8712
|
|
|
8604
|
-
if (this.match(
|
|
8713
|
+
if (this.match(53)) {
|
|
8605
8714
|
variance = this.startNode();
|
|
8606
8715
|
|
|
8607
8716
|
if (this.state.value === "+") {
|
|
@@ -8640,7 +8749,7 @@ var flow = superClass => class extends superClass {
|
|
|
8640
8749
|
}
|
|
8641
8750
|
|
|
8642
8751
|
parseStatement(context, topLevel) {
|
|
8643
|
-
if (this.state.strict && this.isContextual(
|
|
8752
|
+
if (this.state.strict && this.isContextual(125)) {
|
|
8644
8753
|
var lookahead = this.lookahead();
|
|
8645
8754
|
|
|
8646
8755
|
if (tokenIsKeywordOrIdentifier(lookahead.type)) {
|
|
@@ -8648,7 +8757,7 @@ var flow = superClass => class extends superClass {
|
|
|
8648
8757
|
this.next();
|
|
8649
8758
|
return this.flowParseInterface(node);
|
|
8650
8759
|
}
|
|
8651
|
-
} else if (this.shouldParseEnums() && this.isContextual(
|
|
8760
|
+
} else if (this.shouldParseEnums() && this.isContextual(122)) {
|
|
8652
8761
|
var _node = this.startNode();
|
|
8653
8762
|
|
|
8654
8763
|
this.next();
|
|
@@ -8667,7 +8776,7 @@ var flow = superClass => class extends superClass {
|
|
|
8667
8776
|
parseExpressionStatement(node, expr) {
|
|
8668
8777
|
if (expr.type === "Identifier") {
|
|
8669
8778
|
if (expr.name === "declare") {
|
|
8670
|
-
if (this.match(
|
|
8779
|
+
if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) {
|
|
8671
8780
|
return this.flowParseDeclare(node);
|
|
8672
8781
|
}
|
|
8673
8782
|
} else if (tokenIsIdentifier(this.state.type)) {
|
|
@@ -8689,7 +8798,7 @@ var flow = superClass => class extends superClass {
|
|
|
8689
8798
|
type
|
|
8690
8799
|
} = this.state;
|
|
8691
8800
|
|
|
8692
|
-
if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type ===
|
|
8801
|
+
if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 122) {
|
|
8693
8802
|
return !this.state.containsEsc;
|
|
8694
8803
|
}
|
|
8695
8804
|
|
|
@@ -8701,7 +8810,7 @@ var flow = superClass => class extends superClass {
|
|
|
8701
8810
|
type
|
|
8702
8811
|
} = this.state;
|
|
8703
8812
|
|
|
8704
|
-
if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type ===
|
|
8813
|
+
if (tokenIsFlowInterfaceOrTypeOrOpaque(type) || this.shouldParseEnums() && type === 122) {
|
|
8705
8814
|
return this.state.containsEsc;
|
|
8706
8815
|
}
|
|
8707
8816
|
|
|
@@ -8709,7 +8818,7 @@ var flow = superClass => class extends superClass {
|
|
|
8709
8818
|
}
|
|
8710
8819
|
|
|
8711
8820
|
parseExportDefaultExpression() {
|
|
8712
|
-
if (this.shouldParseEnums() && this.isContextual(
|
|
8821
|
+
if (this.shouldParseEnums() && this.isContextual(122)) {
|
|
8713
8822
|
var node = this.startNode();
|
|
8714
8823
|
this.next();
|
|
8715
8824
|
return this.flowParseEnumDeclaration(node);
|
|
@@ -8884,7 +8993,7 @@ var flow = superClass => class extends superClass {
|
|
|
8884
8993
|
}
|
|
8885
8994
|
|
|
8886
8995
|
parseExportDeclaration(node) {
|
|
8887
|
-
if (this.isContextual(
|
|
8996
|
+
if (this.isContextual(126)) {
|
|
8888
8997
|
node.exportKind = "type";
|
|
8889
8998
|
var declarationNode = this.startNode();
|
|
8890
8999
|
this.next();
|
|
@@ -8896,21 +9005,21 @@ var flow = superClass => class extends superClass {
|
|
|
8896
9005
|
} else {
|
|
8897
9006
|
return this.flowParseTypeAlias(declarationNode);
|
|
8898
9007
|
}
|
|
8899
|
-
} else if (this.isContextual(
|
|
9008
|
+
} else if (this.isContextual(127)) {
|
|
8900
9009
|
node.exportKind = "type";
|
|
8901
9010
|
|
|
8902
9011
|
var _declarationNode = this.startNode();
|
|
8903
9012
|
|
|
8904
9013
|
this.next();
|
|
8905
9014
|
return this.flowParseOpaqueType(_declarationNode, false);
|
|
8906
|
-
} else if (this.isContextual(
|
|
9015
|
+
} else if (this.isContextual(125)) {
|
|
8907
9016
|
node.exportKind = "type";
|
|
8908
9017
|
|
|
8909
9018
|
var _declarationNode2 = this.startNode();
|
|
8910
9019
|
|
|
8911
9020
|
this.next();
|
|
8912
9021
|
return this.flowParseInterface(_declarationNode2);
|
|
8913
|
-
} else if (this.shouldParseEnums() && this.isContextual(
|
|
9022
|
+
} else if (this.shouldParseEnums() && this.isContextual(122)) {
|
|
8914
9023
|
node.exportKind = "value";
|
|
8915
9024
|
|
|
8916
9025
|
var _declarationNode3 = this.startNode();
|
|
@@ -8925,7 +9034,7 @@ var flow = superClass => class extends superClass {
|
|
|
8925
9034
|
eatExportStar(node) {
|
|
8926
9035
|
if (super.eatExportStar(...arguments)) return true;
|
|
8927
9036
|
|
|
8928
|
-
if (this.isContextual(
|
|
9037
|
+
if (this.isContextual(126) && this.lookahead().type === 55) {
|
|
8929
9038
|
node.exportKind = "type";
|
|
8930
9039
|
this.next();
|
|
8931
9040
|
this.next();
|
|
@@ -8951,7 +9060,7 @@ var flow = superClass => class extends superClass {
|
|
|
8951
9060
|
parseClassId(node, isStatement, optionalId) {
|
|
8952
9061
|
super.parseClassId(node, isStatement, optionalId);
|
|
8953
9062
|
|
|
8954
|
-
if (this.match(
|
|
9063
|
+
if (this.match(47)) {
|
|
8955
9064
|
node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
8956
9065
|
}
|
|
8957
9066
|
}
|
|
@@ -8961,7 +9070,7 @@ var flow = superClass => class extends superClass {
|
|
|
8961
9070
|
startLoc
|
|
8962
9071
|
} = this.state;
|
|
8963
9072
|
|
|
8964
|
-
if (this.isContextual(
|
|
9073
|
+
if (this.isContextual(121)) {
|
|
8965
9074
|
if (this.parseClassMemberFromModifier(classBody, member)) {
|
|
8966
9075
|
return;
|
|
8967
9076
|
}
|
|
@@ -8998,7 +9107,7 @@ var flow = superClass => class extends superClass {
|
|
|
8998
9107
|
}, fullWord);
|
|
8999
9108
|
}
|
|
9000
9109
|
|
|
9001
|
-
this.finishToken(
|
|
9110
|
+
this.finishToken(128, fullWord);
|
|
9002
9111
|
}
|
|
9003
9112
|
|
|
9004
9113
|
getTokenFromCode(code) {
|
|
@@ -9007,14 +9116,14 @@ var flow = superClass => class extends superClass {
|
|
|
9007
9116
|
if (code === 123 && next === 124) {
|
|
9008
9117
|
return this.finishOp(6, 2);
|
|
9009
9118
|
} else if (this.state.inType && (code === 62 || code === 60)) {
|
|
9010
|
-
return this.finishOp(code === 62 ?
|
|
9119
|
+
return this.finishOp(code === 62 ? 48 : 47, 1);
|
|
9011
9120
|
} else if (this.state.inType && code === 63) {
|
|
9012
9121
|
if (next === 46) {
|
|
9013
9122
|
return this.finishOp(18, 2);
|
|
9014
9123
|
}
|
|
9015
9124
|
|
|
9016
9125
|
return this.finishOp(17, 1);
|
|
9017
|
-
} else if (isIteratorStart(code, next)) {
|
|
9126
|
+
} else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) {
|
|
9018
9127
|
this.state.pos += 2;
|
|
9019
9128
|
return this.readIterator();
|
|
9020
9129
|
} else {
|
|
@@ -9105,7 +9214,7 @@ var flow = superClass => class extends superClass {
|
|
|
9105
9214
|
}
|
|
9106
9215
|
|
|
9107
9216
|
isClassMethod() {
|
|
9108
|
-
return this.match(
|
|
9217
|
+
return this.match(47) || super.isClassMethod();
|
|
9109
9218
|
}
|
|
9110
9219
|
|
|
9111
9220
|
isClassProperty() {
|
|
@@ -9123,7 +9232,7 @@ var flow = superClass => class extends superClass {
|
|
|
9123
9232
|
|
|
9124
9233
|
delete method.variance;
|
|
9125
9234
|
|
|
9126
|
-
if (this.match(
|
|
9235
|
+
if (this.match(47)) {
|
|
9127
9236
|
method.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
9128
9237
|
}
|
|
9129
9238
|
|
|
@@ -9155,7 +9264,7 @@ var flow = superClass => class extends superClass {
|
|
|
9155
9264
|
|
|
9156
9265
|
delete method.variance;
|
|
9157
9266
|
|
|
9158
|
-
if (this.match(
|
|
9267
|
+
if (this.match(47)) {
|
|
9159
9268
|
method.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
9160
9269
|
}
|
|
9161
9270
|
|
|
@@ -9165,11 +9274,11 @@ var flow = superClass => class extends superClass {
|
|
|
9165
9274
|
parseClassSuper(node) {
|
|
9166
9275
|
super.parseClassSuper(node);
|
|
9167
9276
|
|
|
9168
|
-
if (node.superClass && this.match(
|
|
9277
|
+
if (node.superClass && this.match(47)) {
|
|
9169
9278
|
node.superTypeParameters = this.flowParseTypeParameterInstantiation();
|
|
9170
9279
|
}
|
|
9171
9280
|
|
|
9172
|
-
if (this.isContextual(
|
|
9281
|
+
if (this.isContextual(110)) {
|
|
9173
9282
|
this.next();
|
|
9174
9283
|
var implemented = node.implements = [];
|
|
9175
9284
|
|
|
@@ -9178,7 +9287,7 @@ var flow = superClass => class extends superClass {
|
|
|
9178
9287
|
|
|
9179
9288
|
_node3.id = this.flowParseRestrictedIdentifier(true);
|
|
9180
9289
|
|
|
9181
|
-
if (this.match(
|
|
9290
|
+
if (this.match(47)) {
|
|
9182
9291
|
_node3.typeParameters = this.flowParseTypeParameterInstantiation();
|
|
9183
9292
|
} else {
|
|
9184
9293
|
_node3.typeParameters = null;
|
|
@@ -9220,7 +9329,7 @@ var flow = superClass => class extends superClass {
|
|
|
9220
9329
|
delete prop.variance;
|
|
9221
9330
|
var typeParameters;
|
|
9222
9331
|
|
|
9223
|
-
if (this.match(
|
|
9332
|
+
if (this.match(47) && !isAccessor) {
|
|
9224
9333
|
typeParameters = this.flowParseTypeParameterDeclaration();
|
|
9225
9334
|
if (!this.match(10)) this.unexpected();
|
|
9226
9335
|
}
|
|
@@ -9297,9 +9406,9 @@ var flow = superClass => class extends superClass {
|
|
|
9297
9406
|
node.importKind = "value";
|
|
9298
9407
|
var kind = null;
|
|
9299
9408
|
|
|
9300
|
-
if (this.match(
|
|
9409
|
+
if (this.match(87)) {
|
|
9301
9410
|
kind = "typeof";
|
|
9302
|
-
} else if (this.isContextual(
|
|
9411
|
+
} else if (this.isContextual(126)) {
|
|
9303
9412
|
kind = "type";
|
|
9304
9413
|
}
|
|
9305
9414
|
|
|
@@ -9309,11 +9418,11 @@ var flow = superClass => class extends superClass {
|
|
|
9309
9418
|
type
|
|
9310
9419
|
} = lh;
|
|
9311
9420
|
|
|
9312
|
-
if (kind === "type" && type ===
|
|
9421
|
+
if (kind === "type" && type === 55) {
|
|
9313
9422
|
this.unexpected(null, lh.type);
|
|
9314
9423
|
}
|
|
9315
9424
|
|
|
9316
|
-
if (isMaybeDefaultImport(type) || type === 5 || type ===
|
|
9425
|
+
if (isMaybeDefaultImport(type) || type === 5 || type === 55) {
|
|
9317
9426
|
this.next();
|
|
9318
9427
|
node.importKind = kind;
|
|
9319
9428
|
}
|
|
@@ -9336,7 +9445,7 @@ var flow = superClass => class extends superClass {
|
|
|
9336
9445
|
|
|
9337
9446
|
var isBinding = false;
|
|
9338
9447
|
|
|
9339
|
-
if (this.isContextual(
|
|
9448
|
+
if (this.isContextual(93) && !this.isLookaheadContextual("as")) {
|
|
9340
9449
|
var as_ident = this.parseIdentifier(true);
|
|
9341
9450
|
|
|
9342
9451
|
if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) {
|
|
@@ -9363,7 +9472,7 @@ var flow = superClass => class extends superClass {
|
|
|
9363
9472
|
specifier.importKind = null;
|
|
9364
9473
|
}
|
|
9365
9474
|
|
|
9366
|
-
if (this.eatContextual(
|
|
9475
|
+
if (this.eatContextual(93)) {
|
|
9367
9476
|
specifier.local = this.parseIdentifier();
|
|
9368
9477
|
} else {
|
|
9369
9478
|
isBinding = true;
|
|
@@ -9393,7 +9502,7 @@ var flow = superClass => class extends superClass {
|
|
|
9393
9502
|
|
|
9394
9503
|
parseBindingAtom() {
|
|
9395
9504
|
switch (this.state.type) {
|
|
9396
|
-
case
|
|
9505
|
+
case 78:
|
|
9397
9506
|
return this.parseIdentifier(true);
|
|
9398
9507
|
|
|
9399
9508
|
default:
|
|
@@ -9404,7 +9513,7 @@ var flow = superClass => class extends superClass {
|
|
|
9404
9513
|
parseFunctionParams(node, allowModifiers) {
|
|
9405
9514
|
var kind = node.kind;
|
|
9406
9515
|
|
|
9407
|
-
if (kind !== "get" && kind !== "set" && this.match(
|
|
9516
|
+
if (kind !== "get" && kind !== "set" && this.match(47)) {
|
|
9408
9517
|
node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
9409
9518
|
}
|
|
9410
9519
|
|
|
@@ -9441,7 +9550,7 @@ var flow = superClass => class extends superClass {
|
|
|
9441
9550
|
var state = null;
|
|
9442
9551
|
var jsx;
|
|
9443
9552
|
|
|
9444
|
-
if (this.hasPlugin("jsx") && (this.match(
|
|
9553
|
+
if (this.hasPlugin("jsx") && (this.match(138) || this.match(47))) {
|
|
9445
9554
|
state = this.state.clone();
|
|
9446
9555
|
jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
|
|
9447
9556
|
if (!jsx.error) return jsx.node;
|
|
@@ -9455,7 +9564,7 @@ var flow = superClass => class extends superClass {
|
|
|
9455
9564
|
}
|
|
9456
9565
|
}
|
|
9457
9566
|
|
|
9458
|
-
if ((_jsx = jsx) != null && _jsx.error || this.match(
|
|
9567
|
+
if ((_jsx = jsx) != null && _jsx.error || this.match(47)) {
|
|
9459
9568
|
var _jsx2, _jsx3;
|
|
9460
9569
|
|
|
9461
9570
|
state = state || this.state.clone();
|
|
@@ -9571,7 +9680,7 @@ var flow = superClass => class extends superClass {
|
|
|
9571
9680
|
node.callee = base;
|
|
9572
9681
|
node.arguments = this.parseCallExpressionArguments(11, false);
|
|
9573
9682
|
base = this.finishNode(node, "CallExpression");
|
|
9574
|
-
} else if (base.type === "Identifier" && base.name === "async" && this.match(
|
|
9683
|
+
} else if (base.type === "Identifier" && base.name === "async" && this.match(47)) {
|
|
9575
9684
|
var state = this.state.clone();
|
|
9576
9685
|
var arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state);
|
|
9577
9686
|
if (!arrow.error && !arrow.aborted) return arrow.node;
|
|
@@ -9611,7 +9720,7 @@ var flow = superClass => class extends superClass {
|
|
|
9611
9720
|
node.arguments = this.parseCallExpressionArguments(11, false);
|
|
9612
9721
|
node.optional = true;
|
|
9613
9722
|
return this.finishCallExpression(node, true);
|
|
9614
|
-
} else if (!noCalls && this.shouldParseTypes() && this.match(
|
|
9723
|
+
} else if (!noCalls && this.shouldParseTypes() && this.match(47)) {
|
|
9615
9724
|
var _node4 = this.startNodeAt(startPos, startLoc);
|
|
9616
9725
|
|
|
9617
9726
|
_node4.callee = base;
|
|
@@ -9635,7 +9744,7 @@ var flow = superClass => class extends superClass {
|
|
|
9635
9744
|
parseNewArguments(node) {
|
|
9636
9745
|
var targs = null;
|
|
9637
9746
|
|
|
9638
|
-
if (this.shouldParseTypes() && this.match(
|
|
9747
|
+
if (this.shouldParseTypes() && this.match(47)) {
|
|
9639
9748
|
targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;
|
|
9640
9749
|
}
|
|
9641
9750
|
|
|
@@ -9810,7 +9919,7 @@ var flow = superClass => class extends superClass {
|
|
|
9810
9919
|
var endOfInit = () => this.match(12) || this.match(8);
|
|
9811
9920
|
|
|
9812
9921
|
switch (this.state.type) {
|
|
9813
|
-
case
|
|
9922
|
+
case 130:
|
|
9814
9923
|
{
|
|
9815
9924
|
var literal = this.parseNumericLiteral(this.state.value);
|
|
9816
9925
|
|
|
@@ -9828,7 +9937,7 @@ var flow = superClass => class extends superClass {
|
|
|
9828
9937
|
};
|
|
9829
9938
|
}
|
|
9830
9939
|
|
|
9831
|
-
case
|
|
9940
|
+
case 129:
|
|
9832
9941
|
{
|
|
9833
9942
|
var _literal = this.parseStringLiteral(this.state.value);
|
|
9834
9943
|
|
|
@@ -9846,10 +9955,10 @@ var flow = superClass => class extends superClass {
|
|
|
9846
9955
|
};
|
|
9847
9956
|
}
|
|
9848
9957
|
|
|
9849
|
-
case
|
|
9850
|
-
case
|
|
9958
|
+
case 85:
|
|
9959
|
+
case 86:
|
|
9851
9960
|
{
|
|
9852
|
-
var _literal2 = this.parseBooleanLiteral(this.match(
|
|
9961
|
+
var _literal2 = this.parseBooleanLiteral(this.match(85));
|
|
9853
9962
|
|
|
9854
9963
|
if (endOfInit()) {
|
|
9855
9964
|
return {
|
|
@@ -10042,7 +10151,7 @@ var flow = superClass => class extends superClass {
|
|
|
10042
10151
|
enumName
|
|
10043
10152
|
} = _ref15;
|
|
10044
10153
|
|
|
10045
|
-
if (this.eatContextual(
|
|
10154
|
+
if (this.eatContextual(101)) {
|
|
10046
10155
|
if (!tokenIsIdentifier(this.state.type)) {
|
|
10047
10156
|
throw this.flowEnumErrorInvalidExplicitType(this.state.startLoc, {
|
|
10048
10157
|
enumName,
|
|
@@ -10495,14 +10604,14 @@ var jsx = superClass => class extends superClass {
|
|
|
10495
10604
|
if (this.state.pos === this.state.start) {
|
|
10496
10605
|
if (ch === 60 && this.state.canStartJSXElement) {
|
|
10497
10606
|
++this.state.pos;
|
|
10498
|
-
return this.finishToken(
|
|
10607
|
+
return this.finishToken(138);
|
|
10499
10608
|
}
|
|
10500
10609
|
|
|
10501
10610
|
return super.getTokenFromCode(ch);
|
|
10502
10611
|
}
|
|
10503
10612
|
|
|
10504
10613
|
out += this.input.slice(chunkStart, this.state.pos);
|
|
10505
|
-
return this.finishToken(
|
|
10614
|
+
return this.finishToken(137, out);
|
|
10506
10615
|
|
|
10507
10616
|
case 38:
|
|
10508
10617
|
out += this.input.slice(chunkStart, this.state.pos);
|
|
@@ -10570,7 +10679,7 @@ var jsx = superClass => class extends superClass {
|
|
|
10570
10679
|
}
|
|
10571
10680
|
|
|
10572
10681
|
out += this.input.slice(chunkStart, this.state.pos++);
|
|
10573
|
-
return this.finishToken(
|
|
10682
|
+
return this.finishToken(129, out);
|
|
10574
10683
|
}
|
|
10575
10684
|
|
|
10576
10685
|
jsxReadEntity() {
|
|
@@ -10624,13 +10733,13 @@ var jsx = superClass => class extends superClass {
|
|
|
10624
10733
|
ch = this.input.charCodeAt(++this.state.pos);
|
|
10625
10734
|
} while (isIdentifierChar(ch) || ch === 45);
|
|
10626
10735
|
|
|
10627
|
-
return this.finishToken(
|
|
10736
|
+
return this.finishToken(136, this.input.slice(start, this.state.pos));
|
|
10628
10737
|
}
|
|
10629
10738
|
|
|
10630
10739
|
jsxParseIdentifier() {
|
|
10631
10740
|
var node = this.startNode();
|
|
10632
10741
|
|
|
10633
|
-
if (this.match(
|
|
10742
|
+
if (this.match(136)) {
|
|
10634
10743
|
node.name = this.state.value;
|
|
10635
10744
|
} else if (tokenIsKeyword(this.state.type)) {
|
|
10636
10745
|
node.name = tokenLabelName(this.state.type);
|
|
@@ -10690,8 +10799,8 @@ var jsx = superClass => class extends superClass {
|
|
|
10690
10799
|
|
|
10691
10800
|
return node;
|
|
10692
10801
|
|
|
10693
|
-
case
|
|
10694
|
-
case
|
|
10802
|
+
case 138:
|
|
10803
|
+
case 129:
|
|
10695
10804
|
return this.parseExprAtom();
|
|
10696
10805
|
|
|
10697
10806
|
default:
|
|
@@ -10702,7 +10811,7 @@ var jsx = superClass => class extends superClass {
|
|
|
10702
10811
|
}
|
|
10703
10812
|
|
|
10704
10813
|
jsxParseEmptyExpression() {
|
|
10705
|
-
var node = this.startNodeAt(
|
|
10814
|
+
var node = this.startNodeAt(this.state.lastTokEndLoc.index, this.state.lastTokEndLoc);
|
|
10706
10815
|
return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc);
|
|
10707
10816
|
}
|
|
10708
10817
|
|
|
@@ -10748,8 +10857,8 @@ var jsx = superClass => class extends superClass {
|
|
|
10748
10857
|
jsxParseOpeningElementAt(startPos, startLoc) {
|
|
10749
10858
|
var node = this.startNodeAt(startPos, startLoc);
|
|
10750
10859
|
|
|
10751
|
-
if (this.match(
|
|
10752
|
-
this.expect(
|
|
10860
|
+
if (this.match(139)) {
|
|
10861
|
+
this.expect(139);
|
|
10753
10862
|
return this.finishNode(node, "JSXOpeningFragment");
|
|
10754
10863
|
}
|
|
10755
10864
|
|
|
@@ -10760,26 +10869,26 @@ var jsx = superClass => class extends superClass {
|
|
|
10760
10869
|
jsxParseOpeningElementAfterName(node) {
|
|
10761
10870
|
var attributes = [];
|
|
10762
10871
|
|
|
10763
|
-
while (!this.match(
|
|
10872
|
+
while (!this.match(56) && !this.match(139)) {
|
|
10764
10873
|
attributes.push(this.jsxParseAttribute());
|
|
10765
10874
|
}
|
|
10766
10875
|
|
|
10767
10876
|
node.attributes = attributes;
|
|
10768
|
-
node.selfClosing = this.eat(
|
|
10769
|
-
this.expect(
|
|
10877
|
+
node.selfClosing = this.eat(56);
|
|
10878
|
+
this.expect(139);
|
|
10770
10879
|
return this.finishNode(node, "JSXOpeningElement");
|
|
10771
10880
|
}
|
|
10772
10881
|
|
|
10773
10882
|
jsxParseClosingElementAt(startPos, startLoc) {
|
|
10774
10883
|
var node = this.startNodeAt(startPos, startLoc);
|
|
10775
10884
|
|
|
10776
|
-
if (this.match(
|
|
10777
|
-
this.expect(
|
|
10885
|
+
if (this.match(139)) {
|
|
10886
|
+
this.expect(139);
|
|
10778
10887
|
return this.finishNode(node, "JSXClosingFragment");
|
|
10779
10888
|
}
|
|
10780
10889
|
|
|
10781
10890
|
node.name = this.jsxParseElementName();
|
|
10782
|
-
this.expect(
|
|
10891
|
+
this.expect(139);
|
|
10783
10892
|
return this.finishNode(node, "JSXClosingElement");
|
|
10784
10893
|
}
|
|
10785
10894
|
|
|
@@ -10792,12 +10901,12 @@ var jsx = superClass => class extends superClass {
|
|
|
10792
10901
|
if (!openingElement.selfClosing) {
|
|
10793
10902
|
contents: for (;;) {
|
|
10794
10903
|
switch (this.state.type) {
|
|
10795
|
-
case
|
|
10904
|
+
case 138:
|
|
10796
10905
|
startPos = this.state.start;
|
|
10797
10906
|
startLoc = this.state.startLoc;
|
|
10798
10907
|
this.next();
|
|
10799
10908
|
|
|
10800
|
-
if (this.eat(
|
|
10909
|
+
if (this.eat(56)) {
|
|
10801
10910
|
closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
|
|
10802
10911
|
break contents;
|
|
10803
10912
|
}
|
|
@@ -10805,7 +10914,7 @@ var jsx = superClass => class extends superClass {
|
|
|
10805
10914
|
children.push(this.jsxParseElementAt(startPos, startLoc));
|
|
10806
10915
|
break;
|
|
10807
10916
|
|
|
10808
|
-
case
|
|
10917
|
+
case 137:
|
|
10809
10918
|
children.push(this.parseExprAtom());
|
|
10810
10919
|
break;
|
|
10811
10920
|
|
|
@@ -10857,7 +10966,7 @@ var jsx = superClass => class extends superClass {
|
|
|
10857
10966
|
|
|
10858
10967
|
node.children = children;
|
|
10859
10968
|
|
|
10860
|
-
if (this.match(
|
|
10969
|
+
if (this.match(47)) {
|
|
10861
10970
|
throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, {
|
|
10862
10971
|
at: this.state.startLoc
|
|
10863
10972
|
});
|
|
@@ -10881,12 +10990,12 @@ var jsx = superClass => class extends superClass {
|
|
|
10881
10990
|
}
|
|
10882
10991
|
|
|
10883
10992
|
parseExprAtom(refExpressionErrors) {
|
|
10884
|
-
if (this.match(
|
|
10993
|
+
if (this.match(137)) {
|
|
10885
10994
|
return this.parseLiteral(this.state.value, "JSXText");
|
|
10886
|
-
} else if (this.match(
|
|
10995
|
+
} else if (this.match(138)) {
|
|
10887
10996
|
return this.jsxParseElement();
|
|
10888
|
-
} else if (this.match(
|
|
10889
|
-
this.replaceToken(
|
|
10997
|
+
} else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) {
|
|
10998
|
+
this.replaceToken(138);
|
|
10890
10999
|
return this.jsxParseElement();
|
|
10891
11000
|
} else {
|
|
10892
11001
|
return super.parseExprAtom(refExpressionErrors);
|
|
@@ -10912,7 +11021,7 @@ var jsx = superClass => class extends superClass {
|
|
|
10912
11021
|
|
|
10913
11022
|
if (code === 62) {
|
|
10914
11023
|
++this.state.pos;
|
|
10915
|
-
return this.finishToken(
|
|
11024
|
+
return this.finishToken(139);
|
|
10916
11025
|
}
|
|
10917
11026
|
|
|
10918
11027
|
if ((code === 34 || code === 39) && context === types.j_oTag) {
|
|
@@ -10922,7 +11031,7 @@ var jsx = superClass => class extends superClass {
|
|
|
10922
11031
|
|
|
10923
11032
|
if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
|
|
10924
11033
|
++this.state.pos;
|
|
10925
|
-
return this.finishToken(
|
|
11034
|
+
return this.finishToken(138);
|
|
10926
11035
|
}
|
|
10927
11036
|
|
|
10928
11037
|
return super.getTokenFromCode(code);
|
|
@@ -10934,15 +11043,15 @@ var jsx = superClass => class extends superClass {
|
|
|
10934
11043
|
type
|
|
10935
11044
|
} = this.state;
|
|
10936
11045
|
|
|
10937
|
-
if (type ===
|
|
11046
|
+
if (type === 56 && prevType === 138) {
|
|
10938
11047
|
context.splice(-2, 2, types.j_cTag);
|
|
10939
11048
|
this.state.canStartJSXElement = false;
|
|
10940
|
-
} else if (type ===
|
|
11049
|
+
} else if (type === 138) {
|
|
10941
11050
|
context.push(types.j_oTag);
|
|
10942
|
-
} else if (type ===
|
|
11051
|
+
} else if (type === 139) {
|
|
10943
11052
|
var out = context[context.length - 1];
|
|
10944
11053
|
|
|
10945
|
-
if (out === types.j_oTag && prevType ===
|
|
11054
|
+
if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) {
|
|
10946
11055
|
context.pop();
|
|
10947
11056
|
this.state.canStartJSXElement = context[context.length - 1] === types.j_expr;
|
|
10948
11057
|
} else {
|
|
@@ -11158,7 +11267,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11158
11267
|
}
|
|
11159
11268
|
|
|
11160
11269
|
tsTokenCanFollowModifier() {
|
|
11161
|
-
return (this.match(0) || this.match(5) || this.match(
|
|
11270
|
+
return (this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(134) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak();
|
|
11162
11271
|
}
|
|
11163
11272
|
|
|
11164
11273
|
tsNextTokenCanFollowModifier() {
|
|
@@ -11259,7 +11368,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11259
11368
|
return this.match(3);
|
|
11260
11369
|
|
|
11261
11370
|
case "TypeParametersOrArguments":
|
|
11262
|
-
return this.match(
|
|
11371
|
+
return this.match(48);
|
|
11263
11372
|
}
|
|
11264
11373
|
|
|
11265
11374
|
throw new Error("Unreachable");
|
|
@@ -11325,7 +11434,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11325
11434
|
if (bracket) {
|
|
11326
11435
|
this.expect(0);
|
|
11327
11436
|
} else {
|
|
11328
|
-
this.expect(
|
|
11437
|
+
this.expect(47);
|
|
11329
11438
|
}
|
|
11330
11439
|
}
|
|
11331
11440
|
|
|
@@ -11334,7 +11443,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11334
11443
|
if (bracket) {
|
|
11335
11444
|
this.expect(3);
|
|
11336
11445
|
} else {
|
|
11337
|
-
this.expect(
|
|
11446
|
+
this.expect(48);
|
|
11338
11447
|
}
|
|
11339
11448
|
|
|
11340
11449
|
return result;
|
|
@@ -11342,10 +11451,10 @@ var typescript = superClass => class extends superClass {
|
|
|
11342
11451
|
|
|
11343
11452
|
tsParseImportType() {
|
|
11344
11453
|
var node = this.startNode();
|
|
11345
|
-
this.expect(
|
|
11454
|
+
this.expect(83);
|
|
11346
11455
|
this.expect(10);
|
|
11347
11456
|
|
|
11348
|
-
if (!this.match(
|
|
11457
|
+
if (!this.match(129)) {
|
|
11349
11458
|
this.raise(TSErrors.UnsupportedImportTypeArgument, {
|
|
11350
11459
|
at: this.state.startLoc
|
|
11351
11460
|
});
|
|
@@ -11358,7 +11467,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11358
11467
|
node.qualifier = this.tsParseEntityName(true);
|
|
11359
11468
|
}
|
|
11360
11469
|
|
|
11361
|
-
if (this.match(
|
|
11470
|
+
if (this.match(47)) {
|
|
11362
11471
|
node.typeParameters = this.tsParseTypeArguments();
|
|
11363
11472
|
}
|
|
11364
11473
|
|
|
@@ -11382,7 +11491,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11382
11491
|
var node = this.startNode();
|
|
11383
11492
|
node.typeName = this.tsParseEntityName(false);
|
|
11384
11493
|
|
|
11385
|
-
if (!this.hasPrecedingLineBreak() && this.match(
|
|
11494
|
+
if (!this.hasPrecedingLineBreak() && this.match(47)) {
|
|
11386
11495
|
node.typeParameters = this.tsParseTypeArguments();
|
|
11387
11496
|
}
|
|
11388
11497
|
|
|
@@ -11406,9 +11515,9 @@ var typescript = superClass => class extends superClass {
|
|
|
11406
11515
|
|
|
11407
11516
|
tsParseTypeQuery() {
|
|
11408
11517
|
var node = this.startNode();
|
|
11409
|
-
this.expect(
|
|
11518
|
+
this.expect(87);
|
|
11410
11519
|
|
|
11411
|
-
if (this.match(
|
|
11520
|
+
if (this.match(83)) {
|
|
11412
11521
|
node.exprName = this.tsParseImportType();
|
|
11413
11522
|
} else {
|
|
11414
11523
|
node.exprName = this.tsParseEntityName(true);
|
|
@@ -11420,13 +11529,13 @@ var typescript = superClass => class extends superClass {
|
|
|
11420
11529
|
tsParseTypeParameter() {
|
|
11421
11530
|
var node = this.startNode();
|
|
11422
11531
|
node.name = this.tsParseTypeParameterName();
|
|
11423
|
-
node.constraint = this.tsEatThenParseType(
|
|
11532
|
+
node.constraint = this.tsEatThenParseType(81);
|
|
11424
11533
|
node.default = this.tsEatThenParseType(29);
|
|
11425
11534
|
return this.finishNode(node, "TSTypeParameter");
|
|
11426
11535
|
}
|
|
11427
11536
|
|
|
11428
11537
|
tsTryParseTypeParameters() {
|
|
11429
|
-
if (this.match(
|
|
11538
|
+
if (this.match(47)) {
|
|
11430
11539
|
return this.tsParseTypeParameters();
|
|
11431
11540
|
}
|
|
11432
11541
|
}
|
|
@@ -11434,7 +11543,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11434
11543
|
tsParseTypeParameters() {
|
|
11435
11544
|
var node = this.startNode();
|
|
11436
11545
|
|
|
11437
|
-
if (this.match(
|
|
11546
|
+
if (this.match(47) || this.match(138)) {
|
|
11438
11547
|
this.next();
|
|
11439
11548
|
} else {
|
|
11440
11549
|
this.unexpected();
|
|
@@ -11459,7 +11568,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11459
11568
|
}
|
|
11460
11569
|
|
|
11461
11570
|
tsTryNextParseConstantContext() {
|
|
11462
|
-
if (this.lookahead().type ===
|
|
11571
|
+
if (this.lookahead().type === 75) {
|
|
11463
11572
|
this.next();
|
|
11464
11573
|
return this.tsParseTypeReference();
|
|
11465
11574
|
}
|
|
@@ -11538,7 +11647,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11538
11647
|
if (this.eat(17)) node.optional = true;
|
|
11539
11648
|
var nodeAny = node;
|
|
11540
11649
|
|
|
11541
|
-
if (this.match(10) || this.match(
|
|
11650
|
+
if (this.match(10) || this.match(47)) {
|
|
11542
11651
|
if (readonly) {
|
|
11543
11652
|
this.raise(TSErrors.ReadonlyForMethodSignature, {
|
|
11544
11653
|
node
|
|
@@ -11547,7 +11656,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11547
11656
|
|
|
11548
11657
|
var method = nodeAny;
|
|
11549
11658
|
|
|
11550
|
-
if (method.kind && this.match(
|
|
11659
|
+
if (method.kind && this.match(47)) {
|
|
11551
11660
|
this.raise(TSErrors.AccesorCannotHaveTypeParameters, {
|
|
11552
11661
|
at: this.state.curPosition()
|
|
11553
11662
|
});
|
|
@@ -11620,15 +11729,15 @@ var typescript = superClass => class extends superClass {
|
|
|
11620
11729
|
tsParseTypeMember() {
|
|
11621
11730
|
var node = this.startNode();
|
|
11622
11731
|
|
|
11623
|
-
if (this.match(10) || this.match(
|
|
11732
|
+
if (this.match(10) || this.match(47)) {
|
|
11624
11733
|
return this.tsParseSignatureMember("TSCallSignatureDeclaration", node);
|
|
11625
11734
|
}
|
|
11626
11735
|
|
|
11627
|
-
if (this.match(
|
|
11736
|
+
if (this.match(77)) {
|
|
11628
11737
|
var id = this.startNode();
|
|
11629
11738
|
this.next();
|
|
11630
11739
|
|
|
11631
|
-
if (this.match(10) || this.match(
|
|
11740
|
+
if (this.match(10) || this.match(47)) {
|
|
11632
11741
|
return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node);
|
|
11633
11742
|
} else {
|
|
11634
11743
|
node.key = this.createIdentifier(id, "new");
|
|
@@ -11669,11 +11778,11 @@ var typescript = superClass => class extends superClass {
|
|
|
11669
11778
|
tsIsStartOfMappedType() {
|
|
11670
11779
|
this.next();
|
|
11671
11780
|
|
|
11672
|
-
if (this.eat(
|
|
11673
|
-
return this.isContextual(
|
|
11781
|
+
if (this.eat(53)) {
|
|
11782
|
+
return this.isContextual(118);
|
|
11674
11783
|
}
|
|
11675
11784
|
|
|
11676
|
-
if (this.isContextual(
|
|
11785
|
+
if (this.isContextual(118)) {
|
|
11677
11786
|
this.next();
|
|
11678
11787
|
}
|
|
11679
11788
|
|
|
@@ -11688,13 +11797,13 @@ var typescript = superClass => class extends superClass {
|
|
|
11688
11797
|
}
|
|
11689
11798
|
|
|
11690
11799
|
this.next();
|
|
11691
|
-
return this.match(
|
|
11800
|
+
return this.match(58);
|
|
11692
11801
|
}
|
|
11693
11802
|
|
|
11694
11803
|
tsParseMappedTypeParameter() {
|
|
11695
11804
|
var node = this.startNode();
|
|
11696
11805
|
node.name = this.tsParseTypeParameterName();
|
|
11697
|
-
node.constraint = this.tsExpectThenParseType(
|
|
11806
|
+
node.constraint = this.tsExpectThenParseType(58);
|
|
11698
11807
|
return this.finishNode(node, "TSTypeParameter");
|
|
11699
11808
|
}
|
|
11700
11809
|
|
|
@@ -11702,20 +11811,20 @@ var typescript = superClass => class extends superClass {
|
|
|
11702
11811
|
var node = this.startNode();
|
|
11703
11812
|
this.expect(5);
|
|
11704
11813
|
|
|
11705
|
-
if (this.match(
|
|
11814
|
+
if (this.match(53)) {
|
|
11706
11815
|
node.readonly = this.state.value;
|
|
11707
11816
|
this.next();
|
|
11708
|
-
this.expectContextual(
|
|
11709
|
-
} else if (this.eatContextual(
|
|
11817
|
+
this.expectContextual(118);
|
|
11818
|
+
} else if (this.eatContextual(118)) {
|
|
11710
11819
|
node.readonly = true;
|
|
11711
11820
|
}
|
|
11712
11821
|
|
|
11713
11822
|
this.expect(0);
|
|
11714
11823
|
node.typeParameter = this.tsParseMappedTypeParameter();
|
|
11715
|
-
node.nameType = this.eatContextual(
|
|
11824
|
+
node.nameType = this.eatContextual(93) ? this.tsParseType() : null;
|
|
11716
11825
|
this.expect(3);
|
|
11717
11826
|
|
|
11718
|
-
if (this.match(
|
|
11827
|
+
if (this.match(53)) {
|
|
11719
11828
|
node.optional = this.state.value;
|
|
11720
11829
|
this.next();
|
|
11721
11830
|
this.expect(17);
|
|
@@ -11832,11 +11941,11 @@ var typescript = superClass => class extends superClass {
|
|
|
11832
11941
|
|
|
11833
11942
|
node.literal = (() => {
|
|
11834
11943
|
switch (this.state.type) {
|
|
11835
|
-
case
|
|
11836
|
-
case
|
|
11837
|
-
case
|
|
11838
|
-
case
|
|
11839
|
-
case
|
|
11944
|
+
case 130:
|
|
11945
|
+
case 131:
|
|
11946
|
+
case 129:
|
|
11947
|
+
case 85:
|
|
11948
|
+
case 86:
|
|
11840
11949
|
return this.parseExprAtom();
|
|
11841
11950
|
|
|
11842
11951
|
default:
|
|
@@ -11861,7 +11970,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11861
11970
|
tsParseThisTypeOrThisTypePredicate() {
|
|
11862
11971
|
var thisKeyword = this.tsParseThisTypeNode();
|
|
11863
11972
|
|
|
11864
|
-
if (this.isContextual(
|
|
11973
|
+
if (this.isContextual(113) && !this.hasPrecedingLineBreak()) {
|
|
11865
11974
|
return this.tsParseThisTypePredicate(thisKeyword);
|
|
11866
11975
|
} else {
|
|
11867
11976
|
return thisKeyword;
|
|
@@ -11870,19 +11979,19 @@ var typescript = superClass => class extends superClass {
|
|
|
11870
11979
|
|
|
11871
11980
|
tsParseNonArrayType() {
|
|
11872
11981
|
switch (this.state.type) {
|
|
11873
|
-
case
|
|
11874
|
-
case
|
|
11875
|
-
case
|
|
11876
|
-
case
|
|
11877
|
-
case
|
|
11982
|
+
case 129:
|
|
11983
|
+
case 130:
|
|
11984
|
+
case 131:
|
|
11985
|
+
case 85:
|
|
11986
|
+
case 86:
|
|
11878
11987
|
return this.tsParseLiteralTypeNode();
|
|
11879
11988
|
|
|
11880
|
-
case
|
|
11989
|
+
case 53:
|
|
11881
11990
|
if (this.state.value === "-") {
|
|
11882
11991
|
var node = this.startNode();
|
|
11883
11992
|
var nextToken = this.lookahead();
|
|
11884
11993
|
|
|
11885
|
-
if (nextToken.type !==
|
|
11994
|
+
if (nextToken.type !== 130 && nextToken.type !== 131) {
|
|
11886
11995
|
throw this.unexpected();
|
|
11887
11996
|
}
|
|
11888
11997
|
|
|
@@ -11892,13 +12001,13 @@ var typescript = superClass => class extends superClass {
|
|
|
11892
12001
|
|
|
11893
12002
|
break;
|
|
11894
12003
|
|
|
11895
|
-
case
|
|
12004
|
+
case 78:
|
|
11896
12005
|
return this.tsParseThisTypeOrThisTypePredicate();
|
|
11897
12006
|
|
|
11898
|
-
case
|
|
12007
|
+
case 87:
|
|
11899
12008
|
return this.tsParseTypeQuery();
|
|
11900
12009
|
|
|
11901
|
-
case
|
|
12010
|
+
case 83:
|
|
11902
12011
|
return this.tsParseImportType();
|
|
11903
12012
|
|
|
11904
12013
|
case 5:
|
|
@@ -11920,8 +12029,8 @@ var typescript = superClass => class extends superClass {
|
|
|
11920
12029
|
type
|
|
11921
12030
|
} = this.state;
|
|
11922
12031
|
|
|
11923
|
-
if (tokenIsIdentifier(type) || type ===
|
|
11924
|
-
var nodeType = type ===
|
|
12032
|
+
if (tokenIsIdentifier(type) || type === 88 || type === 84) {
|
|
12033
|
+
var nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value);
|
|
11925
12034
|
|
|
11926
12035
|
if (nodeType !== undefined && this.lookaheadCharCode() !== 46) {
|
|
11927
12036
|
var _node6 = this.startNode();
|
|
@@ -11989,7 +12098,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11989
12098
|
|
|
11990
12099
|
tsParseInferType() {
|
|
11991
12100
|
var node = this.startNode();
|
|
11992
|
-
this.expectContextual(
|
|
12101
|
+
this.expectContextual(112);
|
|
11993
12102
|
var typeParameter = this.startNode();
|
|
11994
12103
|
typeParameter.name = this.tsParseTypeParameterName();
|
|
11995
12104
|
node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
|
|
@@ -11998,7 +12107,7 @@ var typescript = superClass => class extends superClass {
|
|
|
11998
12107
|
|
|
11999
12108
|
tsParseTypeOperatorOrHigher() {
|
|
12000
12109
|
var isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc;
|
|
12001
|
-
return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(
|
|
12110
|
+
return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(112) ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher();
|
|
12002
12111
|
}
|
|
12003
12112
|
|
|
12004
12113
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
@@ -12019,15 +12128,15 @@ var typescript = superClass => class extends superClass {
|
|
|
12019
12128
|
}
|
|
12020
12129
|
|
|
12021
12130
|
tsParseIntersectionTypeOrHigher() {
|
|
12022
|
-
return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this),
|
|
12131
|
+
return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45);
|
|
12023
12132
|
}
|
|
12024
12133
|
|
|
12025
12134
|
tsParseUnionTypeOrHigher() {
|
|
12026
|
-
return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this),
|
|
12135
|
+
return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43);
|
|
12027
12136
|
}
|
|
12028
12137
|
|
|
12029
12138
|
tsIsStartOfFunctionType() {
|
|
12030
|
-
if (this.match(
|
|
12139
|
+
if (this.match(47)) {
|
|
12031
12140
|
return true;
|
|
12032
12141
|
}
|
|
12033
12142
|
|
|
@@ -12035,7 +12144,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12035
12144
|
}
|
|
12036
12145
|
|
|
12037
12146
|
tsSkipParameterStart() {
|
|
12038
|
-
if (tokenIsIdentifier(this.state.type) || this.match(
|
|
12147
|
+
if (tokenIsIdentifier(this.state.type) || this.match(78)) {
|
|
12039
12148
|
this.next();
|
|
12040
12149
|
return true;
|
|
12041
12150
|
}
|
|
@@ -12108,7 +12217,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12108
12217
|
var node = this.startNode();
|
|
12109
12218
|
var asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
|
|
12110
12219
|
|
|
12111
|
-
if (asserts && this.match(
|
|
12220
|
+
if (asserts && this.match(78)) {
|
|
12112
12221
|
var thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
|
|
12113
12222
|
|
|
12114
12223
|
if (thisTypePredicate.type === "TSThisType") {
|
|
@@ -12163,21 +12272,21 @@ var typescript = superClass => class extends superClass {
|
|
|
12163
12272
|
tsParseTypePredicatePrefix() {
|
|
12164
12273
|
var id = this.parseIdentifier();
|
|
12165
12274
|
|
|
12166
|
-
if (this.isContextual(
|
|
12275
|
+
if (this.isContextual(113) && !this.hasPrecedingLineBreak()) {
|
|
12167
12276
|
this.next();
|
|
12168
12277
|
return id;
|
|
12169
12278
|
}
|
|
12170
12279
|
}
|
|
12171
12280
|
|
|
12172
12281
|
tsParseTypePredicateAsserts() {
|
|
12173
|
-
if (this.state.type !==
|
|
12282
|
+
if (this.state.type !== 106) {
|
|
12174
12283
|
return false;
|
|
12175
12284
|
}
|
|
12176
12285
|
|
|
12177
12286
|
var containsEsc = this.state.containsEsc;
|
|
12178
12287
|
this.next();
|
|
12179
12288
|
|
|
12180
|
-
if (!tokenIsIdentifier(this.state.type) && !this.match(
|
|
12289
|
+
if (!tokenIsIdentifier(this.state.type) && !this.match(78)) {
|
|
12181
12290
|
return false;
|
|
12182
12291
|
}
|
|
12183
12292
|
|
|
@@ -12204,7 +12313,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12204
12313
|
assert(this.state.inType);
|
|
12205
12314
|
var type = this.tsParseNonConditionalType();
|
|
12206
12315
|
|
|
12207
|
-
if (this.hasPrecedingLineBreak() || !this.eat(
|
|
12316
|
+
if (this.hasPrecedingLineBreak() || !this.eat(81)) {
|
|
12208
12317
|
return type;
|
|
12209
12318
|
}
|
|
12210
12319
|
|
|
@@ -12219,7 +12328,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12219
12328
|
}
|
|
12220
12329
|
|
|
12221
12330
|
isAbstractConstructorSignature() {
|
|
12222
|
-
return this.isContextual(
|
|
12331
|
+
return this.isContextual(120) && this.lookahead().type === 77;
|
|
12223
12332
|
}
|
|
12224
12333
|
|
|
12225
12334
|
tsParseNonConditionalType() {
|
|
@@ -12227,7 +12336,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12227
12336
|
return this.tsParseFunctionOrConstructorType("TSFunctionType");
|
|
12228
12337
|
}
|
|
12229
12338
|
|
|
12230
|
-
if (this.match(
|
|
12339
|
+
if (this.match(77)) {
|
|
12231
12340
|
return this.tsParseFunctionOrConstructorType("TSConstructorType");
|
|
12232
12341
|
} else if (this.isAbstractConstructorSignature()) {
|
|
12233
12342
|
return this.tsParseFunctionOrConstructorType("TSConstructorType", true);
|
|
@@ -12248,7 +12357,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12248
12357
|
var _const = this.tsTryNextParseConstantContext();
|
|
12249
12358
|
|
|
12250
12359
|
node.typeAnnotation = _const || this.tsNextThenParseType();
|
|
12251
|
-
this.expect(
|
|
12360
|
+
this.expect(48);
|
|
12252
12361
|
node.expression = this.parseMaybeUnary();
|
|
12253
12362
|
return this.finishNode(node, "TSTypeAssertion");
|
|
12254
12363
|
}
|
|
@@ -12270,7 +12379,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12270
12379
|
var node = this.startNode();
|
|
12271
12380
|
node.expression = this.tsParseEntityName(false);
|
|
12272
12381
|
|
|
12273
|
-
if (this.match(
|
|
12382
|
+
if (this.match(47)) {
|
|
12274
12383
|
node.typeParameters = this.tsParseTypeArguments();
|
|
12275
12384
|
}
|
|
12276
12385
|
|
|
@@ -12290,7 +12399,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12290
12399
|
|
|
12291
12400
|
node.typeParameters = this.tsTryParseTypeParameters();
|
|
12292
12401
|
|
|
12293
|
-
if (this.eat(
|
|
12402
|
+
if (this.eat(81)) {
|
|
12294
12403
|
node.extends = this.tsParseHeritageClause("extends");
|
|
12295
12404
|
}
|
|
12296
12405
|
|
|
@@ -12307,7 +12416,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12307
12416
|
node.typeAnnotation = this.tsInType(() => {
|
|
12308
12417
|
this.expect(29);
|
|
12309
12418
|
|
|
12310
|
-
if (this.isContextual(
|
|
12419
|
+
if (this.isContextual(111) && this.lookahead().type !== 16) {
|
|
12311
12420
|
var _node8 = this.startNode();
|
|
12312
12421
|
|
|
12313
12422
|
this.next();
|
|
@@ -12363,7 +12472,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12363
12472
|
|
|
12364
12473
|
tsParseEnumMember() {
|
|
12365
12474
|
var node = this.startNode();
|
|
12366
|
-
node.id = this.match(
|
|
12475
|
+
node.id = this.match(129) ? this.parseExprAtom() : this.parseIdentifier(true);
|
|
12367
12476
|
|
|
12368
12477
|
if (this.eat(29)) {
|
|
12369
12478
|
node.initializer = this.parseMaybeAssignAllowIn();
|
|
@@ -12415,10 +12524,10 @@ var typescript = superClass => class extends superClass {
|
|
|
12415
12524
|
}
|
|
12416
12525
|
|
|
12417
12526
|
tsParseAmbientExternalModuleDeclaration(node) {
|
|
12418
|
-
if (this.isContextual(
|
|
12527
|
+
if (this.isContextual(109)) {
|
|
12419
12528
|
node.global = true;
|
|
12420
12529
|
node.id = this.parseIdentifier();
|
|
12421
|
-
} else if (this.match(
|
|
12530
|
+
} else if (this.match(129)) {
|
|
12422
12531
|
node.id = this.parseExprAtom();
|
|
12423
12532
|
} else {
|
|
12424
12533
|
this.unexpected();
|
|
@@ -12456,7 +12565,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12456
12565
|
}
|
|
12457
12566
|
|
|
12458
12567
|
tsIsExternalModuleReference() {
|
|
12459
|
-
return this.isContextual(
|
|
12568
|
+
return this.isContextual(116) && this.lookaheadCharCode() === 40;
|
|
12460
12569
|
}
|
|
12461
12570
|
|
|
12462
12571
|
tsParseModuleReference() {
|
|
@@ -12465,10 +12574,10 @@ var typescript = superClass => class extends superClass {
|
|
|
12465
12574
|
|
|
12466
12575
|
tsParseExternalModuleReference() {
|
|
12467
12576
|
var node = this.startNode();
|
|
12468
|
-
this.expectContextual(
|
|
12577
|
+
this.expectContextual(116);
|
|
12469
12578
|
this.expect(10);
|
|
12470
12579
|
|
|
12471
|
-
if (!this.match(
|
|
12580
|
+
if (!this.match(129)) {
|
|
12472
12581
|
throw this.unexpected();
|
|
12473
12582
|
}
|
|
12474
12583
|
|
|
@@ -12511,33 +12620,33 @@ var typescript = superClass => class extends superClass {
|
|
|
12511
12620
|
var starttype = this.state.type;
|
|
12512
12621
|
var kind;
|
|
12513
12622
|
|
|
12514
|
-
if (this.isContextual(
|
|
12515
|
-
starttype =
|
|
12623
|
+
if (this.isContextual(99)) {
|
|
12624
|
+
starttype = 74;
|
|
12516
12625
|
kind = "let";
|
|
12517
12626
|
}
|
|
12518
12627
|
|
|
12519
12628
|
return this.tsInAmbientContext(() => {
|
|
12520
12629
|
switch (starttype) {
|
|
12521
|
-
case
|
|
12630
|
+
case 68:
|
|
12522
12631
|
nany.declare = true;
|
|
12523
12632
|
return this.parseFunctionStatement(nany, false, true);
|
|
12524
12633
|
|
|
12525
|
-
case
|
|
12634
|
+
case 80:
|
|
12526
12635
|
nany.declare = true;
|
|
12527
12636
|
return this.parseClass(nany, true, false);
|
|
12528
12637
|
|
|
12529
|
-
case
|
|
12530
|
-
if (this.match(
|
|
12531
|
-
this.expect(
|
|
12532
|
-
this.expectContextual(
|
|
12638
|
+
case 75:
|
|
12639
|
+
if (this.match(75) && this.isLookaheadContextual("enum")) {
|
|
12640
|
+
this.expect(75);
|
|
12641
|
+
this.expectContextual(122);
|
|
12533
12642
|
return this.tsParseEnumDeclaration(nany, true);
|
|
12534
12643
|
}
|
|
12535
12644
|
|
|
12536
|
-
case
|
|
12645
|
+
case 74:
|
|
12537
12646
|
kind = kind || this.state.value;
|
|
12538
12647
|
return this.parseVarStatement(nany, kind);
|
|
12539
12648
|
|
|
12540
|
-
case
|
|
12649
|
+
case 109:
|
|
12541
12650
|
return this.tsParseAmbientExternalModuleDeclaration(nany);
|
|
12542
12651
|
|
|
12543
12652
|
default:
|
|
@@ -12591,7 +12700,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12591
12700
|
tsParseDeclaration(node, value, next) {
|
|
12592
12701
|
switch (value) {
|
|
12593
12702
|
case "abstract":
|
|
12594
|
-
if (this.tsCheckLineTerminator(next) && (this.match(
|
|
12703
|
+
if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) {
|
|
12595
12704
|
return this.tsParseAbstractDeclaration(node);
|
|
12596
12705
|
}
|
|
12597
12706
|
|
|
@@ -12614,7 +12723,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12614
12723
|
|
|
12615
12724
|
case "module":
|
|
12616
12725
|
if (this.tsCheckLineTerminator(next)) {
|
|
12617
|
-
if (this.match(
|
|
12726
|
+
if (this.match(129)) {
|
|
12618
12727
|
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
12619
12728
|
} else if (tokenIsIdentifier(this.state.type)) {
|
|
12620
12729
|
return this.tsParseModuleOrNamespaceDeclaration(node);
|
|
@@ -12650,7 +12759,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12650
12759
|
}
|
|
12651
12760
|
|
|
12652
12761
|
tsTryParseGenericAsyncArrowFunction(startPos, startLoc) {
|
|
12653
|
-
if (!this.match(
|
|
12762
|
+
if (!this.match(47)) {
|
|
12654
12763
|
return undefined;
|
|
12655
12764
|
}
|
|
12656
12765
|
|
|
@@ -12673,10 +12782,18 @@ var typescript = superClass => class extends superClass {
|
|
|
12673
12782
|
return this.parseArrowExpression(res, null, true);
|
|
12674
12783
|
}
|
|
12675
12784
|
|
|
12785
|
+
tsParseTypeArgumentsInExpression() {
|
|
12786
|
+
if (this.reScan_lt() !== 47) {
|
|
12787
|
+
return undefined;
|
|
12788
|
+
}
|
|
12789
|
+
|
|
12790
|
+
return this.tsParseTypeArguments();
|
|
12791
|
+
}
|
|
12792
|
+
|
|
12676
12793
|
tsParseTypeArguments() {
|
|
12677
12794
|
var node = this.startNode();
|
|
12678
12795
|
node.params = this.tsInType(() => this.tsInNoContext(() => {
|
|
12679
|
-
this.expect(
|
|
12796
|
+
this.expect(47);
|
|
12680
12797
|
return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
|
|
12681
12798
|
}));
|
|
12682
12799
|
|
|
@@ -12686,7 +12803,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12686
12803
|
});
|
|
12687
12804
|
}
|
|
12688
12805
|
|
|
12689
|
-
this.expect(
|
|
12806
|
+
this.expect(48);
|
|
12690
12807
|
return this.finishNode(node, "TSTypeParameterInstantiation");
|
|
12691
12808
|
}
|
|
12692
12809
|
|
|
@@ -12834,7 +12951,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12834
12951
|
this.next();
|
|
12835
12952
|
}
|
|
12836
12953
|
|
|
12837
|
-
if (this.match(
|
|
12954
|
+
if (this.match(47) || this.match(51)) {
|
|
12838
12955
|
var missingParenErrorLoc;
|
|
12839
12956
|
var result = this.tsTryParseAndCatch(() => {
|
|
12840
12957
|
if (!noCalls && this.atPossibleAsyncArrow(base)) {
|
|
@@ -12847,7 +12964,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12847
12964
|
|
|
12848
12965
|
var node = this.startNodeAt(startPos, startLoc);
|
|
12849
12966
|
node.callee = base;
|
|
12850
|
-
var typeArguments = this.
|
|
12967
|
+
var typeArguments = this.tsParseTypeArgumentsInExpression();
|
|
12851
12968
|
|
|
12852
12969
|
if (typeArguments) {
|
|
12853
12970
|
if (isOptionalCall && !this.match(10)) {
|
|
@@ -12887,9 +13004,9 @@ var typescript = superClass => class extends superClass {
|
|
|
12887
13004
|
}
|
|
12888
13005
|
|
|
12889
13006
|
parseNewArguments(node) {
|
|
12890
|
-
if (this.match(
|
|
13007
|
+
if (this.match(47) || this.match(51)) {
|
|
12891
13008
|
var typeParameters = this.tsTryParseAndCatch(() => {
|
|
12892
|
-
var args = this.
|
|
13009
|
+
var args = this.tsParseTypeArgumentsInExpression();
|
|
12893
13010
|
if (!this.match(10)) this.unexpected();
|
|
12894
13011
|
return args;
|
|
12895
13012
|
});
|
|
@@ -12903,7 +13020,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12903
13020
|
}
|
|
12904
13021
|
|
|
12905
13022
|
parseExprOp(left, leftStartPos, leftStartLoc, minPrec) {
|
|
12906
|
-
if (tokenOperatorPrecedence(
|
|
13023
|
+
if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual(93)) {
|
|
12907
13024
|
var node = this.startNodeAt(leftStartPos, leftStartLoc);
|
|
12908
13025
|
node.expression = left;
|
|
12909
13026
|
|
|
@@ -12930,10 +13047,10 @@ var typescript = superClass => class extends superClass {
|
|
|
12930
13047
|
parseImport(node) {
|
|
12931
13048
|
node.importKind = "value";
|
|
12932
13049
|
|
|
12933
|
-
if (tokenIsIdentifier(this.state.type) || this.match(
|
|
13050
|
+
if (tokenIsIdentifier(this.state.type) || this.match(55) || this.match(5)) {
|
|
12934
13051
|
var ahead = this.lookahead();
|
|
12935
13052
|
|
|
12936
|
-
if (this.isContextual(
|
|
13053
|
+
if (this.isContextual(126) && ahead.type !== 12 && ahead.type !== 97 && ahead.type !== 29) {
|
|
12937
13054
|
node.importKind = "type";
|
|
12938
13055
|
this.next();
|
|
12939
13056
|
ahead = this.lookahead();
|
|
@@ -12956,10 +13073,10 @@ var typescript = superClass => class extends superClass {
|
|
|
12956
13073
|
}
|
|
12957
13074
|
|
|
12958
13075
|
parseExport(node) {
|
|
12959
|
-
if (this.match(
|
|
13076
|
+
if (this.match(83)) {
|
|
12960
13077
|
this.next();
|
|
12961
13078
|
|
|
12962
|
-
if (this.isContextual(
|
|
13079
|
+
if (this.isContextual(126) && this.lookaheadCharCode() !== 61) {
|
|
12963
13080
|
node.importKind = "type";
|
|
12964
13081
|
this.next();
|
|
12965
13082
|
} else {
|
|
@@ -12972,14 +13089,14 @@ var typescript = superClass => class extends superClass {
|
|
|
12972
13089
|
assign.expression = this.parseExpression();
|
|
12973
13090
|
this.semicolon();
|
|
12974
13091
|
return this.finishNode(assign, "TSExportAssignment");
|
|
12975
|
-
} else if (this.eatContextual(
|
|
13092
|
+
} else if (this.eatContextual(93)) {
|
|
12976
13093
|
var decl = node;
|
|
12977
|
-
this.expectContextual(
|
|
13094
|
+
this.expectContextual(124);
|
|
12978
13095
|
decl.id = this.parseIdentifier();
|
|
12979
13096
|
this.semicolon();
|
|
12980
13097
|
return this.finishNode(decl, "TSNamespaceExportDeclaration");
|
|
12981
13098
|
} else {
|
|
12982
|
-
if (this.isContextual(
|
|
13099
|
+
if (this.isContextual(126) && this.lookahead().type === 5) {
|
|
12983
13100
|
this.next();
|
|
12984
13101
|
node.exportKind = "type";
|
|
12985
13102
|
} else {
|
|
@@ -12991,7 +13108,7 @@ var typescript = superClass => class extends superClass {
|
|
|
12991
13108
|
}
|
|
12992
13109
|
|
|
12993
13110
|
isAbstractClass() {
|
|
12994
|
-
return this.isContextual(
|
|
13111
|
+
return this.isContextual(120) && this.lookahead().type === 80;
|
|
12995
13112
|
}
|
|
12996
13113
|
|
|
12997
13114
|
parseExportDefaultExpression() {
|
|
@@ -13003,7 +13120,7 @@ var typescript = superClass => class extends superClass {
|
|
|
13003
13120
|
return cls;
|
|
13004
13121
|
}
|
|
13005
13122
|
|
|
13006
|
-
if (this.match(
|
|
13123
|
+
if (this.match(125)) {
|
|
13007
13124
|
var interfaceNode = this.startNode();
|
|
13008
13125
|
this.next();
|
|
13009
13126
|
var result = this.tsParseInterfaceDeclaration(interfaceNode);
|
|
@@ -13014,13 +13131,13 @@ var typescript = superClass => class extends superClass {
|
|
|
13014
13131
|
}
|
|
13015
13132
|
|
|
13016
13133
|
parseStatementContent(context, topLevel) {
|
|
13017
|
-
if (this.state.type ===
|
|
13134
|
+
if (this.state.type === 75) {
|
|
13018
13135
|
var ahead = this.lookahead();
|
|
13019
13136
|
|
|
13020
|
-
if (ahead.type ===
|
|
13137
|
+
if (ahead.type === 122) {
|
|
13021
13138
|
var node = this.startNode();
|
|
13022
13139
|
this.next();
|
|
13023
|
-
this.expectContextual(
|
|
13140
|
+
this.expectContextual(122);
|
|
13024
13141
|
return this.tsParseEnumDeclaration(node, true);
|
|
13025
13142
|
}
|
|
13026
13143
|
}
|
|
@@ -13043,7 +13160,7 @@ var typescript = superClass => class extends superClass {
|
|
|
13043
13160
|
}
|
|
13044
13161
|
|
|
13045
13162
|
tsIsStartOfStaticBlocks() {
|
|
13046
|
-
return this.isContextual(
|
|
13163
|
+
return this.isContextual(104) && this.lookaheadCharCode() === 123;
|
|
13047
13164
|
}
|
|
13048
13165
|
|
|
13049
13166
|
parseClassMember(classBody, member, state) {
|
|
@@ -13191,9 +13308,9 @@ var typescript = superClass => class extends superClass {
|
|
|
13191
13308
|
parseExportDeclaration(node) {
|
|
13192
13309
|
var startPos = this.state.start;
|
|
13193
13310
|
var startLoc = this.state.startLoc;
|
|
13194
|
-
var isDeclare = this.eatContextual(
|
|
13311
|
+
var isDeclare = this.eatContextual(121);
|
|
13195
13312
|
|
|
13196
|
-
if (isDeclare && (this.isContextual(
|
|
13313
|
+
if (isDeclare && (this.isContextual(121) || !this.shouldParseExportDeclaration())) {
|
|
13197
13314
|
throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, {
|
|
13198
13315
|
at: this.state.startLoc
|
|
13199
13316
|
});
|
|
@@ -13222,7 +13339,7 @@ var typescript = superClass => class extends superClass {
|
|
|
13222
13339
|
}
|
|
13223
13340
|
|
|
13224
13341
|
parseClassId(node, isStatement, optionalId) {
|
|
13225
|
-
if ((!isStatement || optionalId) && this.isContextual(
|
|
13342
|
+
if ((!isStatement || optionalId) && this.isContextual(110)) {
|
|
13226
13343
|
return;
|
|
13227
13344
|
}
|
|
13228
13345
|
|
|
@@ -13312,11 +13429,11 @@ var typescript = superClass => class extends superClass {
|
|
|
13312
13429
|
parseClassSuper(node) {
|
|
13313
13430
|
super.parseClassSuper(node);
|
|
13314
13431
|
|
|
13315
|
-
if (node.superClass && this.match(
|
|
13316
|
-
node.superTypeParameters = this.
|
|
13432
|
+
if (node.superClass && (this.match(47) || this.match(51))) {
|
|
13433
|
+
node.superTypeParameters = this.tsParseTypeArgumentsInExpression();
|
|
13317
13434
|
}
|
|
13318
13435
|
|
|
13319
|
-
if (this.eatContextual(
|
|
13436
|
+
if (this.eatContextual(110)) {
|
|
13320
13437
|
node.implements = this.tsParseHeritageClause("implements");
|
|
13321
13438
|
}
|
|
13322
13439
|
}
|
|
@@ -13372,7 +13489,7 @@ var typescript = superClass => class extends superClass {
|
|
|
13372
13489
|
var jsx;
|
|
13373
13490
|
var typeCast;
|
|
13374
13491
|
|
|
13375
|
-
if (this.hasPlugin("jsx") && (this.match(
|
|
13492
|
+
if (this.hasPlugin("jsx") && (this.match(138) || this.match(47))) {
|
|
13376
13493
|
state = this.state.clone();
|
|
13377
13494
|
jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);
|
|
13378
13495
|
if (!jsx.error) return jsx.node;
|
|
@@ -13386,7 +13503,7 @@ var typescript = superClass => class extends superClass {
|
|
|
13386
13503
|
}
|
|
13387
13504
|
}
|
|
13388
13505
|
|
|
13389
|
-
if (!((_jsx = jsx) != null && _jsx.error) && !this.match(
|
|
13506
|
+
if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) {
|
|
13390
13507
|
return super.parseMaybeAssign(...args);
|
|
13391
13508
|
}
|
|
13392
13509
|
|
|
@@ -13454,7 +13571,7 @@ var typescript = superClass => class extends superClass {
|
|
|
13454
13571
|
}
|
|
13455
13572
|
|
|
13456
13573
|
parseMaybeUnary(refExpressionErrors) {
|
|
13457
|
-
if (!this.hasPlugin("jsx") && this.match(
|
|
13574
|
+
if (!this.hasPlugin("jsx") && this.match(47)) {
|
|
13458
13575
|
return this.tsParseTypeAssertion();
|
|
13459
13576
|
} else {
|
|
13460
13577
|
return super.parseMaybeUnary(refExpressionErrors);
|
|
@@ -13586,7 +13703,7 @@ var typescript = superClass => class extends superClass {
|
|
|
13586
13703
|
|
|
13587
13704
|
parseBindingAtom() {
|
|
13588
13705
|
switch (this.state.type) {
|
|
13589
|
-
case
|
|
13706
|
+
case 78:
|
|
13590
13707
|
return this.parseIdentifier(true);
|
|
13591
13708
|
|
|
13592
13709
|
default:
|
|
@@ -13595,8 +13712,8 @@ var typescript = superClass => class extends superClass {
|
|
|
13595
13712
|
}
|
|
13596
13713
|
|
|
13597
13714
|
parseMaybeDecoratorArguments(expr) {
|
|
13598
|
-
if (this.match(
|
|
13599
|
-
var typeArguments = this.
|
|
13715
|
+
if (this.match(47) || this.match(51)) {
|
|
13716
|
+
var typeArguments = this.tsParseTypeArgumentsInExpression();
|
|
13600
13717
|
|
|
13601
13718
|
if (this.match(10)) {
|
|
13602
13719
|
var call = super.parseMaybeDecoratorArguments(expr);
|
|
@@ -13620,7 +13737,7 @@ var typescript = superClass => class extends superClass {
|
|
|
13620
13737
|
}
|
|
13621
13738
|
|
|
13622
13739
|
isClassMethod() {
|
|
13623
|
-
return this.match(
|
|
13740
|
+
return this.match(47) || super.isClassMethod();
|
|
13624
13741
|
}
|
|
13625
13742
|
|
|
13626
13743
|
isClassProperty() {
|
|
@@ -13642,11 +13759,11 @@ var typescript = superClass => class extends superClass {
|
|
|
13642
13759
|
getTokenFromCode(code) {
|
|
13643
13760
|
if (this.state.inType) {
|
|
13644
13761
|
if (code === 62) {
|
|
13645
|
-
return this.finishOp(
|
|
13762
|
+
return this.finishOp(48, 1);
|
|
13646
13763
|
}
|
|
13647
13764
|
|
|
13648
13765
|
if (code === 60) {
|
|
13649
|
-
return this.finishOp(
|
|
13766
|
+
return this.finishOp(47, 1);
|
|
13650
13767
|
}
|
|
13651
13768
|
}
|
|
13652
13769
|
|
|
@@ -13658,15 +13775,29 @@ var typescript = superClass => class extends superClass {
|
|
|
13658
13775
|
type
|
|
13659
13776
|
} = this.state;
|
|
13660
13777
|
|
|
13661
|
-
if (type ===
|
|
13778
|
+
if (type === 47) {
|
|
13662
13779
|
this.state.pos -= 1;
|
|
13663
13780
|
this.readToken_lt();
|
|
13664
|
-
} else if (type ===
|
|
13781
|
+
} else if (type === 48) {
|
|
13665
13782
|
this.state.pos -= 1;
|
|
13666
13783
|
this.readToken_gt();
|
|
13667
13784
|
}
|
|
13668
13785
|
}
|
|
13669
13786
|
|
|
13787
|
+
reScan_lt() {
|
|
13788
|
+
var {
|
|
13789
|
+
type
|
|
13790
|
+
} = this.state;
|
|
13791
|
+
|
|
13792
|
+
if (type === 51) {
|
|
13793
|
+
this.state.pos -= 2;
|
|
13794
|
+
this.finishOp(47, 1);
|
|
13795
|
+
return 47;
|
|
13796
|
+
}
|
|
13797
|
+
|
|
13798
|
+
return type;
|
|
13799
|
+
}
|
|
13800
|
+
|
|
13670
13801
|
toAssignableList(exprList) {
|
|
13671
13802
|
for (var i = 0; i < exprList.length; i++) {
|
|
13672
13803
|
var expr = exprList[i];
|
|
@@ -13717,8 +13848,8 @@ var typescript = superClass => class extends superClass {
|
|
|
13717
13848
|
}
|
|
13718
13849
|
|
|
13719
13850
|
jsxParseOpeningElementAfterName(node) {
|
|
13720
|
-
if (this.match(
|
|
13721
|
-
var typeArguments = this.tsTryParseAndCatch(() => this.
|
|
13851
|
+
if (this.match(47) || this.match(51)) {
|
|
13852
|
+
var typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression());
|
|
13722
13853
|
if (typeArguments) node.typeParameters = typeArguments;
|
|
13723
13854
|
}
|
|
13724
13855
|
|
|
@@ -13772,10 +13903,10 @@ var typescript = superClass => class extends superClass {
|
|
|
13772
13903
|
}
|
|
13773
13904
|
|
|
13774
13905
|
tsParseAbstractDeclaration(node) {
|
|
13775
|
-
if (this.match(
|
|
13906
|
+
if (this.match(80)) {
|
|
13776
13907
|
node.abstract = true;
|
|
13777
13908
|
return this.parseClass(node, true, false);
|
|
13778
|
-
} else if (this.isContextual(
|
|
13909
|
+
} else if (this.isContextual(125)) {
|
|
13779
13910
|
if (!this.hasFollowingLineBreak()) {
|
|
13780
13911
|
node.abstract = true;
|
|
13781
13912
|
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, {
|
|
@@ -13785,7 +13916,7 @@ var typescript = superClass => class extends superClass {
|
|
|
13785
13916
|
return this.tsParseInterfaceDeclaration(node);
|
|
13786
13917
|
}
|
|
13787
13918
|
} else {
|
|
13788
|
-
this.unexpected(null,
|
|
13919
|
+
this.unexpected(null, 80);
|
|
13789
13920
|
}
|
|
13790
13921
|
}
|
|
13791
13922
|
|
|
@@ -13862,10 +13993,10 @@ var typescript = superClass => class extends superClass {
|
|
|
13862
13993
|
var canParseAsKeyword = true;
|
|
13863
13994
|
var loc = leftOfAs.loc.start;
|
|
13864
13995
|
|
|
13865
|
-
if (this.isContextual(
|
|
13996
|
+
if (this.isContextual(93)) {
|
|
13866
13997
|
var firstAs = this.parseIdentifier();
|
|
13867
13998
|
|
|
13868
|
-
if (this.isContextual(
|
|
13999
|
+
if (this.isContextual(93)) {
|
|
13869
14000
|
var secondAs = this.parseIdentifier();
|
|
13870
14001
|
|
|
13871
14002
|
if (tokenIsKeywordOrIdentifier(this.state.type)) {
|
|
@@ -13900,7 +14031,7 @@ var typescript = superClass => class extends superClass {
|
|
|
13900
14031
|
var kindKey = isImport ? "importKind" : "exportKind";
|
|
13901
14032
|
node[kindKey] = hasTypeSpecifier ? "type" : "value";
|
|
13902
14033
|
|
|
13903
|
-
if (canParseAsKeyword && this.eatContextual(
|
|
14034
|
+
if (canParseAsKeyword && this.eatContextual(93)) {
|
|
13904
14035
|
node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName();
|
|
13905
14036
|
}
|
|
13906
14037
|
|
|
@@ -13921,13 +14052,13 @@ var PlaceholderErrors = makeErrorTemplates({
|
|
|
13921
14052
|
|
|
13922
14053
|
var placeholders = superClass => class extends superClass {
|
|
13923
14054
|
parsePlaceholder(expectedNode) {
|
|
13924
|
-
if (this.match(
|
|
14055
|
+
if (this.match(140)) {
|
|
13925
14056
|
var node = this.startNode();
|
|
13926
14057
|
this.next();
|
|
13927
14058
|
this.assertNoSpace("Unexpected space in placeholder.");
|
|
13928
14059
|
node.name = super.parseIdentifier(true);
|
|
13929
14060
|
this.assertNoSpace("Unexpected space in placeholder.");
|
|
13930
|
-
this.expect(
|
|
14061
|
+
this.expect(140);
|
|
13931
14062
|
return this.finishPlaceholder(node, expectedNode);
|
|
13932
14063
|
}
|
|
13933
14064
|
}
|
|
@@ -13940,7 +14071,7 @@ var placeholders = superClass => class extends superClass {
|
|
|
13940
14071
|
|
|
13941
14072
|
getTokenFromCode(code) {
|
|
13942
14073
|
if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
|
|
13943
|
-
return this.finishOp(
|
|
14074
|
+
return this.finishOp(140, 2);
|
|
13944
14075
|
}
|
|
13945
14076
|
|
|
13946
14077
|
return super.getTokenFromCode(...arguments);
|
|
@@ -13980,14 +14111,14 @@ var placeholders = superClass => class extends superClass {
|
|
|
13980
14111
|
return true;
|
|
13981
14112
|
}
|
|
13982
14113
|
|
|
13983
|
-
if (!this.isContextual(
|
|
14114
|
+
if (!this.isContextual(99)) {
|
|
13984
14115
|
return false;
|
|
13985
14116
|
}
|
|
13986
14117
|
|
|
13987
14118
|
if (context) return false;
|
|
13988
14119
|
var nextToken = this.lookahead();
|
|
13989
14120
|
|
|
13990
|
-
if (nextToken.type ===
|
|
14121
|
+
if (nextToken.type === 140) {
|
|
13991
14122
|
return true;
|
|
13992
14123
|
}
|
|
13993
14124
|
|
|
@@ -14033,7 +14164,7 @@ var placeholders = superClass => class extends superClass {
|
|
|
14033
14164
|
var placeholder = this.parsePlaceholder("Identifier");
|
|
14034
14165
|
|
|
14035
14166
|
if (placeholder) {
|
|
14036
|
-
if (this.match(
|
|
14167
|
+
if (this.match(81) || this.match(140) || this.match(5)) {
|
|
14037
14168
|
node.id = placeholder;
|
|
14038
14169
|
} else if (optionalId || !isStatement) {
|
|
14039
14170
|
node.id = null;
|
|
@@ -14057,7 +14188,7 @@ var placeholders = superClass => class extends superClass {
|
|
|
14057
14188
|
var placeholder = this.parsePlaceholder("Identifier");
|
|
14058
14189
|
if (!placeholder) return super.parseExport(...arguments);
|
|
14059
14190
|
|
|
14060
|
-
if (!this.isContextual(
|
|
14191
|
+
if (!this.isContextual(97) && !this.match(12)) {
|
|
14061
14192
|
node.specifiers = [];
|
|
14062
14193
|
node.source = null;
|
|
14063
14194
|
node.declaration = this.finishPlaceholder(placeholder, "Declaration");
|
|
@@ -14072,11 +14203,11 @@ var placeholders = superClass => class extends superClass {
|
|
|
14072
14203
|
}
|
|
14073
14204
|
|
|
14074
14205
|
isExportDefaultSpecifier() {
|
|
14075
|
-
if (this.match(
|
|
14206
|
+
if (this.match(65)) {
|
|
14076
14207
|
var next = this.nextTokenStart();
|
|
14077
14208
|
|
|
14078
14209
|
if (this.isUnparsedContextual(next, "from")) {
|
|
14079
|
-
if (this.input.startsWith(tokenLabelName(
|
|
14210
|
+
if (this.input.startsWith(tokenLabelName(140), this.nextTokenStartSince(next + 4))) {
|
|
14080
14211
|
return true;
|
|
14081
14212
|
}
|
|
14082
14213
|
}
|
|
@@ -14111,7 +14242,7 @@ var placeholders = superClass => class extends superClass {
|
|
|
14111
14242
|
if (!placeholder) return super.parseImport(...arguments);
|
|
14112
14243
|
node.specifiers = [];
|
|
14113
14244
|
|
|
14114
|
-
if (!this.isContextual(
|
|
14245
|
+
if (!this.isContextual(97) && !this.match(12)) {
|
|
14115
14246
|
node.source = this.finishPlaceholder(placeholder, "StringLiteral");
|
|
14116
14247
|
this.semicolon();
|
|
14117
14248
|
return this.finishNode(node, "ImportDeclaration");
|
|
@@ -14127,7 +14258,7 @@ var placeholders = superClass => class extends superClass {
|
|
|
14127
14258
|
if (!hasStarImport) this.parseNamedImportSpecifiers(node);
|
|
14128
14259
|
}
|
|
14129
14260
|
|
|
14130
|
-
this.expectContextual(
|
|
14261
|
+
this.expectContextual(97);
|
|
14131
14262
|
node.source = this.parseImportSource();
|
|
14132
14263
|
this.semicolon();
|
|
14133
14264
|
return this.finishNode(node, "ImportDeclaration");
|
|
@@ -14141,7 +14272,7 @@ var placeholders = superClass => class extends superClass {
|
|
|
14141
14272
|
|
|
14142
14273
|
var v8intrinsic = superClass => class extends superClass {
|
|
14143
14274
|
parseV8Intrinsic() {
|
|
14144
|
-
if (this.match(
|
|
14275
|
+
if (this.match(54)) {
|
|
14145
14276
|
var v8IntrinsicStartLoc = this.state.startLoc;
|
|
14146
14277
|
var node = this.startNode();
|
|
14147
14278
|
this.next();
|
|
@@ -14208,7 +14339,7 @@ function getPluginOption(plugins, name, option) {
|
|
|
14208
14339
|
}
|
|
14209
14340
|
|
|
14210
14341
|
var PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"];
|
|
14211
|
-
var TOPIC_TOKENS = ["^", "%", "#"];
|
|
14342
|
+
var TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"];
|
|
14212
14343
|
var RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
|
|
14213
14344
|
|
|
14214
14345
|
function validatePlugins(plugins) {
|
|
@@ -14391,8 +14522,19 @@ class LValParser extends NodeUtils {
|
|
|
14391
14522
|
break;
|
|
14392
14523
|
|
|
14393
14524
|
case "ObjectProperty":
|
|
14394
|
-
|
|
14395
|
-
|
|
14525
|
+
{
|
|
14526
|
+
var {
|
|
14527
|
+
key,
|
|
14528
|
+
value
|
|
14529
|
+
} = node;
|
|
14530
|
+
|
|
14531
|
+
if (this.isPrivateName(key)) {
|
|
14532
|
+
this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
|
|
14533
|
+
}
|
|
14534
|
+
|
|
14535
|
+
this.toAssignable(value, isLHS);
|
|
14536
|
+
break;
|
|
14537
|
+
}
|
|
14396
14538
|
|
|
14397
14539
|
case "SpreadElement":
|
|
14398
14540
|
{
|
|
@@ -14632,6 +14774,10 @@ class LValParser extends NodeUtils {
|
|
|
14632
14774
|
|
|
14633
14775
|
if (type === 21) {
|
|
14634
14776
|
return this.parseBindingRestProperty(prop);
|
|
14777
|
+
} else if (type === 134) {
|
|
14778
|
+
this.expectPlugin("destructuringPrivate", startLoc);
|
|
14779
|
+
this.classScope.usePrivateName(this.state.value, startLoc);
|
|
14780
|
+
prop.key = this.parsePrivateName();
|
|
14635
14781
|
} else {
|
|
14636
14782
|
this.parsePropertyName(prop);
|
|
14637
14783
|
}
|
|
@@ -14824,7 +14970,7 @@ class ExpressionParser extends LValParser {
|
|
|
14824
14970
|
this.nextToken();
|
|
14825
14971
|
var expr = this.parseExpression();
|
|
14826
14972
|
|
|
14827
|
-
if (!this.match(
|
|
14973
|
+
if (!this.match(135)) {
|
|
14828
14974
|
this.unexpected();
|
|
14829
14975
|
}
|
|
14830
14976
|
|
|
@@ -14885,7 +15031,7 @@ class ExpressionParser extends LValParser {
|
|
|
14885
15031
|
var startPos = this.state.start;
|
|
14886
15032
|
var startLoc = this.state.startLoc;
|
|
14887
15033
|
|
|
14888
|
-
if (this.isContextual(
|
|
15034
|
+
if (this.isContextual(105)) {
|
|
14889
15035
|
if (this.prodParam.hasYield) {
|
|
14890
15036
|
var _left2 = this.parseYield();
|
|
14891
15037
|
|
|
@@ -14928,13 +15074,18 @@ class ExpressionParser extends LValParser {
|
|
|
14928
15074
|
if (this.match(29)) {
|
|
14929
15075
|
node.left = this.toAssignable(left, true);
|
|
14930
15076
|
|
|
14931
|
-
if (refExpressionErrors.doubleProtoLoc != null &&
|
|
15077
|
+
if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startPos) {
|
|
14932
15078
|
refExpressionErrors.doubleProtoLoc = null;
|
|
14933
15079
|
}
|
|
14934
15080
|
|
|
14935
|
-
if (refExpressionErrors.shorthandAssignLoc != null &&
|
|
15081
|
+
if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startPos) {
|
|
14936
15082
|
refExpressionErrors.shorthandAssignLoc = null;
|
|
14937
15083
|
}
|
|
15084
|
+
|
|
15085
|
+
if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startPos) {
|
|
15086
|
+
this.checkDestructuringPrivate(refExpressionErrors);
|
|
15087
|
+
refExpressionErrors.privateKeyLoc = null;
|
|
15088
|
+
}
|
|
14938
15089
|
} else {
|
|
14939
15090
|
node.left = left;
|
|
14940
15091
|
}
|
|
@@ -14977,7 +15128,7 @@ class ExpressionParser extends LValParser {
|
|
|
14977
15128
|
}
|
|
14978
15129
|
|
|
14979
15130
|
parseMaybeUnaryOrPrivate(refExpressionErrors) {
|
|
14980
|
-
return this.match(
|
|
15131
|
+
return this.match(134) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
|
|
14981
15132
|
}
|
|
14982
15133
|
|
|
14983
15134
|
parseExprOps(refExpressionErrors) {
|
|
@@ -14997,7 +15148,7 @@ class ExpressionParser extends LValParser {
|
|
|
14997
15148
|
if (this.isPrivateName(left)) {
|
|
14998
15149
|
var value = this.getPrivateNameSV(left);
|
|
14999
15150
|
|
|
15000
|
-
if (minPrec >= tokenOperatorPrecedence(
|
|
15151
|
+
if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) {
|
|
15001
15152
|
this.raise(ErrorMessages.PrivateInExpectedIn, {
|
|
15002
15153
|
node: left
|
|
15003
15154
|
}, value);
|
|
@@ -15008,11 +15159,11 @@ class ExpressionParser extends LValParser {
|
|
|
15008
15159
|
|
|
15009
15160
|
var op = this.state.type;
|
|
15010
15161
|
|
|
15011
|
-
if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(
|
|
15162
|
+
if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) {
|
|
15012
15163
|
var prec = tokenOperatorPrecedence(op);
|
|
15013
15164
|
|
|
15014
15165
|
if (prec > minPrec) {
|
|
15015
|
-
if (op ===
|
|
15166
|
+
if (op === 39) {
|
|
15016
15167
|
this.expectPlugin("pipelineOperator");
|
|
15017
15168
|
|
|
15018
15169
|
if (this.state.inFSharpPipelineDirectBody) {
|
|
@@ -15025,19 +15176,19 @@ class ExpressionParser extends LValParser {
|
|
|
15025
15176
|
var node = this.startNodeAt(leftStartPos, leftStartLoc);
|
|
15026
15177
|
node.left = left;
|
|
15027
15178
|
node.operator = this.state.value;
|
|
15028
|
-
var logical = op ===
|
|
15029
|
-
var coalesce = op ===
|
|
15179
|
+
var logical = op === 41 || op === 42;
|
|
15180
|
+
var coalesce = op === 40;
|
|
15030
15181
|
|
|
15031
15182
|
if (coalesce) {
|
|
15032
|
-
prec = tokenOperatorPrecedence(
|
|
15183
|
+
prec = tokenOperatorPrecedence(42);
|
|
15033
15184
|
}
|
|
15034
15185
|
|
|
15035
15186
|
this.next();
|
|
15036
15187
|
|
|
15037
|
-
if (op ===
|
|
15188
|
+
if (op === 39 && this.hasPlugin(["pipelineOperator", {
|
|
15038
15189
|
proposal: "minimal"
|
|
15039
15190
|
}])) {
|
|
15040
|
-
if (this.state.type ===
|
|
15191
|
+
if (this.state.type === 96 && this.prodParam.hasAwait) {
|
|
15041
15192
|
throw this.raise(ErrorMessages.UnexpectedAwaitAfterPipelineBody, {
|
|
15042
15193
|
at: this.state.startLoc
|
|
15043
15194
|
});
|
|
@@ -15048,7 +15199,7 @@ class ExpressionParser extends LValParser {
|
|
|
15048
15199
|
this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
|
|
15049
15200
|
var nextOp = this.state.type;
|
|
15050
15201
|
|
|
15051
|
-
if (coalesce && (nextOp ===
|
|
15202
|
+
if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) {
|
|
15052
15203
|
throw this.raise(ErrorMessages.MixingCoalesceWithLogical, {
|
|
15053
15204
|
at: this.state.startLoc
|
|
15054
15205
|
});
|
|
@@ -15066,7 +15217,7 @@ class ExpressionParser extends LValParser {
|
|
|
15066
15217
|
var startLoc = this.state.startLoc;
|
|
15067
15218
|
|
|
15068
15219
|
switch (op) {
|
|
15069
|
-
case
|
|
15220
|
+
case 39:
|
|
15070
15221
|
switch (this.getPluginOption("pipelineOperator", "proposal")) {
|
|
15071
15222
|
case "hack":
|
|
15072
15223
|
return this.withTopicBindingContext(() => {
|
|
@@ -15075,7 +15226,7 @@ class ExpressionParser extends LValParser {
|
|
|
15075
15226
|
|
|
15076
15227
|
case "smart":
|
|
15077
15228
|
return this.withTopicBindingContext(() => {
|
|
15078
|
-
if (this.prodParam.hasYield && this.isContextual(
|
|
15229
|
+
if (this.prodParam.hasYield && this.isContextual(105)) {
|
|
15079
15230
|
throw this.raise(ErrorMessages.PipeBodyIsTighter, {
|
|
15080
15231
|
at: this.state.startLoc
|
|
15081
15232
|
}, this.state.value);
|
|
@@ -15125,7 +15276,7 @@ class ExpressionParser extends LValParser {
|
|
|
15125
15276
|
}
|
|
15126
15277
|
|
|
15127
15278
|
checkExponentialAfterUnary(node) {
|
|
15128
|
-
if (this.match(
|
|
15279
|
+
if (this.match(57)) {
|
|
15129
15280
|
this.raise(ErrorMessages.UnexpectedTokenUnaryExponentiation, {
|
|
15130
15281
|
node: node.argument
|
|
15131
15282
|
});
|
|
@@ -15135,7 +15286,7 @@ class ExpressionParser extends LValParser {
|
|
|
15135
15286
|
parseMaybeUnary(refExpressionErrors, sawUnary) {
|
|
15136
15287
|
var startPos = this.state.start;
|
|
15137
15288
|
var startLoc = this.state.startLoc;
|
|
15138
|
-
var isAwait = this.isContextual(
|
|
15289
|
+
var isAwait = this.isContextual(96);
|
|
15139
15290
|
|
|
15140
15291
|
if (isAwait && this.isAwaitAllowed()) {
|
|
15141
15292
|
this.next();
|
|
@@ -15153,11 +15304,11 @@ class ExpressionParser extends LValParser {
|
|
|
15153
15304
|
node.operator = this.state.value;
|
|
15154
15305
|
node.prefix = true;
|
|
15155
15306
|
|
|
15156
|
-
if (this.match(
|
|
15307
|
+
if (this.match(72)) {
|
|
15157
15308
|
this.expectPlugin("throwExpressions");
|
|
15158
15309
|
}
|
|
15159
15310
|
|
|
15160
|
-
var isDelete = this.match(
|
|
15311
|
+
var isDelete = this.match(89);
|
|
15161
15312
|
this.next();
|
|
15162
15313
|
node.argument = this.parseMaybeUnary(null, true);
|
|
15163
15314
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
@@ -15189,7 +15340,7 @@ class ExpressionParser extends LValParser {
|
|
|
15189
15340
|
type
|
|
15190
15341
|
} = this.state;
|
|
15191
15342
|
|
|
15192
|
-
var _startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(
|
|
15343
|
+
var _startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54);
|
|
15193
15344
|
|
|
15194
15345
|
if (_startsExpr && !this.isAmbiguousAwait()) {
|
|
15195
15346
|
this.raiseOverwrite(startLoc, ErrorMessages.AwaitNotInAsyncContext);
|
|
@@ -15298,7 +15449,7 @@ class ExpressionParser extends LValParser {
|
|
|
15298
15449
|
if (computed) {
|
|
15299
15450
|
node.property = this.parseExpression();
|
|
15300
15451
|
this.expect(3);
|
|
15301
|
-
} else if (this.match(
|
|
15452
|
+
} else if (this.match(134)) {
|
|
15302
15453
|
if (base.type === "Super") {
|
|
15303
15454
|
this.raise(ErrorMessages.SuperPrivateField, {
|
|
15304
15455
|
at: startLoc
|
|
@@ -15335,13 +15486,17 @@ class ExpressionParser extends LValParser {
|
|
|
15335
15486
|
this.next();
|
|
15336
15487
|
var node = this.startNodeAt(startPos, startLoc);
|
|
15337
15488
|
node.callee = base;
|
|
15489
|
+
var {
|
|
15490
|
+
maybeAsyncArrow,
|
|
15491
|
+
optionalChainMember
|
|
15492
|
+
} = state;
|
|
15338
15493
|
|
|
15339
|
-
if (
|
|
15494
|
+
if (maybeAsyncArrow) {
|
|
15340
15495
|
this.expressionScope.enter(newAsyncArrowScope());
|
|
15341
15496
|
refExpressionErrors = new ExpressionErrors();
|
|
15342
15497
|
}
|
|
15343
15498
|
|
|
15344
|
-
if (
|
|
15499
|
+
if (optionalChainMember) {
|
|
15345
15500
|
node.optional = optional;
|
|
15346
15501
|
}
|
|
15347
15502
|
|
|
@@ -15351,15 +15506,16 @@ class ExpressionParser extends LValParser {
|
|
|
15351
15506
|
node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type !== "Super", node, refExpressionErrors);
|
|
15352
15507
|
}
|
|
15353
15508
|
|
|
15354
|
-
this.finishCallExpression(node,
|
|
15509
|
+
this.finishCallExpression(node, optionalChainMember);
|
|
15355
15510
|
|
|
15356
|
-
if (
|
|
15511
|
+
if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
|
|
15357
15512
|
state.stop = true;
|
|
15513
|
+
this.checkDestructuringPrivate(refExpressionErrors);
|
|
15358
15514
|
this.expressionScope.validateAsPattern();
|
|
15359
15515
|
this.expressionScope.exit();
|
|
15360
15516
|
node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node);
|
|
15361
15517
|
} else {
|
|
15362
|
-
if (
|
|
15518
|
+
if (maybeAsyncArrow) {
|
|
15363
15519
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
15364
15520
|
this.expressionScope.exit();
|
|
15365
15521
|
}
|
|
@@ -15390,7 +15546,7 @@ class ExpressionParser extends LValParser {
|
|
|
15390
15546
|
}
|
|
15391
15547
|
|
|
15392
15548
|
atPossibleAsyncArrow(base) {
|
|
15393
|
-
return base.type === "Identifier" && base.name === "async" &&
|
|
15549
|
+
return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && base.start === this.state.potentialArrowAt;
|
|
15394
15550
|
}
|
|
15395
15551
|
|
|
15396
15552
|
finishCallExpression(node, optional) {
|
|
@@ -15491,10 +15647,10 @@ class ExpressionParser extends LValParser {
|
|
|
15491
15647
|
} = this.state;
|
|
15492
15648
|
|
|
15493
15649
|
switch (type) {
|
|
15494
|
-
case
|
|
15650
|
+
case 79:
|
|
15495
15651
|
return this.parseSuper();
|
|
15496
15652
|
|
|
15497
|
-
case
|
|
15653
|
+
case 83:
|
|
15498
15654
|
node = this.startNode();
|
|
15499
15655
|
this.next();
|
|
15500
15656
|
|
|
@@ -15510,42 +15666,42 @@ class ExpressionParser extends LValParser {
|
|
|
15510
15666
|
|
|
15511
15667
|
return this.finishNode(node, "Import");
|
|
15512
15668
|
|
|
15513
|
-
case
|
|
15669
|
+
case 78:
|
|
15514
15670
|
node = this.startNode();
|
|
15515
15671
|
this.next();
|
|
15516
15672
|
return this.finishNode(node, "ThisExpression");
|
|
15517
15673
|
|
|
15518
|
-
case
|
|
15674
|
+
case 90:
|
|
15519
15675
|
{
|
|
15520
15676
|
return this.parseDo(this.startNode(), false);
|
|
15521
15677
|
}
|
|
15522
15678
|
|
|
15523
|
-
case
|
|
15679
|
+
case 56:
|
|
15524
15680
|
case 31:
|
|
15525
15681
|
{
|
|
15526
15682
|
this.readRegexp();
|
|
15527
15683
|
return this.parseRegExpLiteral(this.state.value);
|
|
15528
15684
|
}
|
|
15529
15685
|
|
|
15530
|
-
case
|
|
15686
|
+
case 130:
|
|
15531
15687
|
return this.parseNumericLiteral(this.state.value);
|
|
15532
15688
|
|
|
15533
|
-
case
|
|
15689
|
+
case 131:
|
|
15534
15690
|
return this.parseBigIntLiteral(this.state.value);
|
|
15535
15691
|
|
|
15536
|
-
case
|
|
15692
|
+
case 132:
|
|
15537
15693
|
return this.parseDecimalLiteral(this.state.value);
|
|
15538
15694
|
|
|
15539
|
-
case
|
|
15695
|
+
case 129:
|
|
15540
15696
|
return this.parseStringLiteral(this.state.value);
|
|
15541
15697
|
|
|
15542
|
-
case
|
|
15698
|
+
case 84:
|
|
15543
15699
|
return this.parseNullLiteral();
|
|
15544
15700
|
|
|
15545
|
-
case
|
|
15701
|
+
case 85:
|
|
15546
15702
|
return this.parseBooleanLiteral(true);
|
|
15547
15703
|
|
|
15548
|
-
case
|
|
15704
|
+
case 86:
|
|
15549
15705
|
return this.parseBooleanLiteral(false);
|
|
15550
15706
|
|
|
15551
15707
|
case 10:
|
|
@@ -15576,18 +15732,18 @@ class ExpressionParser extends LValParser {
|
|
|
15576
15732
|
return this.parseObjectLike(8, false, false, refExpressionErrors);
|
|
15577
15733
|
}
|
|
15578
15734
|
|
|
15579
|
-
case
|
|
15735
|
+
case 68:
|
|
15580
15736
|
return this.parseFunctionOrFunctionSent();
|
|
15581
15737
|
|
|
15582
15738
|
case 26:
|
|
15583
15739
|
this.parseDecorators();
|
|
15584
15740
|
|
|
15585
|
-
case
|
|
15741
|
+
case 80:
|
|
15586
15742
|
node = this.startNode();
|
|
15587
15743
|
this.takeDecorators(node);
|
|
15588
15744
|
return this.parseClass(node, false);
|
|
15589
15745
|
|
|
15590
|
-
case
|
|
15746
|
+
case 77:
|
|
15591
15747
|
return this.parseNewOrNewTarget();
|
|
15592
15748
|
|
|
15593
15749
|
case 25:
|
|
@@ -15610,7 +15766,7 @@ class ExpressionParser extends LValParser {
|
|
|
15610
15766
|
}
|
|
15611
15767
|
}
|
|
15612
15768
|
|
|
15613
|
-
case
|
|
15769
|
+
case 134:
|
|
15614
15770
|
{
|
|
15615
15771
|
this.raise(ErrorMessages.PrivateInExpectedIn, {
|
|
15616
15772
|
at: this.state.startLoc
|
|
@@ -15620,16 +15776,22 @@ class ExpressionParser extends LValParser {
|
|
|
15620
15776
|
|
|
15621
15777
|
case 33:
|
|
15622
15778
|
{
|
|
15623
|
-
return this.parseTopicReferenceThenEqualsSign(
|
|
15779
|
+
return this.parseTopicReferenceThenEqualsSign(54, "%");
|
|
15624
15780
|
}
|
|
15625
15781
|
|
|
15626
15782
|
case 32:
|
|
15627
15783
|
{
|
|
15628
|
-
return this.parseTopicReferenceThenEqualsSign(
|
|
15784
|
+
return this.parseTopicReferenceThenEqualsSign(44, "^");
|
|
15629
15785
|
}
|
|
15630
15786
|
|
|
15631
|
-
case
|
|
15632
|
-
case
|
|
15787
|
+
case 37:
|
|
15788
|
+
case 38:
|
|
15789
|
+
{
|
|
15790
|
+
return this.parseTopicReference("hack");
|
|
15791
|
+
}
|
|
15792
|
+
|
|
15793
|
+
case 44:
|
|
15794
|
+
case 54:
|
|
15633
15795
|
case 27:
|
|
15634
15796
|
{
|
|
15635
15797
|
var pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
|
|
@@ -15641,7 +15803,7 @@ class ExpressionParser extends LValParser {
|
|
|
15641
15803
|
}
|
|
15642
15804
|
}
|
|
15643
15805
|
|
|
15644
|
-
case
|
|
15806
|
+
case 47:
|
|
15645
15807
|
{
|
|
15646
15808
|
var lookaheadCh = this.input.codePointAt(this.nextTokenStart());
|
|
15647
15809
|
|
|
@@ -15655,7 +15817,7 @@ class ExpressionParser extends LValParser {
|
|
|
15655
15817
|
|
|
15656
15818
|
default:
|
|
15657
15819
|
if (tokenIsIdentifier(type)) {
|
|
15658
|
-
if (this.isContextual(
|
|
15820
|
+
if (this.isContextual(123) && this.lookaheadCharCode() === 123 && !this.hasFollowingLineBreak()) {
|
|
15659
15821
|
return this.parseModuleExpression();
|
|
15660
15822
|
}
|
|
15661
15823
|
|
|
@@ -15669,7 +15831,7 @@ class ExpressionParser extends LValParser {
|
|
|
15669
15831
|
type: _type
|
|
15670
15832
|
} = this.state;
|
|
15671
15833
|
|
|
15672
|
-
if (_type ===
|
|
15834
|
+
if (_type === 68) {
|
|
15673
15835
|
this.resetPreviousNodeTrailingComments(id);
|
|
15674
15836
|
this.next();
|
|
15675
15837
|
return this.parseFunction(this.startNodeAtNode(id), undefined, true);
|
|
@@ -15679,7 +15841,7 @@ class ExpressionParser extends LValParser {
|
|
|
15679
15841
|
} else {
|
|
15680
15842
|
return id;
|
|
15681
15843
|
}
|
|
15682
|
-
} else if (_type ===
|
|
15844
|
+
} else if (_type === 90) {
|
|
15683
15845
|
this.resetPreviousNodeTrailingComments(id);
|
|
15684
15846
|
return this.parseDo(this.startNodeAtNode(id), true);
|
|
15685
15847
|
}
|
|
@@ -15839,7 +16001,7 @@ class ExpressionParser extends LValParser {
|
|
|
15839
16001
|
var meta = this.createIdentifier(this.startNodeAtNode(node), "function");
|
|
15840
16002
|
this.next();
|
|
15841
16003
|
|
|
15842
|
-
if (this.match(
|
|
16004
|
+
if (this.match(102)) {
|
|
15843
16005
|
this.expectPlugin("functionSent");
|
|
15844
16006
|
} else if (!this.hasPlugin("functionSent")) {
|
|
15845
16007
|
this.unexpected();
|
|
@@ -15869,7 +16031,7 @@ class ExpressionParser extends LValParser {
|
|
|
15869
16031
|
var id = this.createIdentifier(this.startNodeAtNode(node), "import");
|
|
15870
16032
|
this.next();
|
|
15871
16033
|
|
|
15872
|
-
if (this.isContextual(
|
|
16034
|
+
if (this.isContextual(100)) {
|
|
15873
16035
|
if (!this.inModule) {
|
|
15874
16036
|
this.raise(SourceTypeModuleErrorMessages.ImportMetaOutsideModule, {
|
|
15875
16037
|
node: id
|
|
@@ -15982,6 +16144,7 @@ class ExpressionParser extends LValParser {
|
|
|
15982
16144
|
var arrowNode = this.startNodeAt(startPos, startLoc);
|
|
15983
16145
|
|
|
15984
16146
|
if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {
|
|
16147
|
+
this.checkDestructuringPrivate(refExpressionErrors);
|
|
15985
16148
|
this.expressionScope.validateAsPattern();
|
|
15986
16149
|
this.expressionScope.exit();
|
|
15987
16150
|
this.parseArrowExpression(arrowNode, exprList, false);
|
|
@@ -16011,7 +16174,7 @@ class ExpressionParser extends LValParser {
|
|
|
16011
16174
|
if (!this.options.createParenthesizedExpressions) {
|
|
16012
16175
|
this.addExtra(val, "parenthesized", true);
|
|
16013
16176
|
this.addExtra(val, "parenStart", startPos);
|
|
16014
|
-
this.takeSurroundingComments(val, startPos,
|
|
16177
|
+
this.takeSurroundingComments(val, startPos, this.state.lastTokEndLoc.index);
|
|
16015
16178
|
return val;
|
|
16016
16179
|
}
|
|
16017
16180
|
|
|
@@ -16204,7 +16367,7 @@ class ExpressionParser extends LValParser {
|
|
|
16204
16367
|
}
|
|
16205
16368
|
|
|
16206
16369
|
maybeAsyncOrAccessorProp(prop) {
|
|
16207
|
-
return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(
|
|
16370
|
+
return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55));
|
|
16208
16371
|
}
|
|
16209
16372
|
|
|
16210
16373
|
parsePropertyDefinition(refExpressionErrors) {
|
|
@@ -16245,10 +16408,10 @@ class ExpressionParser extends LValParser {
|
|
|
16245
16408
|
startLoc = this.state.startLoc;
|
|
16246
16409
|
}
|
|
16247
16410
|
|
|
16248
|
-
var isGenerator = this.eat(
|
|
16411
|
+
var isGenerator = this.eat(55);
|
|
16249
16412
|
this.parsePropertyNamePrefixOperator(prop);
|
|
16250
16413
|
var containsEsc = this.state.containsEsc;
|
|
16251
|
-
var key = this.parsePropertyName(prop);
|
|
16414
|
+
var key = this.parsePropertyName(prop, refExpressionErrors);
|
|
16252
16415
|
|
|
16253
16416
|
if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) {
|
|
16254
16417
|
var keyName = key.name;
|
|
@@ -16256,7 +16419,7 @@ class ExpressionParser extends LValParser {
|
|
|
16256
16419
|
if (keyName === "async" && !this.hasPrecedingLineBreak()) {
|
|
16257
16420
|
isAsync = true;
|
|
16258
16421
|
this.resetPreviousNodeTrailingComments(key);
|
|
16259
|
-
isGenerator = this.eat(
|
|
16422
|
+
isGenerator = this.eat(55);
|
|
16260
16423
|
this.parsePropertyName(prop);
|
|
16261
16424
|
}
|
|
16262
16425
|
|
|
@@ -16265,7 +16428,7 @@ class ExpressionParser extends LValParser {
|
|
|
16265
16428
|
this.resetPreviousNodeTrailingComments(key);
|
|
16266
16429
|
prop.kind = keyName;
|
|
16267
16430
|
|
|
16268
|
-
if (this.match(
|
|
16431
|
+
if (this.match(55)) {
|
|
16269
16432
|
isGenerator = true;
|
|
16270
16433
|
this.raise(ErrorMessages.AccessorIsGenerator, {
|
|
16271
16434
|
at: this.state.curPosition()
|
|
@@ -16365,7 +16528,7 @@ class ExpressionParser extends LValParser {
|
|
|
16365
16528
|
return node;
|
|
16366
16529
|
}
|
|
16367
16530
|
|
|
16368
|
-
parsePropertyName(prop) {
|
|
16531
|
+
parsePropertyName(prop, refExpressionErrors) {
|
|
16369
16532
|
if (this.eat(0)) {
|
|
16370
16533
|
prop.computed = true;
|
|
16371
16534
|
prop.key = this.parseMaybeAssignAllowIn();
|
|
@@ -16381,27 +16544,36 @@ class ExpressionParser extends LValParser {
|
|
|
16381
16544
|
key = this.parseIdentifier(true);
|
|
16382
16545
|
} else {
|
|
16383
16546
|
switch (type) {
|
|
16384
|
-
case
|
|
16547
|
+
case 130:
|
|
16385
16548
|
key = this.parseNumericLiteral(value);
|
|
16386
16549
|
break;
|
|
16387
16550
|
|
|
16388
|
-
case
|
|
16551
|
+
case 129:
|
|
16389
16552
|
key = this.parseStringLiteral(value);
|
|
16390
16553
|
break;
|
|
16391
16554
|
|
|
16392
|
-
case
|
|
16555
|
+
case 131:
|
|
16393
16556
|
key = this.parseBigIntLiteral(value);
|
|
16394
16557
|
break;
|
|
16395
16558
|
|
|
16396
|
-
case
|
|
16559
|
+
case 132:
|
|
16397
16560
|
key = this.parseDecimalLiteral(value);
|
|
16398
16561
|
break;
|
|
16399
16562
|
|
|
16400
|
-
case
|
|
16563
|
+
case 134:
|
|
16401
16564
|
{
|
|
16402
|
-
this.
|
|
16403
|
-
|
|
16404
|
-
|
|
16565
|
+
var privateKeyLoc = this.state.startLoc;
|
|
16566
|
+
|
|
16567
|
+
if (refExpressionErrors != null) {
|
|
16568
|
+
if (refExpressionErrors.privateKeyLoc === null) {
|
|
16569
|
+
refExpressionErrors.privateKeyLoc = privateKeyLoc;
|
|
16570
|
+
}
|
|
16571
|
+
} else {
|
|
16572
|
+
this.raise(ErrorMessages.UnexpectedPrivateField, {
|
|
16573
|
+
at: privateKeyLoc
|
|
16574
|
+
});
|
|
16575
|
+
}
|
|
16576
|
+
|
|
16405
16577
|
key = this.parsePrivateName();
|
|
16406
16578
|
break;
|
|
16407
16579
|
}
|
|
@@ -16413,7 +16585,7 @@ class ExpressionParser extends LValParser {
|
|
|
16413
16585
|
|
|
16414
16586
|
prop.key = key;
|
|
16415
16587
|
|
|
16416
|
-
if (type !==
|
|
16588
|
+
if (type !== 134) {
|
|
16417
16589
|
prop.computed = false;
|
|
16418
16590
|
}
|
|
16419
16591
|
}
|
|
@@ -16635,7 +16807,7 @@ class ExpressionParser extends LValParser {
|
|
|
16635
16807
|
|
|
16636
16808
|
if (liberal) {
|
|
16637
16809
|
if (tokenIsKeyword) {
|
|
16638
|
-
this.replaceToken(
|
|
16810
|
+
this.replaceToken(128);
|
|
16639
16811
|
}
|
|
16640
16812
|
} else {
|
|
16641
16813
|
this.checkReservedWord(name, startLoc, tokenIsKeyword, false);
|
|
@@ -16716,7 +16888,7 @@ class ExpressionParser extends LValParser {
|
|
|
16716
16888
|
var node = this.startNodeAt(startPos, startLoc);
|
|
16717
16889
|
this.expressionScope.recordParameterInitializerError(node.loc.start, ErrorMessages.AwaitExpressionFormalParameter);
|
|
16718
16890
|
|
|
16719
|
-
if (this.eat(
|
|
16891
|
+
if (this.eat(55)) {
|
|
16720
16892
|
this.raise(ErrorMessages.ObsoleteAwaitStar, {
|
|
16721
16893
|
node
|
|
16722
16894
|
});
|
|
@@ -16742,7 +16914,7 @@ class ExpressionParser extends LValParser {
|
|
|
16742
16914
|
var {
|
|
16743
16915
|
type
|
|
16744
16916
|
} = this.state;
|
|
16745
|
-
return type ===
|
|
16917
|
+
return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 133 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54;
|
|
16746
16918
|
}
|
|
16747
16919
|
|
|
16748
16920
|
parseYield() {
|
|
@@ -16753,11 +16925,11 @@ class ExpressionParser extends LValParser {
|
|
|
16753
16925
|
var argument = null;
|
|
16754
16926
|
|
|
16755
16927
|
if (!this.hasPrecedingLineBreak()) {
|
|
16756
|
-
delegating = this.eat(
|
|
16928
|
+
delegating = this.eat(55);
|
|
16757
16929
|
|
|
16758
16930
|
switch (this.state.type) {
|
|
16759
16931
|
case 13:
|
|
16760
|
-
case
|
|
16932
|
+
case 135:
|
|
16761
16933
|
case 8:
|
|
16762
16934
|
case 11:
|
|
16763
16935
|
case 3:
|
|
@@ -16975,7 +17147,7 @@ function babel7CompatTokens(tokens, input) {
|
|
|
16975
17147
|
|
|
16976
17148
|
if (typeof type === "number") {
|
|
16977
17149
|
{
|
|
16978
|
-
if (type ===
|
|
17150
|
+
if (type === 134) {
|
|
16979
17151
|
var {
|
|
16980
17152
|
loc,
|
|
16981
17153
|
start,
|
|
@@ -16992,7 +17164,7 @@ function babel7CompatTokens(tokens, input) {
|
|
|
16992
17164
|
startLoc: loc.start,
|
|
16993
17165
|
endLoc: hashEndLoc
|
|
16994
17166
|
}), new Token({
|
|
16995
|
-
type: getExportedToken(
|
|
17167
|
+
type: getExportedToken(128),
|
|
16996
17168
|
value: value,
|
|
16997
17169
|
start: hashEndPos,
|
|
16998
17170
|
end: end,
|
|
@@ -17097,7 +17269,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17097
17269
|
}
|
|
17098
17270
|
|
|
17099
17271
|
parseProgram(program) {
|
|
17100
|
-
var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
17272
|
+
var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 135;
|
|
17101
17273
|
var sourceType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.options.sourceType;
|
|
17102
17274
|
program.sourceType = sourceType;
|
|
17103
17275
|
program.interpreter = this.parseInterpreterDirective();
|
|
@@ -17142,7 +17314,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17142
17314
|
}
|
|
17143
17315
|
|
|
17144
17316
|
isLet(context) {
|
|
17145
|
-
if (!this.isContextual(
|
|
17317
|
+
if (!this.isContextual(99)) {
|
|
17146
17318
|
return false;
|
|
17147
17319
|
}
|
|
17148
17320
|
|
|
@@ -17191,27 +17363,27 @@ class StatementParser extends ExpressionParser {
|
|
|
17191
17363
|
var kind;
|
|
17192
17364
|
|
|
17193
17365
|
if (this.isLet(context)) {
|
|
17194
|
-
starttype =
|
|
17366
|
+
starttype = 74;
|
|
17195
17367
|
kind = "let";
|
|
17196
17368
|
}
|
|
17197
17369
|
|
|
17198
17370
|
switch (starttype) {
|
|
17199
|
-
case
|
|
17371
|
+
case 60:
|
|
17200
17372
|
return this.parseBreakContinueStatement(node, true);
|
|
17201
17373
|
|
|
17202
|
-
case
|
|
17374
|
+
case 63:
|
|
17203
17375
|
return this.parseBreakContinueStatement(node, false);
|
|
17204
17376
|
|
|
17205
|
-
case
|
|
17377
|
+
case 64:
|
|
17206
17378
|
return this.parseDebuggerStatement(node);
|
|
17207
17379
|
|
|
17208
|
-
case
|
|
17380
|
+
case 90:
|
|
17209
17381
|
return this.parseDoStatement(node);
|
|
17210
17382
|
|
|
17211
|
-
case
|
|
17383
|
+
case 91:
|
|
17212
17384
|
return this.parseForStatement(node);
|
|
17213
17385
|
|
|
17214
|
-
case
|
|
17386
|
+
case 68:
|
|
17215
17387
|
if (this.lookaheadCharCode() === 46) break;
|
|
17216
17388
|
|
|
17217
17389
|
if (context) {
|
|
@@ -17228,27 +17400,27 @@ class StatementParser extends ExpressionParser {
|
|
|
17228
17400
|
|
|
17229
17401
|
return this.parseFunctionStatement(node, false, !context);
|
|
17230
17402
|
|
|
17231
|
-
case
|
|
17403
|
+
case 80:
|
|
17232
17404
|
if (context) this.unexpected();
|
|
17233
17405
|
return this.parseClass(node, true);
|
|
17234
17406
|
|
|
17235
|
-
case
|
|
17407
|
+
case 69:
|
|
17236
17408
|
return this.parseIfStatement(node);
|
|
17237
17409
|
|
|
17238
|
-
case
|
|
17410
|
+
case 70:
|
|
17239
17411
|
return this.parseReturnStatement(node);
|
|
17240
17412
|
|
|
17241
|
-
case
|
|
17413
|
+
case 71:
|
|
17242
17414
|
return this.parseSwitchStatement(node);
|
|
17243
17415
|
|
|
17244
|
-
case
|
|
17416
|
+
case 72:
|
|
17245
17417
|
return this.parseThrowStatement(node);
|
|
17246
17418
|
|
|
17247
|
-
case
|
|
17419
|
+
case 73:
|
|
17248
17420
|
return this.parseTryStatement(node);
|
|
17249
17421
|
|
|
17250
|
-
case
|
|
17251
|
-
case
|
|
17422
|
+
case 75:
|
|
17423
|
+
case 74:
|
|
17252
17424
|
kind = kind || this.state.value;
|
|
17253
17425
|
|
|
17254
17426
|
if (context && kind !== "var") {
|
|
@@ -17259,10 +17431,10 @@ class StatementParser extends ExpressionParser {
|
|
|
17259
17431
|
|
|
17260
17432
|
return this.parseVarStatement(node, kind);
|
|
17261
17433
|
|
|
17262
|
-
case
|
|
17434
|
+
case 92:
|
|
17263
17435
|
return this.parseWhileStatement(node);
|
|
17264
17436
|
|
|
17265
|
-
case
|
|
17437
|
+
case 76:
|
|
17266
17438
|
return this.parseWithStatement(node);
|
|
17267
17439
|
|
|
17268
17440
|
case 5:
|
|
@@ -17271,7 +17443,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17271
17443
|
case 13:
|
|
17272
17444
|
return this.parseEmptyStatement(node);
|
|
17273
17445
|
|
|
17274
|
-
case
|
|
17446
|
+
case 83:
|
|
17275
17447
|
{
|
|
17276
17448
|
var nextTokenCharCode = this.lookaheadCharCode();
|
|
17277
17449
|
|
|
@@ -17280,7 +17452,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17280
17452
|
}
|
|
17281
17453
|
}
|
|
17282
17454
|
|
|
17283
|
-
case
|
|
17455
|
+
case 82:
|
|
17284
17456
|
{
|
|
17285
17457
|
if (!this.options.allowImportExportEverywhere && !topLevel) {
|
|
17286
17458
|
this.raise(ErrorMessages.UnexpectedImportExport, {
|
|
@@ -17291,7 +17463,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17291
17463
|
this.next();
|
|
17292
17464
|
var result;
|
|
17293
17465
|
|
|
17294
|
-
if (starttype ===
|
|
17466
|
+
if (starttype === 83) {
|
|
17295
17467
|
result = this.parseImport(node);
|
|
17296
17468
|
|
|
17297
17469
|
if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
|
|
@@ -17353,7 +17525,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17353
17525
|
}
|
|
17354
17526
|
|
|
17355
17527
|
canHaveLeadingDecorator() {
|
|
17356
|
-
return this.match(
|
|
17528
|
+
return this.match(80);
|
|
17357
17529
|
}
|
|
17358
17530
|
|
|
17359
17531
|
parseDecorators(allowExport) {
|
|
@@ -17364,7 +17536,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17364
17536
|
currentContextDecorators.push(decorator);
|
|
17365
17537
|
}
|
|
17366
17538
|
|
|
17367
|
-
if (this.match(
|
|
17539
|
+
if (this.match(82)) {
|
|
17368
17540
|
if (!allowExport) {
|
|
17369
17541
|
this.unexpected();
|
|
17370
17542
|
}
|
|
@@ -17480,7 +17652,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17480
17652
|
this.state.labels.push(loopLabel);
|
|
17481
17653
|
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement("do"));
|
|
17482
17654
|
this.state.labels.pop();
|
|
17483
|
-
this.expect(
|
|
17655
|
+
this.expect(92);
|
|
17484
17656
|
node.test = this.parseHeaderExpression();
|
|
17485
17657
|
this.eat(13);
|
|
17486
17658
|
return this.finishNode(node, "DoWhileStatement");
|
|
@@ -17491,7 +17663,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17491
17663
|
this.state.labels.push(loopLabel);
|
|
17492
17664
|
var awaitAt = null;
|
|
17493
17665
|
|
|
17494
|
-
if (this.isAwaitAllowed() && this.eatContextual(
|
|
17666
|
+
if (this.isAwaitAllowed() && this.eatContextual(96)) {
|
|
17495
17667
|
awaitAt = this.state.lastTokStartLoc;
|
|
17496
17668
|
}
|
|
17497
17669
|
|
|
@@ -17506,10 +17678,10 @@ class StatementParser extends ExpressionParser {
|
|
|
17506
17678
|
return this.parseFor(node, null);
|
|
17507
17679
|
}
|
|
17508
17680
|
|
|
17509
|
-
var startsWithLet = this.isContextual(
|
|
17681
|
+
var startsWithLet = this.isContextual(99);
|
|
17510
17682
|
var isLet = startsWithLet && this.isLetKeyword();
|
|
17511
17683
|
|
|
17512
|
-
if (this.match(
|
|
17684
|
+
if (this.match(74) || this.match(75) || isLet) {
|
|
17513
17685
|
var _init = this.startNode();
|
|
17514
17686
|
|
|
17515
17687
|
var kind = isLet ? "let" : this.state.value;
|
|
@@ -17517,7 +17689,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17517
17689
|
this.parseVar(_init, true, kind);
|
|
17518
17690
|
this.finishNode(_init, "VariableDeclaration");
|
|
17519
17691
|
|
|
17520
|
-
if ((this.match(
|
|
17692
|
+
if ((this.match(58) || this.isContextual(101)) && _init.declarations.length === 1) {
|
|
17521
17693
|
return this.parseForIn(node, _init, awaitAt);
|
|
17522
17694
|
}
|
|
17523
17695
|
|
|
@@ -17528,10 +17700,10 @@ class StatementParser extends ExpressionParser {
|
|
|
17528
17700
|
return this.parseFor(node, _init);
|
|
17529
17701
|
}
|
|
17530
17702
|
|
|
17531
|
-
var startsWithAsync = this.isContextual(
|
|
17703
|
+
var startsWithAsync = this.isContextual(95);
|
|
17532
17704
|
var refExpressionErrors = new ExpressionErrors();
|
|
17533
17705
|
var init = this.parseExpression(true, refExpressionErrors);
|
|
17534
|
-
var isForOf = this.isContextual(
|
|
17706
|
+
var isForOf = this.isContextual(101);
|
|
17535
17707
|
|
|
17536
17708
|
if (isForOf) {
|
|
17537
17709
|
if (startsWithLet) {
|
|
@@ -17547,7 +17719,8 @@ class StatementParser extends ExpressionParser {
|
|
|
17547
17719
|
}
|
|
17548
17720
|
}
|
|
17549
17721
|
|
|
17550
|
-
if (isForOf || this.match(
|
|
17722
|
+
if (isForOf || this.match(58)) {
|
|
17723
|
+
this.checkDestructuringPrivate(refExpressionErrors);
|
|
17551
17724
|
this.toAssignable(init, true);
|
|
17552
17725
|
var description = isForOf ? "for-of statement" : "for-in statement";
|
|
17553
17726
|
this.checkLVal(init, description);
|
|
@@ -17572,7 +17745,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17572
17745
|
this.next();
|
|
17573
17746
|
node.test = this.parseHeaderExpression();
|
|
17574
17747
|
node.consequent = this.parseStatement("if");
|
|
17575
|
-
node.alternate = this.eat(
|
|
17748
|
+
node.alternate = this.eat(66) ? this.parseStatement("if") : null;
|
|
17576
17749
|
return this.finishNode(node, "IfStatement");
|
|
17577
17750
|
}
|
|
17578
17751
|
|
|
@@ -17605,8 +17778,8 @@ class StatementParser extends ExpressionParser {
|
|
|
17605
17778
|
var cur;
|
|
17606
17779
|
|
|
17607
17780
|
for (var sawDefault; !this.match(8);) {
|
|
17608
|
-
if (this.match(
|
|
17609
|
-
var isCase = this.match(
|
|
17781
|
+
if (this.match(61) || this.match(65)) {
|
|
17782
|
+
var isCase = this.match(61);
|
|
17610
17783
|
if (cur) this.finishNode(cur, "SwitchCase");
|
|
17611
17784
|
cases.push(cur = this.startNode());
|
|
17612
17785
|
cur.consequent = [];
|
|
@@ -17669,7 +17842,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17669
17842
|
node.block = this.parseBlock();
|
|
17670
17843
|
node.handler = null;
|
|
17671
17844
|
|
|
17672
|
-
if (this.match(
|
|
17845
|
+
if (this.match(62)) {
|
|
17673
17846
|
var clause = this.startNode();
|
|
17674
17847
|
this.next();
|
|
17675
17848
|
|
|
@@ -17687,7 +17860,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17687
17860
|
node.handler = this.finishNode(clause, "CatchClause");
|
|
17688
17861
|
}
|
|
17689
17862
|
|
|
17690
|
-
node.finalizer = this.eat(
|
|
17863
|
+
node.finalizer = this.eat(67) ? this.parseBlock() : null;
|
|
17691
17864
|
|
|
17692
17865
|
if (!node.handler && !node.finalizer) {
|
|
17693
17866
|
this.raise(ErrorMessages.NoCatchOrFinally, {
|
|
@@ -17741,7 +17914,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17741
17914
|
}
|
|
17742
17915
|
}
|
|
17743
17916
|
|
|
17744
|
-
var kind = tokenIsLoop(this.state.type) ? "loop" : this.match(
|
|
17917
|
+
var kind = tokenIsLoop(this.state.type) ? "loop" : this.match(71) ? "switch" : null;
|
|
17745
17918
|
|
|
17746
17919
|
for (var i = this.state.labels.length - 1; i >= 0; i--) {
|
|
17747
17920
|
var _label = this.state.labels[i];
|
|
@@ -17859,7 +18032,7 @@ class StatementParser extends ExpressionParser {
|
|
|
17859
18032
|
}
|
|
17860
18033
|
|
|
17861
18034
|
parseForIn(node, init, awaitAt) {
|
|
17862
|
-
var isForIn = this.match(
|
|
18035
|
+
var isForIn = this.match(58);
|
|
17863
18036
|
this.next();
|
|
17864
18037
|
|
|
17865
18038
|
if (isForIn) {
|
|
@@ -17901,13 +18074,13 @@ class StatementParser extends ExpressionParser {
|
|
|
17901
18074
|
if (this.eat(29)) {
|
|
17902
18075
|
decl.init = isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn();
|
|
17903
18076
|
} else {
|
|
17904
|
-
if (kind === "const" && !(this.match(
|
|
18077
|
+
if (kind === "const" && !(this.match(58) || this.isContextual(101))) {
|
|
17905
18078
|
if (!isTypescript) {
|
|
17906
18079
|
this.raise(ErrorMessages.DeclarationMissingInitializer, {
|
|
17907
18080
|
at: this.state.lastTokEndLoc
|
|
17908
18081
|
}, "Const declarations");
|
|
17909
18082
|
}
|
|
17910
|
-
} else if (decl.id.type !== "Identifier" && !(isFor && (this.match(
|
|
18083
|
+
} else if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(101)))) {
|
|
17911
18084
|
this.raise(ErrorMessages.DeclarationMissingInitializer, {
|
|
17912
18085
|
at: this.state.lastTokEndLoc
|
|
17913
18086
|
}, "Complex binding patterns");
|
|
@@ -17936,13 +18109,13 @@ class StatementParser extends ExpressionParser {
|
|
|
17936
18109
|
var requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID);
|
|
17937
18110
|
this.initFunction(node, isAsync);
|
|
17938
18111
|
|
|
17939
|
-
if (this.match(
|
|
18112
|
+
if (this.match(55) && isHangingStatement) {
|
|
17940
18113
|
this.raise(ErrorMessages.GeneratorInSingleStatementContext, {
|
|
17941
18114
|
at: this.state.startLoc
|
|
17942
18115
|
});
|
|
17943
18116
|
}
|
|
17944
18117
|
|
|
17945
|
-
node.generator = this.eat(
|
|
18118
|
+
node.generator = this.eat(55);
|
|
17946
18119
|
|
|
17947
18120
|
if (isStatement) {
|
|
17948
18121
|
node.id = this.parseFunctionId(requireId);
|
|
@@ -18093,7 +18266,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18093
18266
|
}
|
|
18094
18267
|
|
|
18095
18268
|
parseClassMember(classBody, member, state) {
|
|
18096
|
-
var isStatic = this.isContextual(
|
|
18269
|
+
var isStatic = this.isContextual(104);
|
|
18097
18270
|
|
|
18098
18271
|
if (isStatic) {
|
|
18099
18272
|
if (this.parseClassMemberFromModifier(classBody, member)) {
|
|
@@ -18114,14 +18287,15 @@ class StatementParser extends ExpressionParser {
|
|
|
18114
18287
|
var privateMethod = member;
|
|
18115
18288
|
var publicProp = member;
|
|
18116
18289
|
var privateProp = member;
|
|
18290
|
+
var accessorProp = member;
|
|
18117
18291
|
var method = publicMethod;
|
|
18118
18292
|
var publicMember = publicMethod;
|
|
18119
18293
|
member.static = isStatic;
|
|
18120
18294
|
this.parsePropertyNamePrefixOperator(member);
|
|
18121
18295
|
|
|
18122
|
-
if (this.eat(
|
|
18296
|
+
if (this.eat(55)) {
|
|
18123
18297
|
method.kind = "method";
|
|
18124
|
-
var isPrivateName = this.match(
|
|
18298
|
+
var isPrivateName = this.match(134);
|
|
18125
18299
|
this.parseClassElementName(method);
|
|
18126
18300
|
|
|
18127
18301
|
if (isPrivateName) {
|
|
@@ -18140,7 +18314,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18140
18314
|
}
|
|
18141
18315
|
|
|
18142
18316
|
var isContextual = tokenIsIdentifier(this.state.type) && !this.state.containsEsc;
|
|
18143
|
-
var isPrivate = this.match(
|
|
18317
|
+
var isPrivate = this.match(134);
|
|
18144
18318
|
var key = this.parseClassElementName(member);
|
|
18145
18319
|
var maybeQuestionTokenStartLoc = this.state.startLoc;
|
|
18146
18320
|
this.parsePostMemberNameModifiers(publicMember);
|
|
@@ -18184,7 +18358,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18184
18358
|
}
|
|
18185
18359
|
} else if (isContextual && key.name === "async" && !this.isLineTerminator()) {
|
|
18186
18360
|
this.resetPreviousNodeTrailingComments(key);
|
|
18187
|
-
var isGenerator = this.eat(
|
|
18361
|
+
var isGenerator = this.eat(55);
|
|
18188
18362
|
|
|
18189
18363
|
if (publicMember.optional) {
|
|
18190
18364
|
this.unexpected(maybeQuestionTokenStartLoc);
|
|
@@ -18192,7 +18366,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18192
18366
|
|
|
18193
18367
|
method.kind = "method";
|
|
18194
18368
|
|
|
18195
|
-
var _isPrivate = this.match(
|
|
18369
|
+
var _isPrivate = this.match(134);
|
|
18196
18370
|
|
|
18197
18371
|
this.parseClassElementName(method);
|
|
18198
18372
|
this.parsePostMemberNameModifiers(publicMember);
|
|
@@ -18208,11 +18382,11 @@ class StatementParser extends ExpressionParser {
|
|
|
18208
18382
|
|
|
18209
18383
|
this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
|
|
18210
18384
|
}
|
|
18211
|
-
} else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(
|
|
18385
|
+
} else if (isContextual && (key.name === "get" || key.name === "set") && !(this.match(55) && this.isLineTerminator())) {
|
|
18212
18386
|
this.resetPreviousNodeTrailingComments(key);
|
|
18213
18387
|
method.kind = key.name;
|
|
18214
18388
|
|
|
18215
|
-
var _isPrivate2 = this.match(
|
|
18389
|
+
var _isPrivate2 = this.match(134);
|
|
18216
18390
|
|
|
18217
18391
|
this.parseClassElementName(publicMethod);
|
|
18218
18392
|
|
|
@@ -18229,6 +18403,14 @@ class StatementParser extends ExpressionParser {
|
|
|
18229
18403
|
}
|
|
18230
18404
|
|
|
18231
18405
|
this.checkGetterSetterParams(publicMethod);
|
|
18406
|
+
} else if (isContextual && key.name === "accessor" && !this.isLineTerminator()) {
|
|
18407
|
+
this.expectPlugin("decoratorAutoAccessors");
|
|
18408
|
+
this.resetPreviousNodeTrailingComments(key);
|
|
18409
|
+
|
|
18410
|
+
var _isPrivate3 = this.match(134);
|
|
18411
|
+
|
|
18412
|
+
this.parseClassElementName(publicProp);
|
|
18413
|
+
this.pushClassAccessorProperty(classBody, accessorProp, _isPrivate3);
|
|
18232
18414
|
} else if (this.isLineTerminator()) {
|
|
18233
18415
|
if (isPrivate) {
|
|
18234
18416
|
this.pushClassPrivateProperty(classBody, privateProp);
|
|
@@ -18246,13 +18428,13 @@ class StatementParser extends ExpressionParser {
|
|
|
18246
18428
|
value
|
|
18247
18429
|
} = this.state;
|
|
18248
18430
|
|
|
18249
|
-
if ((type ===
|
|
18431
|
+
if ((type === 128 || type === 129) && member.static && value === "prototype") {
|
|
18250
18432
|
this.raise(ErrorMessages.StaticPrototype, {
|
|
18251
18433
|
at: this.state.startLoc
|
|
18252
18434
|
});
|
|
18253
18435
|
}
|
|
18254
18436
|
|
|
18255
|
-
if (type ===
|
|
18437
|
+
if (type === 134) {
|
|
18256
18438
|
if (value === "constructor") {
|
|
18257
18439
|
this.raise(ErrorMessages.ConstructorClassPrivateField, {
|
|
18258
18440
|
at: this.state.startLoc
|
|
@@ -18304,6 +18486,25 @@ class StatementParser extends ExpressionParser {
|
|
|
18304
18486
|
this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start);
|
|
18305
18487
|
}
|
|
18306
18488
|
|
|
18489
|
+
pushClassAccessorProperty(classBody, prop, isPrivate) {
|
|
18490
|
+
if (!isPrivate && !prop.computed) {
|
|
18491
|
+
var key = prop.key;
|
|
18492
|
+
|
|
18493
|
+
if (key.name === "constructor" || key.value === "constructor") {
|
|
18494
|
+
this.raise(ErrorMessages.ConstructorClassField, {
|
|
18495
|
+
node: key
|
|
18496
|
+
});
|
|
18497
|
+
}
|
|
18498
|
+
}
|
|
18499
|
+
|
|
18500
|
+
var node = this.parseClassAccessorProperty(prop);
|
|
18501
|
+
classBody.body.push(node);
|
|
18502
|
+
|
|
18503
|
+
if (isPrivate) {
|
|
18504
|
+
this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), CLASS_ELEMENT_OTHER, node.key.loc.start);
|
|
18505
|
+
}
|
|
18506
|
+
}
|
|
18507
|
+
|
|
18307
18508
|
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
18308
18509
|
classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true));
|
|
18309
18510
|
}
|
|
@@ -18333,6 +18534,12 @@ class StatementParser extends ExpressionParser {
|
|
|
18333
18534
|
return this.finishNode(node, "ClassProperty");
|
|
18334
18535
|
}
|
|
18335
18536
|
|
|
18537
|
+
parseClassAccessorProperty(node) {
|
|
18538
|
+
this.parseInitializer(node);
|
|
18539
|
+
this.semicolon();
|
|
18540
|
+
return this.finishNode(node, "ClassAccessorProperty");
|
|
18541
|
+
}
|
|
18542
|
+
|
|
18336
18543
|
parseInitializer(node) {
|
|
18337
18544
|
this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
|
|
18338
18545
|
this.expressionScope.enter(newExpressionScope());
|
|
@@ -18364,7 +18571,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18364
18571
|
}
|
|
18365
18572
|
|
|
18366
18573
|
parseClassSuper(node) {
|
|
18367
|
-
node.superClass = this.eat(
|
|
18574
|
+
node.superClass = this.eat(81) ? this.parseExprSubscripts() : null;
|
|
18368
18575
|
}
|
|
18369
18576
|
|
|
18370
18577
|
parseExport(node) {
|
|
@@ -18401,7 +18608,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18401
18608
|
return this.finishNode(node, "ExportNamedDeclaration");
|
|
18402
18609
|
}
|
|
18403
18610
|
|
|
18404
|
-
if (this.eat(
|
|
18611
|
+
if (this.eat(65)) {
|
|
18405
18612
|
node.declaration = this.parseExportDefaultExpression();
|
|
18406
18613
|
this.checkExport(node, true, true);
|
|
18407
18614
|
return this.finishNode(node, "ExportDefaultDeclaration");
|
|
@@ -18411,7 +18618,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18411
18618
|
}
|
|
18412
18619
|
|
|
18413
18620
|
eatExportStar(node) {
|
|
18414
|
-
return this.eat(
|
|
18621
|
+
return this.eat(55);
|
|
18415
18622
|
}
|
|
18416
18623
|
|
|
18417
18624
|
maybeParseExportDefaultSpecifier(node) {
|
|
@@ -18427,7 +18634,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18427
18634
|
}
|
|
18428
18635
|
|
|
18429
18636
|
maybeParseExportNamespaceSpecifier(node) {
|
|
18430
|
-
if (this.isContextual(
|
|
18637
|
+
if (this.isContextual(93)) {
|
|
18431
18638
|
if (!node.specifiers) node.specifiers = [];
|
|
18432
18639
|
var specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc);
|
|
18433
18640
|
this.next();
|
|
@@ -18474,7 +18681,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18474
18681
|
}
|
|
18475
18682
|
|
|
18476
18683
|
isAsyncFunction() {
|
|
18477
|
-
if (!this.isContextual(
|
|
18684
|
+
if (!this.isContextual(95)) return false;
|
|
18478
18685
|
var next = this.nextTokenStart();
|
|
18479
18686
|
return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function");
|
|
18480
18687
|
}
|
|
@@ -18483,7 +18690,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18483
18690
|
var expr = this.startNode();
|
|
18484
18691
|
var isAsync = this.isAsyncFunction();
|
|
18485
18692
|
|
|
18486
|
-
if (this.match(
|
|
18693
|
+
if (this.match(68) || isAsync) {
|
|
18487
18694
|
this.next();
|
|
18488
18695
|
|
|
18489
18696
|
if (isAsync) {
|
|
@@ -18493,7 +18700,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18493
18700
|
return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync);
|
|
18494
18701
|
}
|
|
18495
18702
|
|
|
18496
|
-
if (this.match(
|
|
18703
|
+
if (this.match(80)) {
|
|
18497
18704
|
return this.parseClass(expr, true, true);
|
|
18498
18705
|
}
|
|
18499
18706
|
|
|
@@ -18508,7 +18715,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18508
18715
|
return this.parseClass(expr, true, true);
|
|
18509
18716
|
}
|
|
18510
18717
|
|
|
18511
|
-
if (this.match(
|
|
18718
|
+
if (this.match(75) || this.match(74) || this.isLet()) {
|
|
18512
18719
|
throw this.raise(ErrorMessages.UnsupportedDefaultExport, {
|
|
18513
18720
|
at: this.state.startLoc
|
|
18514
18721
|
});
|
|
@@ -18529,21 +18736,21 @@ class StatementParser extends ExpressionParser {
|
|
|
18529
18736
|
} = this.state;
|
|
18530
18737
|
|
|
18531
18738
|
if (tokenIsIdentifier(type)) {
|
|
18532
|
-
if (type ===
|
|
18739
|
+
if (type === 95 && !this.state.containsEsc || type === 99) {
|
|
18533
18740
|
return false;
|
|
18534
18741
|
}
|
|
18535
18742
|
|
|
18536
|
-
if ((type ===
|
|
18743
|
+
if ((type === 126 || type === 125) && !this.state.containsEsc) {
|
|
18537
18744
|
var {
|
|
18538
18745
|
type: nextType
|
|
18539
18746
|
} = this.lookahead();
|
|
18540
18747
|
|
|
18541
|
-
if (tokenIsIdentifier(nextType) && nextType !==
|
|
18748
|
+
if (tokenIsIdentifier(nextType) && nextType !== 97 || nextType === 5) {
|
|
18542
18749
|
this.expectOnePlugin(["flow", "typescript"]);
|
|
18543
18750
|
return false;
|
|
18544
18751
|
}
|
|
18545
18752
|
}
|
|
18546
|
-
} else if (!this.match(
|
|
18753
|
+
} else if (!this.match(65)) {
|
|
18547
18754
|
return false;
|
|
18548
18755
|
}
|
|
18549
18756
|
|
|
@@ -18554,7 +18761,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18554
18761
|
return true;
|
|
18555
18762
|
}
|
|
18556
18763
|
|
|
18557
|
-
if (this.match(
|
|
18764
|
+
if (this.match(65) && hasFrom) {
|
|
18558
18765
|
var nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4));
|
|
18559
18766
|
return nextAfterFrom === 34 || nextAfterFrom === 39;
|
|
18560
18767
|
}
|
|
@@ -18563,7 +18770,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18563
18770
|
}
|
|
18564
18771
|
|
|
18565
18772
|
parseExportFrom(node, expect) {
|
|
18566
|
-
if (this.eatContextual(
|
|
18773
|
+
if (this.eatContextual(97)) {
|
|
18567
18774
|
node.source = this.parseImportSource();
|
|
18568
18775
|
this.checkExport(node);
|
|
18569
18776
|
var assertions = this.maybeParseImportAssertions();
|
|
@@ -18597,7 +18804,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18597
18804
|
}
|
|
18598
18805
|
}
|
|
18599
18806
|
|
|
18600
|
-
return type ===
|
|
18807
|
+
return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction();
|
|
18601
18808
|
}
|
|
18602
18809
|
|
|
18603
18810
|
checkExport(node, checkNames, isDefault, isFrom) {
|
|
@@ -18706,8 +18913,8 @@ class StatementParser extends ExpressionParser {
|
|
|
18706
18913
|
if (this.eat(8)) break;
|
|
18707
18914
|
}
|
|
18708
18915
|
|
|
18709
|
-
var isMaybeTypeOnly = this.isContextual(
|
|
18710
|
-
var isString = this.match(
|
|
18916
|
+
var isMaybeTypeOnly = this.isContextual(126);
|
|
18917
|
+
var isString = this.match(129);
|
|
18711
18918
|
var node = this.startNode();
|
|
18712
18919
|
node.local = this.parseModuleExportName();
|
|
18713
18920
|
nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly));
|
|
@@ -18717,7 +18924,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18717
18924
|
}
|
|
18718
18925
|
|
|
18719
18926
|
parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {
|
|
18720
|
-
if (this.eatContextual(
|
|
18927
|
+
if (this.eatContextual(93)) {
|
|
18721
18928
|
node.exported = this.parseModuleExportName();
|
|
18722
18929
|
} else if (isString) {
|
|
18723
18930
|
node.exported = cloneStringLiteral(node.local);
|
|
@@ -18729,7 +18936,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18729
18936
|
}
|
|
18730
18937
|
|
|
18731
18938
|
parseModuleExportName() {
|
|
18732
|
-
if (this.match(
|
|
18939
|
+
if (this.match(129)) {
|
|
18733
18940
|
var result = this.parseStringLiteral(this.state.value);
|
|
18734
18941
|
var surrogate = result.value.match(loneSurrogate);
|
|
18735
18942
|
|
|
@@ -18748,12 +18955,12 @@ class StatementParser extends ExpressionParser {
|
|
|
18748
18955
|
parseImport(node) {
|
|
18749
18956
|
node.specifiers = [];
|
|
18750
18957
|
|
|
18751
|
-
if (!this.match(
|
|
18958
|
+
if (!this.match(129)) {
|
|
18752
18959
|
var hasDefault = this.maybeParseDefaultImportSpecifier(node);
|
|
18753
18960
|
var parseNext = !hasDefault || this.eat(12);
|
|
18754
18961
|
var hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
|
|
18755
18962
|
if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);
|
|
18756
|
-
this.expectContextual(
|
|
18963
|
+
this.expectContextual(97);
|
|
18757
18964
|
}
|
|
18758
18965
|
|
|
18759
18966
|
node.source = this.parseImportSource();
|
|
@@ -18774,7 +18981,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18774
18981
|
}
|
|
18775
18982
|
|
|
18776
18983
|
parseImportSource() {
|
|
18777
|
-
if (!this.match(
|
|
18984
|
+
if (!this.match(129)) this.unexpected();
|
|
18778
18985
|
return this.parseExprAtom();
|
|
18779
18986
|
}
|
|
18780
18987
|
|
|
@@ -18808,7 +19015,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18808
19015
|
|
|
18809
19016
|
attrNames.add(keyName);
|
|
18810
19017
|
|
|
18811
|
-
if (this.match(
|
|
19018
|
+
if (this.match(129)) {
|
|
18812
19019
|
node.key = this.parseStringLiteral(keyName);
|
|
18813
19020
|
} else {
|
|
18814
19021
|
node.key = this.parseIdentifier(true);
|
|
@@ -18816,7 +19023,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18816
19023
|
|
|
18817
19024
|
this.expect(14);
|
|
18818
19025
|
|
|
18819
|
-
if (!this.match(
|
|
19026
|
+
if (!this.match(129)) {
|
|
18820
19027
|
throw this.raise(ErrorMessages.ModuleAttributeInvalidValue, {
|
|
18821
19028
|
at: this.state.startLoc
|
|
18822
19029
|
});
|
|
@@ -18831,7 +19038,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18831
19038
|
}
|
|
18832
19039
|
|
|
18833
19040
|
maybeParseModuleAttributes() {
|
|
18834
|
-
if (this.match(
|
|
19041
|
+
if (this.match(76) && !this.hasPrecedingLineBreak()) {
|
|
18835
19042
|
this.expectPlugin("moduleAttributes");
|
|
18836
19043
|
this.next();
|
|
18837
19044
|
} else {
|
|
@@ -18861,7 +19068,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18861
19068
|
attributes.add(node.key.name);
|
|
18862
19069
|
this.expect(14);
|
|
18863
19070
|
|
|
18864
|
-
if (!this.match(
|
|
19071
|
+
if (!this.match(129)) {
|
|
18865
19072
|
throw this.raise(ErrorMessages.ModuleAttributeInvalidValue, {
|
|
18866
19073
|
at: this.state.startLoc
|
|
18867
19074
|
});
|
|
@@ -18876,7 +19083,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18876
19083
|
}
|
|
18877
19084
|
|
|
18878
19085
|
maybeParseImportAssertions() {
|
|
18879
|
-
if (this.isContextual(
|
|
19086
|
+
if (this.isContextual(94) && !this.hasPrecedingLineBreak()) {
|
|
18880
19087
|
this.expectPlugin("importAssertions");
|
|
18881
19088
|
this.next();
|
|
18882
19089
|
} else {
|
|
@@ -18900,10 +19107,10 @@ class StatementParser extends ExpressionParser {
|
|
|
18900
19107
|
}
|
|
18901
19108
|
|
|
18902
19109
|
maybeParseStarImportSpecifier(node) {
|
|
18903
|
-
if (this.match(
|
|
19110
|
+
if (this.match(55)) {
|
|
18904
19111
|
var specifier = this.startNode();
|
|
18905
19112
|
this.next();
|
|
18906
|
-
this.expectContextual(
|
|
19113
|
+
this.expectContextual(93);
|
|
18907
19114
|
this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier", "import namespace specifier");
|
|
18908
19115
|
return true;
|
|
18909
19116
|
}
|
|
@@ -18930,8 +19137,8 @@ class StatementParser extends ExpressionParser {
|
|
|
18930
19137
|
}
|
|
18931
19138
|
|
|
18932
19139
|
var specifier = this.startNode();
|
|
18933
|
-
var importedIsString = this.match(
|
|
18934
|
-
var isMaybeTypeOnly = this.isContextual(
|
|
19140
|
+
var importedIsString = this.match(129);
|
|
19141
|
+
var isMaybeTypeOnly = this.isContextual(126);
|
|
18935
19142
|
specifier.imported = this.parseModuleExportName();
|
|
18936
19143
|
var importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly);
|
|
18937
19144
|
node.specifiers.push(importSpecifier);
|
|
@@ -18939,7 +19146,7 @@ class StatementParser extends ExpressionParser {
|
|
|
18939
19146
|
}
|
|
18940
19147
|
|
|
18941
19148
|
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
|
|
18942
|
-
if (this.eatContextual(
|
|
19149
|
+
if (this.eatContextual(93)) {
|
|
18943
19150
|
specifier.local = this.parseIdentifier();
|
|
18944
19151
|
} else {
|
|
18945
19152
|
var {
|
|
@@ -20068,11 +20275,13 @@ function getDllAndDepsByResource(_ref, brickPackages) {
|
|
|
20068
20275
|
// istanbul ignore else
|
|
20069
20276
|
if (editor.includes(".")) {
|
|
20070
20277
|
var namespace = editor.split(".")[0];
|
|
20071
|
-
var find = brickMap.get(namespace);
|
|
20278
|
+
var find = brickMap.get(namespace); // There maybe no `editorsJsFilePath`.
|
|
20072
20279
|
|
|
20073
20280
|
if (find) {
|
|
20074
|
-
|
|
20075
|
-
|
|
20281
|
+
if (find.editorsJsFilePath) {
|
|
20282
|
+
deps.add(find.editorsJsFilePath);
|
|
20283
|
+
dll.add("editor-bricks-helper");
|
|
20284
|
+
}
|
|
20076
20285
|
} else {
|
|
20077
20286
|
// eslint-disable-next-line no-console
|
|
20078
20287
|
console.error("the name of editor is `".concat(editor, "` and it don't match any editor package"));
|