@tinacms/app 1.0.3 → 1.0.5
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/appFiles/node_modules/.package-lock.json +27 -27
- package/appFiles/node_modules/@babel/generator/lib/buffer.js +1 -16
- package/appFiles/node_modules/@babel/generator/lib/buffer.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/base.js +0 -2
- package/appFiles/node_modules/@babel/generator/lib/generators/base.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/classes.js +0 -6
- package/appFiles/node_modules/@babel/generator/lib/generators/classes.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js +1 -6
- package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/flow.js +0 -2
- package/appFiles/node_modules/@babel/generator/lib/generators/flow.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/methods.js +4 -11
- package/appFiles/node_modules/@babel/generator/lib/generators/methods.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/modules.js +0 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/modules.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/statements.js +0 -3
- package/appFiles/node_modules/@babel/generator/lib/generators/statements.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/types.js +1 -5
- package/appFiles/node_modules/@babel/generator/lib/generators/types.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/typescript.js +2 -4
- package/appFiles/node_modules/@babel/generator/lib/generators/typescript.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/index.js +0 -6
- package/appFiles/node_modules/@babel/generator/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/node/index.js +0 -1
- package/appFiles/node_modules/@babel/generator/lib/node/index.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/node/parentheses.js +8 -15
- package/appFiles/node_modules/@babel/generator/lib/node/parentheses.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/node/whitespace.js +1 -15
- package/appFiles/node_modules/@babel/generator/lib/node/whitespace.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/printer.js +8 -47
- package/appFiles/node_modules/@babel/generator/lib/printer.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/source-map.js +0 -4
- package/appFiles/node_modules/@babel/generator/lib/source-map.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/package.json +3 -3
- package/appFiles/node_modules/@babel/parser/lib/index.js +169 -684
- package/appFiles/node_modules/@babel/parser/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/parser/package.json +1 -1
- package/appFiles/node_modules/@babel/runtime/helpers/applyDecs.js +3 -9
- package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2203.js +169 -172
- package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2203R.js +188 -0
- package/appFiles/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +1 -3
- package/appFiles/node_modules/@babel/runtime/helpers/classNameTDZError.js +1 -1
- package/appFiles/node_modules/@babel/runtime/helpers/defineAccessor.js +8 -0
- package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs.js +3 -9
- package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2203.js +169 -172
- package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +187 -0
- package/appFiles/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +1 -3
- package/appFiles/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js +1 -1
- package/appFiles/node_modules/@babel/runtime/helpers/esm/defineAccessor.js +7 -0
- package/appFiles/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +1 -3
- package/appFiles/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js +1 -3
- package/appFiles/node_modules/@babel/runtime/helpers/esm/jsx.js +2 -6
- package/appFiles/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +3 -9
- package/appFiles/node_modules/@babel/runtime/helpers/esm/set.js +1 -1
- package/appFiles/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js +1 -3
- package/appFiles/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js +1 -3
- package/appFiles/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js +1 -3
- package/appFiles/node_modules/@babel/runtime/helpers/jsx.js +2 -6
- package/appFiles/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +3 -9
- package/appFiles/node_modules/@babel/runtime/helpers/set.js +1 -1
- package/appFiles/node_modules/@babel/runtime/helpers/wrapRegExp.js +1 -3
- package/appFiles/node_modules/@babel/runtime/package.json +19 -1
- package/appFiles/node_modules/@babel/template/lib/builder.js +3 -15
- package/appFiles/node_modules/@babel/template/lib/builder.js.map +1 -0
- package/appFiles/node_modules/@babel/template/lib/formatters.js +3 -8
- package/appFiles/node_modules/@babel/template/lib/formatters.js.map +1 -0
- package/appFiles/node_modules/@babel/template/lib/index.js +2 -5
- package/appFiles/node_modules/@babel/template/lib/index.js.map +1 -0
- package/appFiles/node_modules/@babel/template/lib/literal.js +3 -13
- package/appFiles/node_modules/@babel/template/lib/literal.js.map +1 -0
- package/appFiles/node_modules/@babel/template/lib/options.js +10 -19
- package/appFiles/node_modules/@babel/template/lib/options.js.map +1 -0
- package/appFiles/node_modules/@babel/template/lib/parse.js +3 -23
- package/appFiles/node_modules/@babel/template/lib/parse.js.map +1 -0
- package/appFiles/node_modules/@babel/template/lib/populate.js +3 -15
- package/appFiles/node_modules/@babel/template/lib/populate.js.map +1 -0
- package/appFiles/node_modules/@babel/template/lib/string.js +3 -5
- package/appFiles/node_modules/@babel/template/lib/string.js.map +1 -0
- package/appFiles/node_modules/@babel/template/package.json +3 -3
- package/appFiles/node_modules/@babel/traverse/lib/context.js +2 -14
- package/appFiles/node_modules/@babel/traverse/lib/context.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/index.js +1 -4
- package/appFiles/node_modules/@babel/traverse/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/ancestry.js +0 -19
- package/appFiles/node_modules/@babel/traverse/lib/path/ancestry.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/comments.js +0 -2
- package/appFiles/node_modules/@babel/traverse/lib/path/comments.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/context.js +5 -21
- package/appFiles/node_modules/@babel/traverse/lib/path/context.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/conversion.js +6 -30
- package/appFiles/node_modules/@babel/traverse/lib/path/conversion.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/evaluation.js +14 -20
- package/appFiles/node_modules/@babel/traverse/lib/path/evaluation.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/family.js +3 -9
- package/appFiles/node_modules/@babel/traverse/lib/path/family.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/index.js +1 -6
- package/appFiles/node_modules/@babel/traverse/lib/path/index.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/inference/index.js +1 -9
- package/appFiles/node_modules/@babel/traverse/lib/path/inference/index.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js +1 -13
- package/appFiles/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/inference/inferers.js +2 -5
- package/appFiles/node_modules/@babel/traverse/lib/path/inference/inferers.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/introspection.js +21 -62
- package/appFiles/node_modules/@babel/traverse/lib/path/introspection.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/lib/hoister.js +1 -22
- package/appFiles/node_modules/@babel/traverse/lib/path/lib/hoister.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js +1 -7
- package/appFiles/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js +0 -2
- package/appFiles/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/lib/virtual-types.js +0 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/lib/virtual-types.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/modification.js +12 -24
- package/appFiles/node_modules/@babel/traverse/lib/path/modification.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/removal.js +0 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/removal.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/replacement.js +2 -16
- package/appFiles/node_modules/@babel/traverse/lib/path/replacement.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/scope/binding.js +1 -6
- package/appFiles/node_modules/@babel/traverse/lib/scope/binding.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/scope/index.js +28 -63
- package/appFiles/node_modules/@babel/traverse/lib/scope/index.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/scope/lib/renamer.js +8 -14
- package/appFiles/node_modules/@babel/traverse/lib/scope/lib/renamer.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/visitors.js +2 -23
- package/appFiles/node_modules/@babel/traverse/lib/visitors.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/package.json +4 -4
- package/appFiles/node_modules/@babel/types/lib/asserts/assertNode.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/traverse/traverse.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +2 -1
- package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -1
- package/appFiles/node_modules/@babel/types/package.json +3 -3
- package/appFiles/node_modules/css-to-react-native/README.md +4 -2
- package/appFiles/node_modules/css-to-react-native/index.js +13 -6
- package/appFiles/node_modules/css-to-react-native/package.json +2 -1
- package/appFiles/node_modules/css-to-react-native/src/__tests__/fontVariant.js +8 -0
- package/appFiles/node_modules/css-to-react-native/src/transforms/fontVariant.js +14 -0
- package/appFiles/node_modules/css-to-react-native/src/transforms/index.js +5 -7
- package/appFiles/src/fields/rich-text/monaco/index.tsx +12 -10
- package/appFiles/src/fields/rich-text/monaco/mdx.js +41 -35
- package/appFiles/src/lib/machines/document-machine.ts +1 -1
- package/dist/index.js +4 -2
- package/package.json +5 -4
|
@@ -35,7 +35,6 @@ class SourceLocation {
|
|
|
35
35
|
this.end = end;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
|
|
39
38
|
function createPositionWithColumnOffset(position, columnOffset) {
|
|
40
39
|
const {
|
|
41
40
|
line,
|
|
@@ -51,12 +50,10 @@ var ParseErrorCode = {
|
|
|
51
50
|
};
|
|
52
51
|
const reflect = (keys, last = keys.length - 1) => ({
|
|
53
52
|
get() {
|
|
54
|
-
return keys.reduce((object, key) =>
|
|
55
|
-
object[key], this);
|
|
53
|
+
return keys.reduce((object, key) => object[key], this);
|
|
56
54
|
},
|
|
57
55
|
set(value) {
|
|
58
|
-
keys.reduce(
|
|
59
|
-
(item, key, i) => i === last ? item[key] = value : item[key], this);
|
|
56
|
+
keys.reduce((item, key, i) => i === last ? item[key] = value : item[key], this);
|
|
60
57
|
}
|
|
61
58
|
});
|
|
62
59
|
const instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === "function" ? {
|
|
@@ -118,9 +115,9 @@ var StandardErrors = {
|
|
|
118
115
|
AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
|
|
119
116
|
AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
|
|
120
117
|
AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
|
|
121
|
-
BadGetterArity: "A 'get'
|
|
122
|
-
BadSetterArity: "A 'set'
|
|
123
|
-
BadSetterRestParameter: "A 'set'
|
|
118
|
+
BadGetterArity: "A 'get' accessor must not have any formal parameters.",
|
|
119
|
+
BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
|
|
120
|
+
BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
|
|
124
121
|
ConstructorClassField: "Classes may not have a field named 'constructor'.",
|
|
125
122
|
ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
|
|
126
123
|
ConstructorIsAccessor: "Class constructor may not be an accessor.",
|
|
@@ -445,7 +442,6 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
445
442
|
}
|
|
446
443
|
return file;
|
|
447
444
|
}
|
|
448
|
-
|
|
449
445
|
parseRegExpLiteral({
|
|
450
446
|
pattern,
|
|
451
447
|
flags
|
|
@@ -453,9 +449,7 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
453
449
|
let regex = null;
|
|
454
450
|
try {
|
|
455
451
|
regex = new RegExp(pattern, flags);
|
|
456
|
-
} catch (e) {
|
|
457
|
-
}
|
|
458
|
-
|
|
452
|
+
} catch (e) {}
|
|
459
453
|
const node = this.estreeParseLiteral(regex);
|
|
460
454
|
node.regex = {
|
|
461
455
|
pattern,
|
|
@@ -463,7 +457,6 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
463
457
|
};
|
|
464
458
|
return node;
|
|
465
459
|
}
|
|
466
|
-
|
|
467
460
|
parseBigIntLiteral(value) {
|
|
468
461
|
let bigInt;
|
|
469
462
|
try {
|
|
@@ -475,7 +468,6 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
475
468
|
node.bigint = String(node.value || value);
|
|
476
469
|
return node;
|
|
477
470
|
}
|
|
478
|
-
|
|
479
471
|
parseDecimalLiteral(value) {
|
|
480
472
|
const decimal = null;
|
|
481
473
|
const node = this.estreeParseLiteral(decimal);
|
|
@@ -485,21 +477,18 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
485
477
|
estreeParseLiteral(value) {
|
|
486
478
|
return this.parseLiteral(value, "Literal");
|
|
487
479
|
}
|
|
488
|
-
|
|
489
480
|
parseStringLiteral(value) {
|
|
490
481
|
return this.estreeParseLiteral(value);
|
|
491
482
|
}
|
|
492
483
|
parseNumericLiteral(value) {
|
|
493
484
|
return this.estreeParseLiteral(value);
|
|
494
485
|
}
|
|
495
|
-
|
|
496
486
|
parseNullLiteral() {
|
|
497
487
|
return this.estreeParseLiteral(null);
|
|
498
488
|
}
|
|
499
489
|
parseBooleanLiteral(value) {
|
|
500
490
|
return this.estreeParseLiteral(value);
|
|
501
491
|
}
|
|
502
|
-
|
|
503
492
|
directiveToStmt(directive) {
|
|
504
493
|
const expression = directive.value;
|
|
505
494
|
delete directive.value;
|
|
@@ -513,7 +502,6 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
513
502
|
delete expression.extra;
|
|
514
503
|
return stmt;
|
|
515
504
|
}
|
|
516
|
-
|
|
517
505
|
initFunction(node, isAsync) {
|
|
518
506
|
super.initFunction(node, isAsync);
|
|
519
507
|
node.expression = false;
|
|
@@ -579,7 +567,6 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
579
567
|
}
|
|
580
568
|
return node.name;
|
|
581
569
|
}
|
|
582
|
-
|
|
583
570
|
parseLiteral(value, type) {
|
|
584
571
|
const node = super.parseLiteral(value, type);
|
|
585
572
|
node.raw = node.extra.raw;
|
|
@@ -590,20 +577,17 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
590
577
|
super.parseFunctionBody(node, allowExpression, isMethod);
|
|
591
578
|
node.expression = node.body.type !== "BlockStatement";
|
|
592
579
|
}
|
|
593
|
-
|
|
594
580
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
|
|
595
581
|
let funcNode = this.startNode();
|
|
596
582
|
funcNode.kind = node.kind;
|
|
597
|
-
funcNode = super.parseMethod(
|
|
598
|
-
funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
|
|
583
|
+
funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
|
|
599
584
|
funcNode.type = "FunctionExpression";
|
|
600
585
|
delete funcNode.kind;
|
|
601
586
|
node.value = funcNode;
|
|
602
587
|
if (type === "ClassPrivateMethod") {
|
|
603
588
|
node.computed = false;
|
|
604
589
|
}
|
|
605
|
-
return this.finishNode(
|
|
606
|
-
node, "MethodDefinition");
|
|
590
|
+
return this.finishNode(node, "MethodDefinition");
|
|
607
591
|
}
|
|
608
592
|
parseClassProperty(...args) {
|
|
609
593
|
const propertyNode = super.parseClassProperty(...args);
|
|
@@ -695,8 +679,7 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
695
679
|
}
|
|
696
680
|
return node;
|
|
697
681
|
}
|
|
698
|
-
toReferencedArguments(node
|
|
699
|
-
) {
|
|
682
|
+
toReferencedArguments(node) {
|
|
700
683
|
if (node.type === "ImportExpression") {
|
|
701
684
|
return;
|
|
702
685
|
}
|
|
@@ -710,23 +693,19 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
710
693
|
node.exported = null;
|
|
711
694
|
break;
|
|
712
695
|
case "ExportNamedDeclaration":
|
|
713
|
-
if (node.specifiers.length === 1 &&
|
|
714
|
-
node.specifiers[0].type === "ExportNamespaceSpecifier") {
|
|
696
|
+
if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
|
|
715
697
|
node.type = "ExportAllDeclaration";
|
|
716
698
|
node.exported = node.specifiers[0].exported;
|
|
717
699
|
delete node.specifiers;
|
|
718
700
|
}
|
|
719
|
-
|
|
720
701
|
case "ExportDefaultDeclaration":
|
|
721
702
|
{
|
|
722
703
|
var _declaration$decorato;
|
|
723
704
|
const {
|
|
724
705
|
declaration
|
|
725
706
|
} = node;
|
|
726
|
-
if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 &&
|
|
727
|
-
|
|
728
|
-
this.resetStartLocation(node,
|
|
729
|
-
exportStartLoc);
|
|
707
|
+
if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) {
|
|
708
|
+
this.resetStartLocation(node, exportStartLoc);
|
|
730
709
|
}
|
|
731
710
|
}
|
|
732
711
|
break;
|
|
@@ -739,7 +718,6 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
739
718
|
if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") {
|
|
740
719
|
node.type = node.type.substring(8);
|
|
741
720
|
}
|
|
742
|
-
|
|
743
721
|
if (state.stop) {
|
|
744
722
|
const chain = this.startNodeAtNode(node);
|
|
745
723
|
chain.expression = node;
|
|
@@ -759,7 +737,6 @@ var estree = (superClass => class ESTreeParserMixin extends superClass {
|
|
|
759
737
|
isOptionalChain(node) {
|
|
760
738
|
return node.type === "ChainExpression";
|
|
761
739
|
}
|
|
762
|
-
|
|
763
740
|
isObjectProperty(node) {
|
|
764
741
|
return node.type === "Property" && node.kind === "init" && !node.method;
|
|
765
742
|
}
|
|
@@ -793,7 +770,6 @@ const types = {
|
|
|
793
770
|
j_cTag: new TokContext("</tag"),
|
|
794
771
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
795
772
|
};
|
|
796
|
-
|
|
797
773
|
{
|
|
798
774
|
types.template = new TokContext("`", true);
|
|
799
775
|
}
|
|
@@ -831,7 +807,6 @@ class ExportedTokenType {
|
|
|
831
807
|
}
|
|
832
808
|
}
|
|
833
809
|
}
|
|
834
|
-
|
|
835
810
|
const keywords$1 = new Map();
|
|
836
811
|
function createKeyword(name, options = {}) {
|
|
837
812
|
options.keyword = name;
|
|
@@ -875,7 +850,6 @@ function createKeywordLike(name, options = {}) {
|
|
|
875
850
|
tokenTypes.push(new ExportedTokenType("name", options));
|
|
876
851
|
return tokenTypeCounter;
|
|
877
852
|
}
|
|
878
|
-
|
|
879
853
|
const tt = {
|
|
880
854
|
bracketL: createToken("[", {
|
|
881
855
|
beforeExpr,
|
|
@@ -953,7 +927,6 @@ const tt = {
|
|
|
953
927
|
startsExpr
|
|
954
928
|
}),
|
|
955
929
|
interpreterDirective: createToken("#!..."),
|
|
956
|
-
|
|
957
930
|
eq: createToken("=", {
|
|
958
931
|
beforeExpr,
|
|
959
932
|
isAssign
|
|
@@ -974,7 +947,6 @@ const tt = {
|
|
|
974
947
|
beforeExpr,
|
|
975
948
|
isAssign
|
|
976
949
|
}),
|
|
977
|
-
|
|
978
950
|
incDec: createToken("++/--", {
|
|
979
951
|
prefix,
|
|
980
952
|
postfix,
|
|
@@ -1122,7 +1094,6 @@ const tt = {
|
|
|
1122
1094
|
_while: createKeyword("while", {
|
|
1123
1095
|
isLoop
|
|
1124
1096
|
}),
|
|
1125
|
-
|
|
1126
1097
|
_as: createKeywordLike("as", {
|
|
1127
1098
|
startsExpr
|
|
1128
1099
|
}),
|
|
@@ -1237,7 +1208,6 @@ const tt = {
|
|
|
1237
1208
|
name: createToken("name", {
|
|
1238
1209
|
startsExpr
|
|
1239
1210
|
}),
|
|
1240
|
-
|
|
1241
1211
|
string: createToken("string", {
|
|
1242
1212
|
startsExpr
|
|
1243
1213
|
}),
|
|
@@ -1353,10 +1323,8 @@ let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\
|
|
|
1353
1323
|
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
1354
1324
|
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
1355
1325
|
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
1356
|
-
|
|
1357
1326
|
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 4026, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 757, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938, 6, 4191];
|
|
1358
1327
|
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 81, 2, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 9, 5351, 0, 7, 14, 13835, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 983, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
|
|
1359
|
-
|
|
1360
1328
|
function isInAstralSet(code, set) {
|
|
1361
1329
|
let pos = 0x10000;
|
|
1362
1330
|
for (let i = 0, length = set.length; i < length; i += 2) {
|
|
@@ -1367,7 +1335,6 @@ function isInAstralSet(code, set) {
|
|
|
1367
1335
|
}
|
|
1368
1336
|
return false;
|
|
1369
1337
|
}
|
|
1370
|
-
|
|
1371
1338
|
function isIdentifierStart(code) {
|
|
1372
1339
|
if (code < 65) return code === 36;
|
|
1373
1340
|
if (code <= 90) return true;
|
|
@@ -1378,7 +1345,6 @@ function isIdentifierStart(code) {
|
|
|
1378
1345
|
}
|
|
1379
1346
|
return isInAstralSet(code, astralIdentifierStartCodes);
|
|
1380
1347
|
}
|
|
1381
|
-
|
|
1382
1348
|
function isIdentifierChar(code) {
|
|
1383
1349
|
if (code < 48) return code === 36;
|
|
1384
1350
|
if (code < 58) return true;
|
|
@@ -1400,19 +1366,15 @@ const reservedWords = {
|
|
|
1400
1366
|
const keywords = new Set(reservedWords.keyword);
|
|
1401
1367
|
const reservedWordsStrictSet = new Set(reservedWords.strict);
|
|
1402
1368
|
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
|
1403
|
-
|
|
1404
1369
|
function isReservedWord(word, inModule) {
|
|
1405
1370
|
return inModule && word === "await" || word === "enum";
|
|
1406
1371
|
}
|
|
1407
|
-
|
|
1408
1372
|
function isStrictReservedWord(word, inModule) {
|
|
1409
1373
|
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
|
|
1410
1374
|
}
|
|
1411
|
-
|
|
1412
1375
|
function isStrictBindOnlyReservedWord(word) {
|
|
1413
1376
|
return reservedWordsStrictBindSet.has(word);
|
|
1414
1377
|
}
|
|
1415
|
-
|
|
1416
1378
|
function isStrictBindReservedWord(word, inModule) {
|
|
1417
1379
|
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
|
|
1418
1380
|
}
|
|
@@ -1423,11 +1385,7 @@ function isKeyword(word) {
|
|
|
1423
1385
|
function isIteratorStart(current, next, next2) {
|
|
1424
1386
|
return current === 64 && next === 64 && isIdentifierStart(next2);
|
|
1425
1387
|
}
|
|
1426
|
-
|
|
1427
|
-
const 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",
|
|
1428
|
-
"implements", "interface", "let", "package", "private", "protected", "public", "static", "yield",
|
|
1429
|
-
"eval", "arguments",
|
|
1430
|
-
"enum", "await"]);
|
|
1388
|
+
const 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"]);
|
|
1431
1389
|
function canBeReservedWord(word) {
|
|
1432
1390
|
return reservedWordLikeSet.has(word);
|
|
1433
1391
|
}
|
|
@@ -1455,7 +1413,6 @@ const BIND_KIND_VALUE = 0b000000000001,
|
|
|
1455
1413
|
BIND_FLAGS_TS_EXPORT_ONLY = 0b0010000000000,
|
|
1456
1414
|
BIND_FLAGS_FLOW_DECLARE_FN = 0b0100000000000,
|
|
1457
1415
|
BIND_FLAGS_TS_IMPORT = 0b1000000000000;
|
|
1458
|
-
|
|
1459
1416
|
const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS,
|
|
1460
1417
|
BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0,
|
|
1461
1418
|
BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0,
|
|
@@ -1474,7 +1431,6 @@ const CLASS_ELEMENT_FLAG_STATIC = 0b100,
|
|
|
1474
1431
|
CLASS_ELEMENT_KIND_GETTER = 0b010,
|
|
1475
1432
|
CLASS_ELEMENT_KIND_SETTER = 0b001,
|
|
1476
1433
|
CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;
|
|
1477
|
-
|
|
1478
1434
|
const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,
|
|
1479
1435
|
CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,
|
|
1480
1436
|
CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,
|
|
@@ -1482,7 +1438,6 @@ const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FL
|
|
|
1482
1438
|
CLASS_ELEMENT_OTHER = 0;
|
|
1483
1439
|
|
|
1484
1440
|
class Scope {
|
|
1485
|
-
|
|
1486
1441
|
constructor(flags) {
|
|
1487
1442
|
this.var = new Set();
|
|
1488
1443
|
this.lexical = new Set();
|
|
@@ -1490,7 +1445,6 @@ class Scope {
|
|
|
1490
1445
|
this.flags = flags;
|
|
1491
1446
|
}
|
|
1492
1447
|
}
|
|
1493
|
-
|
|
1494
1448
|
class ScopeHandler {
|
|
1495
1449
|
constructor(parser, inModule) {
|
|
1496
1450
|
this.parser = void 0;
|
|
@@ -1548,7 +1502,6 @@ class ScopeHandler {
|
|
|
1548
1502
|
const scope = this.scopeStack.pop();
|
|
1549
1503
|
return scope.flags;
|
|
1550
1504
|
}
|
|
1551
|
-
|
|
1552
1505
|
treatFunctionsAsVarInScope(scope) {
|
|
1553
1506
|
return !!(scope.flags & (SCOPE_FUNCTION | SCOPE_STATIC_BLOCK) || !this.parser.inModule && scope.flags & SCOPE_PROGRAM);
|
|
1554
1507
|
}
|
|
@@ -1605,8 +1558,7 @@ class ScopeHandler {
|
|
|
1605
1558
|
name
|
|
1606
1559
|
} = id;
|
|
1607
1560
|
const topLevelScope = this.scopeStack[0];
|
|
1608
|
-
if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) &&
|
|
1609
|
-
!topLevelScope.functions.has(name)) {
|
|
1561
|
+
if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) {
|
|
1610
1562
|
this.undefinedExports.set(name, id.loc.start);
|
|
1611
1563
|
}
|
|
1612
1564
|
}
|
|
@@ -1623,7 +1575,6 @@ class ScopeHandler {
|
|
|
1623
1575
|
}
|
|
1624
1576
|
}
|
|
1625
1577
|
}
|
|
1626
|
-
|
|
1627
1578
|
currentThisScopeFlags() {
|
|
1628
1579
|
for (let i = this.scopeStack.length - 1;; i--) {
|
|
1629
1580
|
const {
|
|
@@ -1705,7 +1656,6 @@ function setTrailingComments(node, comments) {
|
|
|
1705
1656
|
node.trailingComments.unshift(...comments);
|
|
1706
1657
|
}
|
|
1707
1658
|
}
|
|
1708
|
-
|
|
1709
1659
|
function setLeadingComments(node, comments) {
|
|
1710
1660
|
if (node.leadingComments === undefined) {
|
|
1711
1661
|
node.leadingComments = comments;
|
|
@@ -1713,7 +1663,6 @@ function setLeadingComments(node, comments) {
|
|
|
1713
1663
|
node.leadingComments.unshift(...comments);
|
|
1714
1664
|
}
|
|
1715
1665
|
}
|
|
1716
|
-
|
|
1717
1666
|
function setInnerComments(node, comments) {
|
|
1718
1667
|
if (node.innerComments === undefined) {
|
|
1719
1668
|
node.innerComments = comments;
|
|
@@ -1721,7 +1670,6 @@ function setInnerComments(node, comments) {
|
|
|
1721
1670
|
node.innerComments.unshift(...comments);
|
|
1722
1671
|
}
|
|
1723
1672
|
}
|
|
1724
|
-
|
|
1725
1673
|
function adjustInnerComments(node, elements, commentWS) {
|
|
1726
1674
|
let lastElement = null;
|
|
1727
1675
|
let i = elements.length;
|
|
@@ -1734,13 +1682,11 @@ function adjustInnerComments(node, elements, commentWS) {
|
|
|
1734
1682
|
setTrailingComments(lastElement, commentWS.comments);
|
|
1735
1683
|
}
|
|
1736
1684
|
}
|
|
1737
|
-
|
|
1738
1685
|
class CommentsParser extends BaseParser {
|
|
1739
1686
|
addComment(comment) {
|
|
1740
1687
|
if (this.filename) comment.loc.filename = this.filename;
|
|
1741
1688
|
this.state.comments.push(comment);
|
|
1742
1689
|
}
|
|
1743
|
-
|
|
1744
1690
|
processComment(node) {
|
|
1745
1691
|
const {
|
|
1746
1692
|
commentStack
|
|
@@ -1771,7 +1717,6 @@ class CommentsParser extends BaseParser {
|
|
|
1771
1717
|
}
|
|
1772
1718
|
}
|
|
1773
1719
|
}
|
|
1774
|
-
|
|
1775
1720
|
finalizeComment(commentWS) {
|
|
1776
1721
|
const {
|
|
1777
1722
|
comments
|
|
@@ -1826,7 +1771,6 @@ class CommentsParser extends BaseParser {
|
|
|
1826
1771
|
}
|
|
1827
1772
|
}
|
|
1828
1773
|
}
|
|
1829
|
-
|
|
1830
1774
|
finalizeRemainingComments() {
|
|
1831
1775
|
const {
|
|
1832
1776
|
commentStack
|
|
@@ -1836,7 +1780,6 @@ class CommentsParser extends BaseParser {
|
|
|
1836
1780
|
}
|
|
1837
1781
|
this.state.commentStack = [];
|
|
1838
1782
|
}
|
|
1839
|
-
|
|
1840
1783
|
resetPreviousNodeTrailingComments(node) {
|
|
1841
1784
|
const {
|
|
1842
1785
|
commentStack
|
|
@@ -1850,7 +1793,6 @@ class CommentsParser extends BaseParser {
|
|
|
1850
1793
|
commentWS.leadingNode = null;
|
|
1851
1794
|
}
|
|
1852
1795
|
}
|
|
1853
|
-
|
|
1854
1796
|
takeSurroundingComments(node, start, end) {
|
|
1855
1797
|
const {
|
|
1856
1798
|
commentStack
|
|
@@ -1875,7 +1817,6 @@ class CommentsParser extends BaseParser {
|
|
|
1875
1817
|
|
|
1876
1818
|
const lineBreak = /\r\n?|[\n\u2028\u2029]/;
|
|
1877
1819
|
const lineBreakG = new RegExp(lineBreak.source, "g");
|
|
1878
|
-
|
|
1879
1820
|
function isNewLine(code) {
|
|
1880
1821
|
switch (code) {
|
|
1881
1822
|
case 10:
|
|
@@ -1889,12 +1830,7 @@ function isNewLine(code) {
|
|
|
1889
1830
|
}
|
|
1890
1831
|
const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
1891
1832
|
const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/y;
|
|
1892
|
-
|
|
1893
|
-
const skipWhiteSpaceToLineBreak = new RegExp(
|
|
1894
|
-
"(?=(" +
|
|
1895
|
-
skipWhiteSpaceInLine.source + "))\\1" +
|
|
1896
|
-
/(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y");
|
|
1897
|
-
|
|
1833
|
+
const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y");
|
|
1898
1834
|
function isWhitespace(code) {
|
|
1899
1835
|
switch (code) {
|
|
1900
1836
|
case 0x0009:
|
|
@@ -1989,7 +1925,6 @@ class State {
|
|
|
1989
1925
|
if (!skipArrays && Array.isArray(val)) {
|
|
1990
1926
|
val = val.slice();
|
|
1991
1927
|
}
|
|
1992
|
-
|
|
1993
1928
|
state[key] = val;
|
|
1994
1929
|
}
|
|
1995
1930
|
return state;
|
|
@@ -2086,7 +2021,6 @@ function isStringEnd(type, ch, input, pos) {
|
|
|
2086
2021
|
function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) {
|
|
2087
2022
|
const throwOnInvalid = !inTemplate;
|
|
2088
2023
|
pos++;
|
|
2089
|
-
|
|
2090
2024
|
const res = ch => ({
|
|
2091
2025
|
pos,
|
|
2092
2026
|
ch,
|
|
@@ -2210,7 +2144,6 @@ function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumS
|
|
|
2210
2144
|
};
|
|
2211
2145
|
errors.unexpectedNumericSeparator(pos, lineStart, curLine);
|
|
2212
2146
|
}
|
|
2213
|
-
|
|
2214
2147
|
++pos;
|
|
2215
2148
|
continue;
|
|
2216
2149
|
}
|
|
@@ -2290,7 +2223,6 @@ function buildPosition(pos, lineStart, curLine) {
|
|
|
2290
2223
|
return new Position(curLine, pos - lineStart, pos);
|
|
2291
2224
|
}
|
|
2292
2225
|
const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]);
|
|
2293
|
-
|
|
2294
2226
|
class Token {
|
|
2295
2227
|
constructor(state) {
|
|
2296
2228
|
this.type = state.type;
|
|
@@ -2300,9 +2232,7 @@ class Token {
|
|
|
2300
2232
|
this.loc = new SourceLocation(state.startLoc, state.endLoc);
|
|
2301
2233
|
}
|
|
2302
2234
|
}
|
|
2303
|
-
|
|
2304
2235
|
class Tokenizer extends CommentsParser {
|
|
2305
|
-
|
|
2306
2236
|
constructor(options, input) {
|
|
2307
2237
|
super();
|
|
2308
2238
|
this.isLookahead = void 0;
|
|
@@ -2354,7 +2284,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2354
2284
|
this.tokens.push(token);
|
|
2355
2285
|
++this.state.tokensLength;
|
|
2356
2286
|
}
|
|
2357
|
-
|
|
2358
2287
|
next() {
|
|
2359
2288
|
this.checkKeywordEscapes();
|
|
2360
2289
|
if (this.options.tokens) {
|
|
@@ -2365,7 +2294,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2365
2294
|
this.state.lastTokStartLoc = this.state.startLoc;
|
|
2366
2295
|
this.nextToken();
|
|
2367
2296
|
}
|
|
2368
|
-
|
|
2369
2297
|
eat(type) {
|
|
2370
2298
|
if (this.match(type)) {
|
|
2371
2299
|
this.next();
|
|
@@ -2374,11 +2302,9 @@ class Tokenizer extends CommentsParser {
|
|
|
2374
2302
|
return false;
|
|
2375
2303
|
}
|
|
2376
2304
|
}
|
|
2377
|
-
|
|
2378
2305
|
match(type) {
|
|
2379
2306
|
return this.state.type === type;
|
|
2380
2307
|
}
|
|
2381
|
-
|
|
2382
2308
|
createLookaheadState(state) {
|
|
2383
2309
|
return {
|
|
2384
2310
|
pos: state.pos,
|
|
@@ -2395,7 +2321,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2395
2321
|
curPosition: state.curPosition
|
|
2396
2322
|
};
|
|
2397
2323
|
}
|
|
2398
|
-
|
|
2399
2324
|
lookahead() {
|
|
2400
2325
|
const old = this.state;
|
|
2401
2326
|
this.state = this.createLookaheadState(old);
|
|
@@ -2426,7 +2351,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2426
2351
|
}
|
|
2427
2352
|
return cp;
|
|
2428
2353
|
}
|
|
2429
|
-
|
|
2430
2354
|
setStrict(strict) {
|
|
2431
2355
|
this.state.strict = strict;
|
|
2432
2356
|
if (strict) {
|
|
@@ -2439,7 +2363,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2439
2363
|
curContext() {
|
|
2440
2364
|
return this.state.context[this.state.context.length - 1];
|
|
2441
2365
|
}
|
|
2442
|
-
|
|
2443
2366
|
nextToken() {
|
|
2444
2367
|
this.skipSpace();
|
|
2445
2368
|
this.state.start = this.state.pos;
|
|
@@ -2450,7 +2373,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2450
2373
|
}
|
|
2451
2374
|
this.getTokenFromCode(this.codePointAtPos(this.state.pos));
|
|
2452
2375
|
}
|
|
2453
|
-
|
|
2454
2376
|
skipBlockComment(commentEnd) {
|
|
2455
2377
|
let startLoc;
|
|
2456
2378
|
if (!this.isLookahead) startLoc = this.state.curPosition();
|
|
@@ -2467,9 +2389,7 @@ class Tokenizer extends CommentsParser {
|
|
|
2467
2389
|
++this.state.curLine;
|
|
2468
2390
|
this.state.lineStart = lineBreakG.lastIndex;
|
|
2469
2391
|
}
|
|
2470
|
-
|
|
2471
2392
|
if (this.isLookahead) return;
|
|
2472
|
-
|
|
2473
2393
|
const comment = {
|
|
2474
2394
|
type: "CommentBlock",
|
|
2475
2395
|
value: this.input.slice(start + 2, end),
|
|
@@ -2490,9 +2410,7 @@ class Tokenizer extends CommentsParser {
|
|
|
2490
2410
|
ch = this.input.charCodeAt(this.state.pos);
|
|
2491
2411
|
}
|
|
2492
2412
|
}
|
|
2493
|
-
|
|
2494
2413
|
if (this.isLookahead) return;
|
|
2495
|
-
|
|
2496
2414
|
const end = this.state.pos;
|
|
2497
2415
|
const value = this.input.slice(start + startSkip, end);
|
|
2498
2416
|
const comment = {
|
|
@@ -2505,7 +2423,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2505
2423
|
if (this.options.tokens) this.pushToken(comment);
|
|
2506
2424
|
return comment;
|
|
2507
2425
|
}
|
|
2508
|
-
|
|
2509
2426
|
skipSpace() {
|
|
2510
2427
|
const spaceStart = this.state.pos;
|
|
2511
2428
|
const comments = [];
|
|
@@ -2595,7 +2512,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2595
2512
|
this.state.commentStack.push(commentWhitespace);
|
|
2596
2513
|
}
|
|
2597
2514
|
}
|
|
2598
|
-
|
|
2599
2515
|
finishToken(type, val) {
|
|
2600
2516
|
this.state.end = this.state.pos;
|
|
2601
2517
|
this.state.endLoc = this.state.curPosition();
|
|
@@ -2610,7 +2526,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2610
2526
|
this.state.type = type;
|
|
2611
2527
|
this.updateContext();
|
|
2612
2528
|
}
|
|
2613
|
-
|
|
2614
2529
|
readToken_numberSign() {
|
|
2615
2530
|
if (this.state.pos === 0 && this.readToken_interpreter()) {
|
|
2616
2531
|
return;
|
|
@@ -2684,13 +2599,11 @@ class Tokenizer extends CommentsParser {
|
|
|
2684
2599
|
let type = code === 42 ? 55 : 54;
|
|
2685
2600
|
let width = 1;
|
|
2686
2601
|
let next = this.input.charCodeAt(this.state.pos + 1);
|
|
2687
|
-
|
|
2688
2602
|
if (code === 42 && next === 42) {
|
|
2689
2603
|
width++;
|
|
2690
2604
|
next = this.input.charCodeAt(this.state.pos + 2);
|
|
2691
2605
|
type = 57;
|
|
2692
2606
|
}
|
|
2693
|
-
|
|
2694
2607
|
if (next === 61 && !this.state.inType) {
|
|
2695
2608
|
width++;
|
|
2696
2609
|
type = code === 37 ? 33 : 30;
|
|
@@ -2722,7 +2635,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2722
2635
|
this.finishToken(9);
|
|
2723
2636
|
return;
|
|
2724
2637
|
}
|
|
2725
|
-
|
|
2726
2638
|
if (this.hasPlugin("recordAndTuple") && next === 93) {
|
|
2727
2639
|
if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
|
|
2728
2640
|
throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, {
|
|
@@ -2742,36 +2654,29 @@ class Tokenizer extends CommentsParser {
|
|
|
2742
2654
|
}
|
|
2743
2655
|
readToken_caret() {
|
|
2744
2656
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
2745
|
-
|
|
2746
2657
|
if (next === 61 && !this.state.inType) {
|
|
2747
2658
|
this.finishOp(32, 2);
|
|
2748
|
-
}
|
|
2749
|
-
else if (next === 94 &&
|
|
2750
|
-
this.hasPlugin(["pipelineOperator", {
|
|
2659
|
+
} else if (next === 94 && this.hasPlugin(["pipelineOperator", {
|
|
2751
2660
|
proposal: "hack",
|
|
2752
2661
|
topicToken: "^^"
|
|
2753
2662
|
}])) {
|
|
2754
2663
|
this.finishOp(37, 2);
|
|
2755
|
-
|
|
2756
2664
|
const lookaheadCh = this.input.codePointAt(this.state.pos);
|
|
2757
2665
|
if (lookaheadCh === 94) {
|
|
2758
2666
|
throw this.unexpected();
|
|
2759
2667
|
}
|
|
2760
|
-
}
|
|
2761
|
-
else {
|
|
2668
|
+
} else {
|
|
2762
2669
|
this.finishOp(44, 1);
|
|
2763
2670
|
}
|
|
2764
2671
|
}
|
|
2765
2672
|
readToken_atSign() {
|
|
2766
2673
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
2767
|
-
|
|
2768
2674
|
if (next === 64 && this.hasPlugin(["pipelineOperator", {
|
|
2769
2675
|
proposal: "hack",
|
|
2770
2676
|
topicToken: "@@"
|
|
2771
2677
|
}])) {
|
|
2772
2678
|
this.finishOp(38, 2);
|
|
2773
|
-
}
|
|
2774
|
-
else {
|
|
2679
|
+
} else {
|
|
2775
2680
|
this.finishOp(26, 1);
|
|
2776
2681
|
}
|
|
2777
2682
|
}
|
|
@@ -2858,11 +2763,9 @@ class Tokenizer extends CommentsParser {
|
|
|
2858
2763
|
}
|
|
2859
2764
|
getTokenFromCode(code) {
|
|
2860
2765
|
switch (code) {
|
|
2861
|
-
|
|
2862
2766
|
case 46:
|
|
2863
2767
|
this.readToken_dot();
|
|
2864
2768
|
return;
|
|
2865
|
-
|
|
2866
2769
|
case 40:
|
|
2867
2770
|
++this.state.pos;
|
|
2868
2771
|
this.finishToken(10);
|
|
@@ -2886,7 +2789,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2886
2789
|
at: this.state.curPosition()
|
|
2887
2790
|
});
|
|
2888
2791
|
}
|
|
2889
|
-
|
|
2890
2792
|
this.state.pos += 2;
|
|
2891
2793
|
this.finishToken(2);
|
|
2892
2794
|
} else {
|
|
@@ -2905,7 +2807,6 @@ class Tokenizer extends CommentsParser {
|
|
|
2905
2807
|
at: this.state.curPosition()
|
|
2906
2808
|
});
|
|
2907
2809
|
}
|
|
2908
|
-
|
|
2909
2810
|
this.state.pos += 2;
|
|
2910
2811
|
this.finishToken(6);
|
|
2911
2812
|
} else {
|
|
@@ -2958,12 +2859,10 @@ class Tokenizer extends CommentsParser {
|
|
|
2958
2859
|
case 57:
|
|
2959
2860
|
this.readNumber(false);
|
|
2960
2861
|
return;
|
|
2961
|
-
|
|
2962
2862
|
case 34:
|
|
2963
2863
|
case 39:
|
|
2964
2864
|
this.readString(code);
|
|
2965
2865
|
return;
|
|
2966
|
-
|
|
2967
2866
|
case 47:
|
|
2968
2867
|
this.readToken_slash();
|
|
2969
2868
|
return;
|
|
@@ -3055,12 +2954,10 @@ class Tokenizer extends CommentsParser {
|
|
|
3055
2954
|
const content = this.input.slice(start, pos);
|
|
3056
2955
|
++pos;
|
|
3057
2956
|
let mods = "";
|
|
3058
|
-
const nextPos = () =>
|
|
3059
|
-
createPositionWithColumnOffset(startLoc, pos + 2 - start);
|
|
2957
|
+
const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start);
|
|
3060
2958
|
while (pos < this.length) {
|
|
3061
2959
|
const cp = this.codePointAtPos(pos);
|
|
3062
2960
|
const char = String.fromCharCode(cp);
|
|
3063
|
-
|
|
3064
2961
|
if (VALID_REGEX_FLAGS.has(cp)) {
|
|
3065
2962
|
if (cp === 118) {
|
|
3066
2963
|
this.expectPlugin("regexpUnicodeSets", nextPos());
|
|
@@ -3097,7 +2994,6 @@ class Tokenizer extends CommentsParser {
|
|
|
3097
2994
|
flags: mods
|
|
3098
2995
|
});
|
|
3099
2996
|
}
|
|
3100
|
-
|
|
3101
2997
|
readInt(radix, len, forceLen = false, allowNumSeparator = true) {
|
|
3102
2998
|
const {
|
|
3103
2999
|
n,
|
|
@@ -3138,7 +3034,6 @@ class Tokenizer extends CommentsParser {
|
|
|
3138
3034
|
}
|
|
3139
3035
|
this.finishToken(132, val);
|
|
3140
3036
|
}
|
|
3141
|
-
|
|
3142
3037
|
readNumber(startsWithDot) {
|
|
3143
3038
|
const start = this.state.pos;
|
|
3144
3039
|
const startLoc = this.state.curPosition();
|
|
@@ -3213,7 +3108,6 @@ class Tokenizer extends CommentsParser {
|
|
|
3213
3108
|
at: this.state.curPosition()
|
|
3214
3109
|
});
|
|
3215
3110
|
}
|
|
3216
|
-
|
|
3217
3111
|
const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
|
|
3218
3112
|
if (isBigInt) {
|
|
3219
3113
|
this.finishToken(133, str);
|
|
@@ -3226,7 +3120,6 @@ class Tokenizer extends CommentsParser {
|
|
|
3226
3120
|
const val = isOctal ? parseInt(str, 8) : parseFloat(str);
|
|
3227
3121
|
this.finishToken(132, val);
|
|
3228
3122
|
}
|
|
3229
|
-
|
|
3230
3123
|
readCodePoint(throwOnInvalid) {
|
|
3231
3124
|
const {
|
|
3232
3125
|
code,
|
|
@@ -3241,14 +3134,12 @@ class Tokenizer extends CommentsParser {
|
|
|
3241
3134
|
pos,
|
|
3242
3135
|
curLine,
|
|
3243
3136
|
lineStart
|
|
3244
|
-
} = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1,
|
|
3245
|
-
this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);
|
|
3137
|
+
} = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);
|
|
3246
3138
|
this.state.pos = pos + 1;
|
|
3247
3139
|
this.state.lineStart = lineStart;
|
|
3248
3140
|
this.state.curLine = curLine;
|
|
3249
3141
|
this.finishToken(131, str);
|
|
3250
3142
|
}
|
|
3251
|
-
|
|
3252
3143
|
readTemplateContinuation() {
|
|
3253
3144
|
if (!this.match(8)) {
|
|
3254
3145
|
this.unexpected(null, 8);
|
|
@@ -3256,7 +3147,6 @@ class Tokenizer extends CommentsParser {
|
|
|
3256
3147
|
this.state.pos--;
|
|
3257
3148
|
this.readTemplateToken();
|
|
3258
3149
|
}
|
|
3259
|
-
|
|
3260
3150
|
readTemplateToken() {
|
|
3261
3151
|
const opening = this.input[this.state.pos];
|
|
3262
3152
|
const {
|
|
@@ -3265,8 +3155,7 @@ class Tokenizer extends CommentsParser {
|
|
|
3265
3155
|
pos,
|
|
3266
3156
|
curLine,
|
|
3267
3157
|
lineStart
|
|
3268
|
-
} = readStringContents("template", this.input, this.state.pos + 1,
|
|
3269
|
-
this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);
|
|
3158
|
+
} = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);
|
|
3270
3159
|
this.state.pos = pos + 1;
|
|
3271
3160
|
this.state.lineStart = lineStart;
|
|
3272
3161
|
this.state.curLine = curLine;
|
|
@@ -3292,7 +3181,6 @@ class Tokenizer extends CommentsParser {
|
|
|
3292
3181
|
this.state.strictErrors.set(index, [toParseError, at]);
|
|
3293
3182
|
}
|
|
3294
3183
|
}
|
|
3295
|
-
|
|
3296
3184
|
readWord1(firstCode) {
|
|
3297
3185
|
this.state.containsEsc = false;
|
|
3298
3186
|
let word = "";
|
|
@@ -3334,7 +3222,6 @@ class Tokenizer extends CommentsParser {
|
|
|
3334
3222
|
}
|
|
3335
3223
|
return word + this.input.slice(chunkStart, this.state.pos);
|
|
3336
3224
|
}
|
|
3337
|
-
|
|
3338
3225
|
readWord(firstCode) {
|
|
3339
3226
|
const word = this.readWord1(firstCode);
|
|
3340
3227
|
const type = keywords$1.get(word);
|
|
@@ -3355,7 +3242,6 @@ class Tokenizer extends CommentsParser {
|
|
|
3355
3242
|
});
|
|
3356
3243
|
}
|
|
3357
3244
|
}
|
|
3358
|
-
|
|
3359
3245
|
raise(toParseError, raiseProperties) {
|
|
3360
3246
|
const {
|
|
3361
3247
|
at
|
|
@@ -3370,7 +3256,6 @@ class Tokenizer extends CommentsParser {
|
|
|
3370
3256
|
if (!this.isLookahead) this.state.errors.push(error);
|
|
3371
3257
|
return error;
|
|
3372
3258
|
}
|
|
3373
|
-
|
|
3374
3259
|
raiseOverwrite(toParseError, raiseProperties) {
|
|
3375
3260
|
const {
|
|
3376
3261
|
at
|
|
@@ -3391,9 +3276,7 @@ class Tokenizer extends CommentsParser {
|
|
|
3391
3276
|
}
|
|
3392
3277
|
return this.raise(toParseError, raiseProperties);
|
|
3393
3278
|
}
|
|
3394
|
-
|
|
3395
3279
|
updateContext(prevType) {}
|
|
3396
|
-
|
|
3397
3280
|
unexpected(loc, type) {
|
|
3398
3281
|
throw this.raise(Errors.UnexpectedToken, {
|
|
3399
3282
|
expected: type ? tokenLabelName(type) : null,
|
|
@@ -3448,9 +3331,7 @@ class ClassScopeHandler {
|
|
|
3448
3331
|
}
|
|
3449
3332
|
exit() {
|
|
3450
3333
|
const oldClassScope = this.stack.pop();
|
|
3451
|
-
|
|
3452
3334
|
const current = this.current();
|
|
3453
|
-
|
|
3454
3335
|
for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {
|
|
3455
3336
|
if (current) {
|
|
3456
3337
|
if (!current.undefinedPrivateNames.has(name)) {
|
|
@@ -3478,7 +3359,6 @@ class ClassScopeHandler {
|
|
|
3478
3359
|
const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
|
|
3479
3360
|
const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;
|
|
3480
3361
|
const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
|
|
3481
|
-
|
|
3482
3362
|
redefined = oldKind === newKind || oldStatic !== newStatic;
|
|
3483
3363
|
if (!redefined) loneAccessors.delete(name);
|
|
3484
3364
|
} else if (!redefined) {
|
|
@@ -3556,7 +3436,6 @@ class ExpressionScopeHandler {
|
|
|
3556
3436
|
exit() {
|
|
3557
3437
|
this.stack.pop();
|
|
3558
3438
|
}
|
|
3559
|
-
|
|
3560
3439
|
recordParameterInitializerError(toParseError, {
|
|
3561
3440
|
at: node
|
|
3562
3441
|
}) {
|
|
@@ -3578,8 +3457,7 @@ class ExpressionScopeHandler {
|
|
|
3578
3457
|
}
|
|
3579
3458
|
this.parser.raise(toParseError, origin);
|
|
3580
3459
|
}
|
|
3581
|
-
|
|
3582
|
-
recordArrowParemeterBindingError(error, {
|
|
3460
|
+
recordArrowParameterBindingError(error, {
|
|
3583
3461
|
at: node
|
|
3584
3462
|
}) {
|
|
3585
3463
|
const {
|
|
@@ -3597,7 +3475,6 @@ class ExpressionScopeHandler {
|
|
|
3597
3475
|
return;
|
|
3598
3476
|
}
|
|
3599
3477
|
}
|
|
3600
|
-
|
|
3601
3478
|
recordAsyncArrowParametersError({
|
|
3602
3479
|
at
|
|
3603
3480
|
}) {
|
|
@@ -3647,13 +3524,11 @@ function newExpressionScope() {
|
|
|
3647
3524
|
return new ExpressionScope();
|
|
3648
3525
|
}
|
|
3649
3526
|
|
|
3650
|
-
const
|
|
3651
|
-
PARAM = 0b0000,
|
|
3527
|
+
const PARAM = 0b0000,
|
|
3652
3528
|
PARAM_YIELD = 0b0001,
|
|
3653
3529
|
PARAM_AWAIT = 0b0010,
|
|
3654
3530
|
PARAM_RETURN = 0b0100,
|
|
3655
3531
|
PARAM_IN = 0b1000;
|
|
3656
|
-
|
|
3657
3532
|
class ProductionParameterHandler {
|
|
3658
3533
|
constructor() {
|
|
3659
3534
|
this.stacks = [];
|
|
@@ -3685,7 +3560,6 @@ function functionFlags(isAsync, isGenerator) {
|
|
|
3685
3560
|
}
|
|
3686
3561
|
|
|
3687
3562
|
class UtilParser extends Tokenizer {
|
|
3688
|
-
|
|
3689
3563
|
addExtra(node, key, value, enumerable = true) {
|
|
3690
3564
|
if (!node) return;
|
|
3691
3565
|
const extra = node.extra = node.extra || {};
|
|
@@ -3698,7 +3572,6 @@ class UtilParser extends Tokenizer {
|
|
|
3698
3572
|
});
|
|
3699
3573
|
}
|
|
3700
3574
|
}
|
|
3701
|
-
|
|
3702
3575
|
isContextual(token) {
|
|
3703
3576
|
return this.state.type === token && !this.state.containsEsc;
|
|
3704
3577
|
}
|
|
@@ -3706,8 +3579,7 @@ class UtilParser extends Tokenizer {
|
|
|
3706
3579
|
const nameEnd = nameStart + name.length;
|
|
3707
3580
|
if (this.input.slice(nameStart, nameEnd) === name) {
|
|
3708
3581
|
const nextCh = this.input.charCodeAt(nameEnd);
|
|
3709
|
-
return !(isIdentifierChar(nextCh) ||
|
|
3710
|
-
(nextCh & 0xfc00) === 0xd800);
|
|
3582
|
+
return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800);
|
|
3711
3583
|
}
|
|
3712
3584
|
return false;
|
|
3713
3585
|
}
|
|
@@ -3715,7 +3587,6 @@ class UtilParser extends Tokenizer {
|
|
|
3715
3587
|
const next = this.nextTokenStart();
|
|
3716
3588
|
return this.isUnparsedContextual(next, name);
|
|
3717
3589
|
}
|
|
3718
|
-
|
|
3719
3590
|
eatContextual(token) {
|
|
3720
3591
|
if (this.isContextual(token)) {
|
|
3721
3592
|
this.next();
|
|
@@ -3723,7 +3594,6 @@ class UtilParser extends Tokenizer {
|
|
|
3723
3594
|
}
|
|
3724
3595
|
return false;
|
|
3725
3596
|
}
|
|
3726
|
-
|
|
3727
3597
|
expectContextual(token, toParseError) {
|
|
3728
3598
|
if (!this.eatContextual(token)) {
|
|
3729
3599
|
if (toParseError != null) {
|
|
@@ -3734,7 +3604,6 @@ class UtilParser extends Tokenizer {
|
|
|
3734
3604
|
throw this.unexpected(null, token);
|
|
3735
3605
|
}
|
|
3736
3606
|
}
|
|
3737
|
-
|
|
3738
3607
|
canInsertSemicolon() {
|
|
3739
3608
|
return this.match(137) || this.match(8) || this.hasPrecedingLineBreak();
|
|
3740
3609
|
}
|
|
@@ -3745,22 +3614,18 @@ class UtilParser extends Tokenizer {
|
|
|
3745
3614
|
skipWhiteSpaceToLineBreak.lastIndex = this.state.end;
|
|
3746
3615
|
return skipWhiteSpaceToLineBreak.test(this.input);
|
|
3747
3616
|
}
|
|
3748
|
-
|
|
3749
3617
|
isLineTerminator() {
|
|
3750
3618
|
return this.eat(13) || this.canInsertSemicolon();
|
|
3751
3619
|
}
|
|
3752
|
-
|
|
3753
3620
|
semicolon(allowAsi = true) {
|
|
3754
3621
|
if (allowAsi ? this.isLineTerminator() : this.eat(13)) return;
|
|
3755
3622
|
this.raise(Errors.MissingSemicolon, {
|
|
3756
3623
|
at: this.state.lastTokEndLoc
|
|
3757
3624
|
});
|
|
3758
3625
|
}
|
|
3759
|
-
|
|
3760
3626
|
expect(type, loc) {
|
|
3761
3627
|
this.eat(type) || this.unexpected(loc, type);
|
|
3762
3628
|
}
|
|
3763
|
-
|
|
3764
3629
|
tryParse(fn, oldState = this.state.clone()) {
|
|
3765
3630
|
const abortSignal = {
|
|
3766
3631
|
node: null
|
|
@@ -3844,19 +3709,15 @@ class UtilParser extends Tokenizer {
|
|
|
3844
3709
|
this.unexpected(optionalParametersLoc);
|
|
3845
3710
|
}
|
|
3846
3711
|
}
|
|
3847
|
-
|
|
3848
3712
|
isLiteralPropertyName() {
|
|
3849
3713
|
return tokenIsLiteralPropertyName(this.state.type);
|
|
3850
3714
|
}
|
|
3851
|
-
|
|
3852
3715
|
isPrivateName(node) {
|
|
3853
3716
|
return node.type === "PrivateName";
|
|
3854
3717
|
}
|
|
3855
|
-
|
|
3856
3718
|
getPrivateNameSV(node) {
|
|
3857
3719
|
return node.id.name;
|
|
3858
3720
|
}
|
|
3859
|
-
|
|
3860
3721
|
hasPropertyAsPrivateName(node) {
|
|
3861
3722
|
return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property);
|
|
3862
3723
|
}
|
|
@@ -3874,7 +3735,6 @@ class UtilParser extends Tokenizer {
|
|
|
3874
3735
|
this.state.labels = [];
|
|
3875
3736
|
const oldExportedIdentifiers = this.exportedIdentifiers;
|
|
3876
3737
|
this.exportedIdentifiers = new Set();
|
|
3877
|
-
|
|
3878
3738
|
const oldInModule = this.inModule;
|
|
3879
3739
|
this.inModule = inModule;
|
|
3880
3740
|
const oldScope = this.scope;
|
|
@@ -3889,7 +3749,6 @@ class UtilParser extends Tokenizer {
|
|
|
3889
3749
|
return () => {
|
|
3890
3750
|
this.state.labels = oldLabels;
|
|
3891
3751
|
this.exportedIdentifiers = oldExportedIdentifiers;
|
|
3892
|
-
|
|
3893
3752
|
this.inModule = oldInModule;
|
|
3894
3753
|
this.scope = oldScope;
|
|
3895
3754
|
this.prodParam = oldProdParam;
|
|
@@ -3914,7 +3773,6 @@ class UtilParser extends Tokenizer {
|
|
|
3914
3773
|
}
|
|
3915
3774
|
}
|
|
3916
3775
|
}
|
|
3917
|
-
|
|
3918
3776
|
class ExpressionErrors {
|
|
3919
3777
|
constructor() {
|
|
3920
3778
|
this.shorthandAssignLoc = null;
|
|
@@ -4007,15 +3865,12 @@ class NodeUtils extends UtilParser {
|
|
|
4007
3865
|
startNodeAt(loc) {
|
|
4008
3866
|
return new Node(this, loc.index, loc);
|
|
4009
3867
|
}
|
|
4010
|
-
|
|
4011
3868
|
startNodeAtNode(type) {
|
|
4012
3869
|
return this.startNodeAt(type.loc.start);
|
|
4013
3870
|
}
|
|
4014
|
-
|
|
4015
3871
|
finishNode(node, type) {
|
|
4016
3872
|
return this.finishNodeAt(node, type, this.state.lastTokEndLoc);
|
|
4017
3873
|
}
|
|
4018
|
-
|
|
4019
3874
|
finishNodeAt(node, type, endLoc) {
|
|
4020
3875
|
node.type = type;
|
|
4021
3876
|
node.end = endLoc.index;
|
|
@@ -4034,14 +3889,12 @@ class NodeUtils extends UtilParser {
|
|
|
4034
3889
|
node.loc.end = endLoc;
|
|
4035
3890
|
if (this.options.ranges) node.range[1] = endLoc.index;
|
|
4036
3891
|
}
|
|
4037
|
-
|
|
4038
3892
|
resetStartLocationFromNode(node, locationNode) {
|
|
4039
3893
|
this.resetStartLocation(node, locationNode.loc.start);
|
|
4040
3894
|
}
|
|
4041
3895
|
}
|
|
4042
3896
|
|
|
4043
3897
|
const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
|
|
4044
|
-
|
|
4045
3898
|
const FlowErrors = ParseErrorEnum`flow`({
|
|
4046
3899
|
AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
|
|
4047
3900
|
AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",
|
|
@@ -4135,7 +3988,6 @@ const FlowErrors = ParseErrorEnum`flow`({
|
|
|
4135
3988
|
UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.",
|
|
4136
3989
|
UnterminatedFlowComment: "Unterminated flow-comment."
|
|
4137
3990
|
});
|
|
4138
|
-
|
|
4139
3991
|
function isEsModuleType(bodyElement) {
|
|
4140
3992
|
return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration");
|
|
4141
3993
|
}
|
|
@@ -4151,7 +4003,6 @@ const exportSuggestions = {
|
|
|
4151
4003
|
type: "export type",
|
|
4152
4004
|
interface: "export interface"
|
|
4153
4005
|
};
|
|
4154
|
-
|
|
4155
4006
|
function partition(list, test) {
|
|
4156
4007
|
const list1 = [];
|
|
4157
4008
|
const list2 = [];
|
|
@@ -4161,7 +4012,6 @@ function partition(list, test) {
|
|
|
4161
4012
|
return [list1, list2];
|
|
4162
4013
|
}
|
|
4163
4014
|
const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
|
|
4164
|
-
|
|
4165
4015
|
var flow = (superClass => class FlowParserMixin extends superClass {
|
|
4166
4016
|
constructor(...args) {
|
|
4167
4017
|
super(...args);
|
|
@@ -4384,18 +4234,11 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
4384
4234
|
suggestion: exportSuggestions[label]
|
|
4385
4235
|
});
|
|
4386
4236
|
}
|
|
4387
|
-
if (this.match(74) ||
|
|
4388
|
-
this.match(68) ||
|
|
4389
|
-
this.match(80) ||
|
|
4390
|
-
this.isContextual(129)) {
|
|
4237
|
+
if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(129)) {
|
|
4391
4238
|
node.declaration = this.flowParseDeclare(this.startNode());
|
|
4392
4239
|
node.default = false;
|
|
4393
4240
|
return this.finishNode(node, "DeclareExportDeclaration");
|
|
4394
|
-
} else if (this.match(55) ||
|
|
4395
|
-
this.match(5) ||
|
|
4396
|
-
this.isContextual(127) ||
|
|
4397
|
-
this.isContextual(128) ||
|
|
4398
|
-
this.isContextual(129)) {
|
|
4241
|
+
} else if (this.match(55) || this.match(5) || this.isContextual(127) || this.isContextual(128) || this.isContextual(129)) {
|
|
4399
4242
|
node = this.parseExport(node, null);
|
|
4400
4243
|
if (node.type === "ExportNamedDeclaration") {
|
|
4401
4244
|
node.type = "ExportDeclaration";
|
|
@@ -4432,7 +4275,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
4432
4275
|
this.flowParseInterfaceish(node);
|
|
4433
4276
|
return this.finishNode(node, "DeclareInterface");
|
|
4434
4277
|
}
|
|
4435
|
-
|
|
4436
4278
|
flowParseInterfaceish(node, isClass = false) {
|
|
4437
4279
|
node.id = this.flowParseRestrictedIdentifier(!isClass, true);
|
|
4438
4280
|
this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.loc.start);
|
|
@@ -4501,7 +4343,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
4501
4343
|
this.checkReservedType(this.state.value, this.state.startLoc, declaration);
|
|
4502
4344
|
return this.parseIdentifier(liberal);
|
|
4503
4345
|
}
|
|
4504
|
-
|
|
4505
4346
|
flowParseTypeAlias(node) {
|
|
4506
4347
|
node.id = this.flowParseRestrictedIdentifier(false, true);
|
|
4507
4348
|
this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.loc.start);
|
|
@@ -4523,7 +4364,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
4523
4364
|
} else {
|
|
4524
4365
|
node.typeParameters = null;
|
|
4525
4366
|
}
|
|
4526
|
-
|
|
4527
4367
|
node.supertype = null;
|
|
4528
4368
|
if (this.match(14)) {
|
|
4529
4369
|
node.supertype = this.flowParseTypeInitialiser(14);
|
|
@@ -4535,7 +4375,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
4535
4375
|
this.semicolon();
|
|
4536
4376
|
return this.finishNode(node, "OpaqueType");
|
|
4537
4377
|
}
|
|
4538
|
-
|
|
4539
4378
|
flowParseTypeParameter(requireDefault = false) {
|
|
4540
4379
|
const nodeStartLoc = this.state.startLoc;
|
|
4541
4380
|
const node = this.startNode();
|
|
@@ -4561,7 +4400,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
4561
4400
|
const node = this.startNode();
|
|
4562
4401
|
node.params = [];
|
|
4563
4402
|
this.state.inType = true;
|
|
4564
|
-
|
|
4565
4403
|
if (this.match(47) || this.match(140)) {
|
|
4566
4404
|
this.next();
|
|
4567
4405
|
} else {
|
|
@@ -4640,7 +4478,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
4640
4478
|
}
|
|
4641
4479
|
flowParseObjectTypeIndexer(node, isStatic, variance) {
|
|
4642
4480
|
node.static = isStatic;
|
|
4643
|
-
|
|
4644
4481
|
if (this.lookahead().type === 14) {
|
|
4645
4482
|
node.id = this.flowParseObjectPropertyKey();
|
|
4646
4483
|
node.key = this.flowParseTypeInitialiser();
|
|
@@ -4748,7 +4585,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
4748
4585
|
}
|
|
4749
4586
|
if (allowStatic && this.isContextual(104)) {
|
|
4750
4587
|
const lookahead = this.lookahead();
|
|
4751
|
-
|
|
4752
4588
|
if (lookahead.type !== 14 && lookahead.type !== 17) {
|
|
4753
4589
|
this.next();
|
|
4754
4590
|
isStatic = true;
|
|
@@ -4800,7 +4636,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
4800
4636
|
}
|
|
4801
4637
|
}
|
|
4802
4638
|
this.expect(endDelim);
|
|
4803
|
-
|
|
4804
4639
|
if (allowSpread) {
|
|
4805
4640
|
nodeStart.inexact = inexact;
|
|
4806
4641
|
}
|
|
@@ -4879,7 +4714,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
4879
4714
|
return this.finishNode(node, "ObjectTypeProperty");
|
|
4880
4715
|
}
|
|
4881
4716
|
}
|
|
4882
|
-
|
|
4883
4717
|
flowCheckGetterSetterParams(property) {
|
|
4884
4718
|
const paramCount = property.kind === "get" ? 0 : 1;
|
|
4885
4719
|
const length = property.value.params.length + (property.value.rest ? 1 : 0);
|
|
@@ -5028,7 +4862,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5028
4862
|
return this.flowParseGenericType(startLoc, id);
|
|
5029
4863
|
}
|
|
5030
4864
|
}
|
|
5031
|
-
|
|
5032
4865
|
flowParsePrimaryType() {
|
|
5033
4866
|
const startLoc = this.state.startLoc;
|
|
5034
4867
|
const node = this.startNode();
|
|
@@ -5071,7 +4904,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5071
4904
|
return this.finishNode(node, "FunctionTypeAnnotation");
|
|
5072
4905
|
case 10:
|
|
5073
4906
|
this.next();
|
|
5074
|
-
|
|
5075
4907
|
if (!this.match(11) && !this.match(21)) {
|
|
5076
4908
|
if (tokenIsIdentifier(this.state.type) || this.match(78)) {
|
|
5077
4909
|
const token = this.lookahead().type;
|
|
@@ -5084,7 +4916,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5084
4916
|
this.state.noAnonFunctionType = false;
|
|
5085
4917
|
type = this.flowParseType();
|
|
5086
4918
|
this.state.noAnonFunctionType = oldNoAnonFunctionType;
|
|
5087
|
-
|
|
5088
4919
|
if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) {
|
|
5089
4920
|
this.expect(11);
|
|
5090
4921
|
return type;
|
|
@@ -5177,11 +5008,9 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5177
5008
|
this.expect(3);
|
|
5178
5009
|
if (seenOptionalIndexedAccess) {
|
|
5179
5010
|
node.optional = optional;
|
|
5180
|
-
type = this.finishNode(
|
|
5181
|
-
node, "OptionalIndexedAccessType");
|
|
5011
|
+
type = this.finishNode(node, "OptionalIndexedAccessType");
|
|
5182
5012
|
} else {
|
|
5183
|
-
type = this.finishNode(
|
|
5184
|
-
node, "IndexedAccessType");
|
|
5013
|
+
type = this.finishNode(node, "IndexedAccessType");
|
|
5185
5014
|
}
|
|
5186
5015
|
}
|
|
5187
5016
|
}
|
|
@@ -5277,7 +5106,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5277
5106
|
}
|
|
5278
5107
|
return variance;
|
|
5279
5108
|
}
|
|
5280
|
-
|
|
5281
5109
|
parseFunctionBody(node, allowExpressionBody, isMethod = false) {
|
|
5282
5110
|
if (allowExpressionBody) {
|
|
5283
5111
|
return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));
|
|
@@ -5287,13 +5115,11 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5287
5115
|
parseFunctionBodyAndFinish(node, type, isMethod = false) {
|
|
5288
5116
|
if (this.match(14)) {
|
|
5289
5117
|
const typeNode = this.startNode();
|
|
5290
|
-
[typeNode.typeAnnotation,
|
|
5291
|
-
node.predicate] = this.flowParseTypeAndPredicateInitialiser();
|
|
5118
|
+
[typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
|
|
5292
5119
|
node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
|
|
5293
5120
|
}
|
|
5294
5121
|
return super.parseFunctionBodyAndFinish(node, type, isMethod);
|
|
5295
5122
|
}
|
|
5296
|
-
|
|
5297
5123
|
parseStatementLike(flags) {
|
|
5298
5124
|
if (this.state.strict && this.isContextual(127)) {
|
|
5299
5125
|
const lookahead = this.lookahead();
|
|
@@ -5313,7 +5139,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5313
5139
|
}
|
|
5314
5140
|
return stmt;
|
|
5315
5141
|
}
|
|
5316
|
-
|
|
5317
5142
|
parseExpressionStatement(node, expr, decorators) {
|
|
5318
5143
|
if (expr.type === "Identifier") {
|
|
5319
5144
|
if (expr.name === "declare") {
|
|
@@ -5332,7 +5157,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5332
5157
|
}
|
|
5333
5158
|
return super.parseExpressionStatement(node, expr, decorators);
|
|
5334
5159
|
}
|
|
5335
|
-
|
|
5336
5160
|
shouldParseExportDeclaration() {
|
|
5337
5161
|
const {
|
|
5338
5162
|
type
|
|
@@ -5363,10 +5187,7 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5363
5187
|
if (!this.match(17)) return expr;
|
|
5364
5188
|
if (this.state.maybeInArrowParameters) {
|
|
5365
5189
|
const nextCh = this.lookaheadCharCode();
|
|
5366
|
-
if (nextCh === 44 ||
|
|
5367
|
-
nextCh === 61 ||
|
|
5368
|
-
nextCh === 58 ||
|
|
5369
|
-
nextCh === 41) {
|
|
5190
|
+
if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) {
|
|
5370
5191
|
this.setOptionalParametersError(refExpressionErrors);
|
|
5371
5192
|
return expr;
|
|
5372
5193
|
}
|
|
@@ -5427,7 +5248,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5427
5248
|
failed
|
|
5428
5249
|
};
|
|
5429
5250
|
}
|
|
5430
|
-
|
|
5431
5251
|
getArrowLikeExpressions(node, disallowInvalid) {
|
|
5432
5252
|
const stack = [node];
|
|
5433
5253
|
const arrows = [];
|
|
@@ -5453,8 +5273,7 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5453
5273
|
}
|
|
5454
5274
|
finishArrowValidation(node) {
|
|
5455
5275
|
var _node$extra;
|
|
5456
|
-
this.toAssignableList(
|
|
5457
|
-
node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false);
|
|
5276
|
+
this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false);
|
|
5458
5277
|
this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
|
|
5459
5278
|
super.checkParams(node, false, true);
|
|
5460
5279
|
this.scope.exit();
|
|
@@ -5583,7 +5402,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5583
5402
|
readIterator() {
|
|
5584
5403
|
const word = super.readWord1();
|
|
5585
5404
|
const fullWord = "@@" + word;
|
|
5586
|
-
|
|
5587
5405
|
if (!this.isIterator(word) || !this.state.inType) {
|
|
5588
5406
|
this.raise(Errors.InvalidIdentifier, {
|
|
5589
5407
|
at: this.state.curPosition(),
|
|
@@ -5592,7 +5410,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5592
5410
|
}
|
|
5593
5411
|
this.finishToken(130, fullWord);
|
|
5594
5412
|
}
|
|
5595
|
-
|
|
5596
5413
|
getTokenFromCode(code) {
|
|
5597
5414
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
5598
5415
|
if (code === 123 && next === 124) {
|
|
@@ -5624,7 +5441,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5624
5441
|
}
|
|
5625
5442
|
super.toAssignable(node, isLHS);
|
|
5626
5443
|
}
|
|
5627
|
-
|
|
5628
5444
|
toAssignableList(exprList, trailingCommaLoc, isLHS) {
|
|
5629
5445
|
for (let i = 0; i < exprList.length; i++) {
|
|
5630
5446
|
const expr = exprList[i];
|
|
@@ -5634,7 +5450,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5634
5450
|
}
|
|
5635
5451
|
super.toAssignableList(exprList, trailingCommaLoc, isLHS);
|
|
5636
5452
|
}
|
|
5637
|
-
|
|
5638
5453
|
toReferencedList(exprList, isParenthesizedExpr) {
|
|
5639
5454
|
for (let i = 0; i < exprList.length; i++) {
|
|
5640
5455
|
var _expr$extra;
|
|
@@ -5649,7 +5464,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5649
5464
|
}
|
|
5650
5465
|
parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
|
|
5651
5466
|
const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors);
|
|
5652
|
-
|
|
5653
5467
|
if (canBePattern && !this.state.maybeInArrowParameters) {
|
|
5654
5468
|
this.toReferencedList(node.elements);
|
|
5655
5469
|
}
|
|
@@ -5658,7 +5472,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5658
5472
|
isValidLVal(type, isParenthesized, binding) {
|
|
5659
5473
|
return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding);
|
|
5660
5474
|
}
|
|
5661
|
-
|
|
5662
5475
|
parseClassProperty(node) {
|
|
5663
5476
|
if (this.match(14)) {
|
|
5664
5477
|
node.typeAnnotation = this.flowParseTypeAnnotation();
|
|
@@ -5671,18 +5484,15 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5671
5484
|
}
|
|
5672
5485
|
return super.parseClassPrivateProperty(node);
|
|
5673
5486
|
}
|
|
5674
|
-
|
|
5675
5487
|
isClassMethod() {
|
|
5676
5488
|
return this.match(47) || super.isClassMethod();
|
|
5677
5489
|
}
|
|
5678
|
-
|
|
5679
5490
|
isClassProperty() {
|
|
5680
5491
|
return this.match(14) || super.isClassProperty();
|
|
5681
5492
|
}
|
|
5682
5493
|
isNonstaticConstructor(method) {
|
|
5683
5494
|
return !this.match(14) && super.isNonstaticConstructor(method);
|
|
5684
5495
|
}
|
|
5685
|
-
|
|
5686
5496
|
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
5687
5497
|
if (method.variance) {
|
|
5688
5498
|
this.unexpected(method.variance.loc.start);
|
|
@@ -5699,9 +5509,7 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5699
5509
|
at: method
|
|
5700
5510
|
});
|
|
5701
5511
|
}
|
|
5702
|
-
} else if (
|
|
5703
|
-
method.type === "MethodDefinition" && isConstructor &&
|
|
5704
|
-
method.value.params) {
|
|
5512
|
+
} else if (method.type === "MethodDefinition" && isConstructor && method.value.params) {
|
|
5705
5513
|
const params = method.value.params;
|
|
5706
5514
|
if (params.length > 0 && this.isThisParam(params[0])) {
|
|
5707
5515
|
this.raise(FlowErrors.ThisParamBannedInConstructor, {
|
|
@@ -5720,7 +5528,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5720
5528
|
}
|
|
5721
5529
|
super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
|
|
5722
5530
|
}
|
|
5723
|
-
|
|
5724
5531
|
parseClassSuper(node) {
|
|
5725
5532
|
super.parseClassSuper(node);
|
|
5726
5533
|
if (node.superClass && this.match(47)) {
|
|
@@ -5760,20 +5567,17 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5760
5567
|
parsePropertyNamePrefixOperator(node) {
|
|
5761
5568
|
node.variance = this.flowParseVariance();
|
|
5762
5569
|
}
|
|
5763
|
-
|
|
5764
5570
|
parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
|
|
5765
5571
|
if (prop.variance) {
|
|
5766
5572
|
this.unexpected(prop.variance.loc.start);
|
|
5767
5573
|
}
|
|
5768
5574
|
delete prop.variance;
|
|
5769
5575
|
let typeParameters;
|
|
5770
|
-
|
|
5771
5576
|
if (this.match(47) && !isAccessor) {
|
|
5772
5577
|
typeParameters = this.flowParseTypeParameterDeclaration();
|
|
5773
5578
|
if (!this.match(10)) this.unexpected();
|
|
5774
5579
|
}
|
|
5775
5580
|
const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors);
|
|
5776
|
-
|
|
5777
5581
|
if (typeParameters) {
|
|
5778
5582
|
(result.value || result).typeParameters = typeParameters;
|
|
5779
5583
|
}
|
|
@@ -5835,7 +5639,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5835
5639
|
specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();
|
|
5836
5640
|
node.specifiers.push(this.finishImportSpecifier(specifier, type));
|
|
5837
5641
|
}
|
|
5838
|
-
|
|
5839
5642
|
maybeParseDefaultImportSpecifier(node) {
|
|
5840
5643
|
node.importKind = "value";
|
|
5841
5644
|
let kind = null;
|
|
@@ -5849,7 +5652,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5849
5652
|
const {
|
|
5850
5653
|
type
|
|
5851
5654
|
} = lh;
|
|
5852
|
-
|
|
5853
5655
|
if (kind === "type" && type === 55) {
|
|
5854
5656
|
this.unexpected(null, lh.type);
|
|
5855
5657
|
}
|
|
@@ -5860,10 +5662,7 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5860
5662
|
}
|
|
5861
5663
|
return super.maybeParseDefaultImportSpecifier(node);
|
|
5862
5664
|
}
|
|
5863
|
-
|
|
5864
|
-
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport,
|
|
5865
|
-
isMaybeTypeOnly,
|
|
5866
|
-
bindingType) {
|
|
5665
|
+
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
|
|
5867
5666
|
const firstIdent = specifier.imported;
|
|
5868
5667
|
let specifierTypeKind = null;
|
|
5869
5668
|
if (firstIdent.type === "Identifier") {
|
|
@@ -5928,7 +5727,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5928
5727
|
return super.parseBindingAtom();
|
|
5929
5728
|
}
|
|
5930
5729
|
}
|
|
5931
|
-
|
|
5932
5730
|
parseFunctionParams(node, allowModifiers) {
|
|
5933
5731
|
const kind = node.kind;
|
|
5934
5732
|
if (kind !== "get" && kind !== "set" && this.match(47)) {
|
|
@@ -5936,7 +5734,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5936
5734
|
}
|
|
5937
5735
|
super.parseFunctionParams(node, allowModifiers);
|
|
5938
5736
|
}
|
|
5939
|
-
|
|
5940
5737
|
parseVarId(decl, kind) {
|
|
5941
5738
|
super.parseVarId(decl, kind);
|
|
5942
5739
|
if (this.match(14)) {
|
|
@@ -5944,7 +5741,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5944
5741
|
this.resetEndLocation(decl.id);
|
|
5945
5742
|
}
|
|
5946
5743
|
}
|
|
5947
|
-
|
|
5948
5744
|
parseAsyncArrowFromCallExpression(node, call) {
|
|
5949
5745
|
if (this.match(14)) {
|
|
5950
5746
|
const oldNoAnonFunctionType = this.state.noAnonFunctionType;
|
|
@@ -5954,11 +5750,9 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5954
5750
|
}
|
|
5955
5751
|
return super.parseAsyncArrowFromCallExpression(node, call);
|
|
5956
5752
|
}
|
|
5957
|
-
|
|
5958
5753
|
shouldParseAsyncArrow() {
|
|
5959
5754
|
return this.match(14) || super.shouldParseAsyncArrow();
|
|
5960
5755
|
}
|
|
5961
|
-
|
|
5962
5756
|
parseMaybeAssign(refExpressionErrors, afterLeftParse) {
|
|
5963
5757
|
var _jsx;
|
|
5964
5758
|
let state = null;
|
|
@@ -5966,9 +5760,7 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5966
5760
|
if (this.hasPlugin("jsx") && (this.match(140) || this.match(47))) {
|
|
5967
5761
|
state = this.state.clone();
|
|
5968
5762
|
jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
|
|
5969
|
-
|
|
5970
5763
|
if (!jsx.error) return jsx.node;
|
|
5971
|
-
|
|
5972
5764
|
const {
|
|
5973
5765
|
context
|
|
5974
5766
|
} = this.state;
|
|
@@ -5989,9 +5781,7 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5989
5781
|
this.resetStartLocationFromNode(result, typeParameters);
|
|
5990
5782
|
return result;
|
|
5991
5783
|
});
|
|
5992
|
-
|
|
5993
5784
|
if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort();
|
|
5994
|
-
|
|
5995
5785
|
const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);
|
|
5996
5786
|
if (expr.type !== "ArrowFunctionExpression") abort();
|
|
5997
5787
|
expr.typeParameters = typeParameters;
|
|
@@ -5999,8 +5789,7 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
5999
5789
|
return arrowExpression;
|
|
6000
5790
|
}, state);
|
|
6001
5791
|
let arrowExpression = null;
|
|
6002
|
-
if (arrow.node &&
|
|
6003
|
-
this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") {
|
|
5792
|
+
if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") {
|
|
6004
5793
|
if (!arrow.error && !arrow.aborted) {
|
|
6005
5794
|
if (arrow.node.async) {
|
|
6006
5795
|
this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, {
|
|
@@ -6009,10 +5798,8 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
6009
5798
|
}
|
|
6010
5799
|
return arrow.node;
|
|
6011
5800
|
}
|
|
6012
|
-
|
|
6013
5801
|
arrowExpression = arrow.node;
|
|
6014
5802
|
}
|
|
6015
|
-
|
|
6016
5803
|
if ((_jsx2 = jsx) != null && _jsx2.node) {
|
|
6017
5804
|
this.state = jsx.failState;
|
|
6018
5805
|
return jsx.node;
|
|
@@ -6023,31 +5810,26 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
6023
5810
|
}
|
|
6024
5811
|
if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error;
|
|
6025
5812
|
if (arrow.thrown) throw arrow.error;
|
|
6026
|
-
|
|
6027
5813
|
throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, {
|
|
6028
5814
|
at: typeParameters
|
|
6029
5815
|
});
|
|
6030
5816
|
}
|
|
6031
5817
|
return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
|
|
6032
5818
|
}
|
|
6033
|
-
|
|
6034
5819
|
parseArrow(node) {
|
|
6035
5820
|
if (this.match(14)) {
|
|
6036
5821
|
const result = this.tryParse(() => {
|
|
6037
5822
|
const oldNoAnonFunctionType = this.state.noAnonFunctionType;
|
|
6038
5823
|
this.state.noAnonFunctionType = true;
|
|
6039
5824
|
const typeNode = this.startNode();
|
|
6040
|
-
[typeNode.typeAnnotation,
|
|
6041
|
-
node.predicate] = this.flowParseTypeAndPredicateInitialiser();
|
|
5825
|
+
[typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
|
|
6042
5826
|
this.state.noAnonFunctionType = oldNoAnonFunctionType;
|
|
6043
5827
|
if (this.canInsertSemicolon()) this.unexpected();
|
|
6044
5828
|
if (!this.match(19)) this.unexpected();
|
|
6045
5829
|
return typeNode;
|
|
6046
5830
|
});
|
|
6047
5831
|
if (result.thrown) return null;
|
|
6048
|
-
|
|
6049
5832
|
if (result.error) this.state = result.failState;
|
|
6050
|
-
|
|
6051
5833
|
node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
|
|
6052
5834
|
}
|
|
6053
5835
|
return super.parseArrow(node);
|
|
@@ -6066,7 +5848,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
6066
5848
|
if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
|
|
6067
5849
|
return;
|
|
6068
5850
|
}
|
|
6069
|
-
|
|
6070
5851
|
for (let i = 0; i < node.params.length; i++) {
|
|
6071
5852
|
if (this.isThisParam(node.params[i]) && i > 0) {
|
|
6072
5853
|
this.raise(FlowErrors.ThisParamMustBeFirst, {
|
|
@@ -6089,7 +5870,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
6089
5870
|
} else if (base.type === "Identifier" && base.name === "async" && this.match(47)) {
|
|
6090
5871
|
const state = this.state.clone();
|
|
6091
5872
|
const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state);
|
|
6092
|
-
|
|
6093
5873
|
if (!arrow.error && !arrow.aborted) return arrow.node;
|
|
6094
5874
|
const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state);
|
|
6095
5875
|
if (result.node && !result.error) return result.node;
|
|
@@ -6202,8 +5982,7 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
6202
5982
|
pos
|
|
6203
5983
|
} = this.state;
|
|
6204
5984
|
let shiftToFirstNonWhiteSpace = 2;
|
|
6205
|
-
while ([32, 9].includes(
|
|
6206
|
-
this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
|
|
5985
|
+
while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
|
|
6207
5986
|
shiftToFirstNonWhiteSpace++;
|
|
6208
5987
|
}
|
|
6209
5988
|
const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);
|
|
@@ -6211,15 +5990,12 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
6211
5990
|
if (ch2 === 58 && ch3 === 58) {
|
|
6212
5991
|
return shiftToFirstNonWhiteSpace + 2;
|
|
6213
5992
|
}
|
|
6214
|
-
|
|
6215
5993
|
if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") {
|
|
6216
5994
|
return shiftToFirstNonWhiteSpace + 12;
|
|
6217
5995
|
}
|
|
6218
|
-
|
|
6219
5996
|
if (ch2 === 58 && ch3 !== 58) {
|
|
6220
5997
|
return shiftToFirstNonWhiteSpace;
|
|
6221
5998
|
}
|
|
6222
|
-
|
|
6223
5999
|
return false;
|
|
6224
6000
|
}
|
|
6225
6001
|
hasFlowCommentCompletion() {
|
|
@@ -6230,7 +6006,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
6230
6006
|
});
|
|
6231
6007
|
}
|
|
6232
6008
|
}
|
|
6233
|
-
|
|
6234
6009
|
flowEnumErrorBooleanMemberNotInitialized(loc, {
|
|
6235
6010
|
enumName,
|
|
6236
6011
|
memberName
|
|
@@ -6580,7 +6355,6 @@ var flow = (superClass => class FlowParserMixin extends superClass {
|
|
|
6580
6355
|
node.body = this.flowEnumBody(this.startNode(), id);
|
|
6581
6356
|
return this.finishNode(node, "EnumDeclaration");
|
|
6582
6357
|
}
|
|
6583
|
-
|
|
6584
6358
|
isLookaheadToken_lt() {
|
|
6585
6359
|
const next = this.nextTokenStart();
|
|
6586
6360
|
if (this.input.charCodeAt(next) === 60) {
|
|
@@ -6866,11 +6640,9 @@ const JsxErrors = ParseErrorEnum`jsx`({
|
|
|
6866
6640
|
UnterminatedJsxContent: "Unterminated JSX contents.",
|
|
6867
6641
|
UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
|
|
6868
6642
|
});
|
|
6869
|
-
|
|
6870
6643
|
function isFragment(object) {
|
|
6871
6644
|
return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
|
|
6872
6645
|
}
|
|
6873
|
-
|
|
6874
6646
|
function getQualifiedJSXName(object) {
|
|
6875
6647
|
if (object.type === "JSXIdentifier") {
|
|
6876
6648
|
return object.name;
|
|
@@ -6881,11 +6653,9 @@ function getQualifiedJSXName(object) {
|
|
|
6881
6653
|
if (object.type === "JSXMemberExpression") {
|
|
6882
6654
|
return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
|
|
6883
6655
|
}
|
|
6884
|
-
|
|
6885
6656
|
throw new Error("Node had unexpected type: " + object.type);
|
|
6886
6657
|
}
|
|
6887
6658
|
var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
6888
|
-
|
|
6889
6659
|
jsxReadToken() {
|
|
6890
6660
|
let out = "";
|
|
6891
6661
|
let chunkStart = this.state.pos;
|
|
@@ -6915,7 +6685,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
6915
6685
|
break;
|
|
6916
6686
|
case 62:
|
|
6917
6687
|
case 125:
|
|
6918
|
-
|
|
6919
6688
|
default:
|
|
6920
6689
|
if (isNewLine(ch)) {
|
|
6921
6690
|
out += this.input.slice(chunkStart, this.state.pos);
|
|
@@ -6996,11 +6765,9 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
6996
6765
|
}
|
|
6997
6766
|
}
|
|
6998
6767
|
}
|
|
6999
|
-
|
|
7000
6768
|
this.state.pos = startPos;
|
|
7001
6769
|
return "&";
|
|
7002
6770
|
}
|
|
7003
|
-
|
|
7004
6771
|
jsxReadWord() {
|
|
7005
6772
|
let ch;
|
|
7006
6773
|
const start = this.state.pos;
|
|
@@ -7009,7 +6776,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7009
6776
|
} while (isIdentifierChar(ch) || ch === 45);
|
|
7010
6777
|
return this.finishToken(138, this.input.slice(start, this.state.pos));
|
|
7011
6778
|
}
|
|
7012
|
-
|
|
7013
6779
|
jsxParseIdentifier() {
|
|
7014
6780
|
const node = this.startNode();
|
|
7015
6781
|
if (this.match(138)) {
|
|
@@ -7022,7 +6788,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7022
6788
|
this.next();
|
|
7023
6789
|
return this.finishNode(node, "JSXIdentifier");
|
|
7024
6790
|
}
|
|
7025
|
-
|
|
7026
6791
|
jsxParseNamespacedName() {
|
|
7027
6792
|
const startLoc = this.state.startLoc;
|
|
7028
6793
|
const name = this.jsxParseIdentifier();
|
|
@@ -7032,7 +6797,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7032
6797
|
node.name = this.jsxParseIdentifier();
|
|
7033
6798
|
return this.finishNode(node, "JSXNamespacedName");
|
|
7034
6799
|
}
|
|
7035
|
-
|
|
7036
6800
|
jsxParseElementName() {
|
|
7037
6801
|
const startLoc = this.state.startLoc;
|
|
7038
6802
|
let node = this.jsxParseNamespacedName();
|
|
@@ -7047,7 +6811,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7047
6811
|
}
|
|
7048
6812
|
return node;
|
|
7049
6813
|
}
|
|
7050
|
-
|
|
7051
6814
|
jsxParseAttributeValue() {
|
|
7052
6815
|
let node;
|
|
7053
6816
|
switch (this.state.type) {
|
|
@@ -7071,12 +6834,10 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7071
6834
|
});
|
|
7072
6835
|
}
|
|
7073
6836
|
}
|
|
7074
|
-
|
|
7075
6837
|
jsxParseEmptyExpression() {
|
|
7076
6838
|
const node = this.startNodeAt(this.state.lastTokEndLoc);
|
|
7077
6839
|
return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc);
|
|
7078
6840
|
}
|
|
7079
|
-
|
|
7080
6841
|
jsxParseSpreadChild(node) {
|
|
7081
6842
|
this.next();
|
|
7082
6843
|
node.expression = this.parseExpression();
|
|
@@ -7085,7 +6846,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7085
6846
|
this.expect(8);
|
|
7086
6847
|
return this.finishNode(node, "JSXSpreadChild");
|
|
7087
6848
|
}
|
|
7088
|
-
|
|
7089
6849
|
jsxParseExpressionContainer(node, previousContext) {
|
|
7090
6850
|
if (this.match(8)) {
|
|
7091
6851
|
node.expression = this.jsxParseEmptyExpression();
|
|
@@ -7098,7 +6858,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7098
6858
|
this.expect(8);
|
|
7099
6859
|
return this.finishNode(node, "JSXExpressionContainer");
|
|
7100
6860
|
}
|
|
7101
|
-
|
|
7102
6861
|
jsxParseAttribute() {
|
|
7103
6862
|
const node = this.startNode();
|
|
7104
6863
|
if (this.match(5)) {
|
|
@@ -7115,7 +6874,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7115
6874
|
node.value = this.eat(29) ? this.jsxParseAttributeValue() : null;
|
|
7116
6875
|
return this.finishNode(node, "JSXAttribute");
|
|
7117
6876
|
}
|
|
7118
|
-
|
|
7119
6877
|
jsxParseOpeningElementAt(startLoc) {
|
|
7120
6878
|
const node = this.startNodeAt(startLoc);
|
|
7121
6879
|
if (this.eat(141)) {
|
|
@@ -7134,7 +6892,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7134
6892
|
this.expect(141);
|
|
7135
6893
|
return this.finishNode(node, "JSXOpeningElement");
|
|
7136
6894
|
}
|
|
7137
|
-
|
|
7138
6895
|
jsxParseClosingElementAt(startLoc) {
|
|
7139
6896
|
const node = this.startNodeAt(startLoc);
|
|
7140
6897
|
if (this.eat(141)) {
|
|
@@ -7144,7 +6901,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7144
6901
|
this.expect(141);
|
|
7145
6902
|
return this.finishNode(node, "JSXClosingElement");
|
|
7146
6903
|
}
|
|
7147
|
-
|
|
7148
6904
|
jsxParseElementAt(startLoc) {
|
|
7149
6905
|
const node = this.startNodeAt(startLoc);
|
|
7150
6906
|
const children = [];
|
|
@@ -7214,7 +6970,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7214
6970
|
}
|
|
7215
6971
|
return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
|
|
7216
6972
|
}
|
|
7217
|
-
|
|
7218
6973
|
jsxParseElement() {
|
|
7219
6974
|
const startLoc = this.state.startLoc;
|
|
7220
6975
|
this.next();
|
|
@@ -7226,7 +6981,6 @@ var jsx = (superClass => class JSXParserMixin extends superClass {
|
|
|
7226
6981
|
} = this.state;
|
|
7227
6982
|
context[context.length - 1] = newContext;
|
|
7228
6983
|
}
|
|
7229
|
-
|
|
7230
6984
|
parseExprAtom(refExpressionErrors) {
|
|
7231
6985
|
if (this.match(139)) {
|
|
7232
6986
|
return this.parseLiteral(this.state.value, "JSXText");
|
|
@@ -7301,7 +7055,6 @@ class TypeScriptScope extends Scope {
|
|
|
7301
7055
|
this.exportOnlyBindings = new Set();
|
|
7302
7056
|
}
|
|
7303
7057
|
}
|
|
7304
|
-
|
|
7305
7058
|
class TypeScriptScopeHandler extends ScopeHandler {
|
|
7306
7059
|
constructor(...args) {
|
|
7307
7060
|
super(...args);
|
|
@@ -7309,7 +7062,6 @@ class TypeScriptScopeHandler extends ScopeHandler {
|
|
|
7309
7062
|
}
|
|
7310
7063
|
createScope(flags) {
|
|
7311
7064
|
this.importsStack.push(new Set());
|
|
7312
|
-
|
|
7313
7065
|
return new TypeScriptScope(flags);
|
|
7314
7066
|
}
|
|
7315
7067
|
enter(flags) {
|
|
@@ -7422,6 +7174,7 @@ const TSErrors = ParseErrorEnum`typescript`({
|
|
|
7422
7174
|
}) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`,
|
|
7423
7175
|
AccesorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.",
|
|
7424
7176
|
AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.",
|
|
7177
|
+
AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
|
|
7425
7178
|
ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.",
|
|
7426
7179
|
ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.",
|
|
7427
7180
|
ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",
|
|
@@ -7431,8 +7184,7 @@ const TSErrors = ParseErrorEnum`typescript`({
|
|
|
7431
7184
|
}) => `'declare' is not allowed in ${kind}ters.`,
|
|
7432
7185
|
DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.",
|
|
7433
7186
|
DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.",
|
|
7434
|
-
DuplicateAccessibilityModifier:
|
|
7435
|
-
({
|
|
7187
|
+
DuplicateAccessibilityModifier: ({
|
|
7436
7188
|
modifier
|
|
7437
7189
|
}) => `Accessibility modifier already seen.`,
|
|
7438
7190
|
DuplicateModifier: ({
|
|
@@ -7506,7 +7258,6 @@ const TSErrors = ParseErrorEnum`typescript`({
|
|
|
7506
7258
|
type
|
|
7507
7259
|
}) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`
|
|
7508
7260
|
});
|
|
7509
|
-
|
|
7510
7261
|
function keywordTypeFromName(value) {
|
|
7511
7262
|
switch (value) {
|
|
7512
7263
|
case "any":
|
|
@@ -7553,7 +7304,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
7553
7304
|
this.next();
|
|
7554
7305
|
return this.tsTokenCanFollowModifier();
|
|
7555
7306
|
}
|
|
7556
|
-
|
|
7557
7307
|
tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock) {
|
|
7558
7308
|
if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58) {
|
|
7559
7309
|
return undefined;
|
|
@@ -7569,7 +7319,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
7569
7319
|
}
|
|
7570
7320
|
return undefined;
|
|
7571
7321
|
}
|
|
7572
|
-
|
|
7573
7322
|
tsParseModifiers({
|
|
7574
7323
|
modified,
|
|
7575
7324
|
allowedModifiers,
|
|
@@ -7668,7 +7417,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
7668
7417
|
tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) {
|
|
7669
7418
|
return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos));
|
|
7670
7419
|
}
|
|
7671
|
-
|
|
7672
7420
|
tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) {
|
|
7673
7421
|
const result = [];
|
|
7674
7422
|
let trailingCommaPos = -1;
|
|
@@ -7724,7 +7472,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
7724
7472
|
at: this.state.startLoc
|
|
7725
7473
|
});
|
|
7726
7474
|
}
|
|
7727
|
-
|
|
7728
7475
|
node.argument = super.parseExprAtom();
|
|
7729
7476
|
this.expect(11);
|
|
7730
7477
|
if (this.eat(16)) {
|
|
@@ -7787,7 +7534,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
7787
7534
|
errorTemplate: TSErrors.InvalidModifierOnTypeParameter
|
|
7788
7535
|
});
|
|
7789
7536
|
}
|
|
7790
|
-
|
|
7791
7537
|
tsParseNoneModifiers(node) {
|
|
7792
7538
|
this.tsParseModifiers({
|
|
7793
7539
|
modified: node,
|
|
@@ -7819,8 +7565,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
7819
7565
|
const refTrailingCommaPos = {
|
|
7820
7566
|
value: -1
|
|
7821
7567
|
};
|
|
7822
|
-
node.params = this.tsParseBracketedList("TypeParametersOrArguments",
|
|
7823
|
-
this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);
|
|
7568
|
+
node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);
|
|
7824
7569
|
if (node.params.length === 0) {
|
|
7825
7570
|
this.raise(TSErrors.EmptyTypeParameters, {
|
|
7826
7571
|
at: node
|
|
@@ -7831,10 +7576,8 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
7831
7576
|
}
|
|
7832
7577
|
return this.finishNode(node, "TSTypeParameterDeclaration");
|
|
7833
7578
|
}
|
|
7834
|
-
|
|
7835
7579
|
tsFillSignature(returnToken, signature) {
|
|
7836
7580
|
const returnTokenRequired = returnToken === 19;
|
|
7837
|
-
|
|
7838
7581
|
const paramsKey = "parameters";
|
|
7839
7582
|
const returnTypeKey = "typeAnnotation";
|
|
7840
7583
|
signature.typeParameters = this.tsTryParseTypeParameters();
|
|
@@ -7883,7 +7626,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
7883
7626
|
const id = this.parseIdentifier();
|
|
7884
7627
|
id.typeAnnotation = this.tsParseTypeAnnotation();
|
|
7885
7628
|
this.resetEndLocation(id);
|
|
7886
|
-
|
|
7887
7629
|
this.expect(3);
|
|
7888
7630
|
node.parameters = [id];
|
|
7889
7631
|
const type = this.tsTryParseTypeAnnotation();
|
|
@@ -8057,7 +7799,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8057
7799
|
tsParseTupleType() {
|
|
8058
7800
|
const node = this.startNode();
|
|
8059
7801
|
node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
|
|
8060
|
-
|
|
8061
7802
|
let seenOptionalElement = false;
|
|
8062
7803
|
let labeledElements = null;
|
|
8063
7804
|
node.elementTypes.forEach(elementNode => {
|
|
@@ -8071,7 +7812,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8071
7812
|
});
|
|
8072
7813
|
}
|
|
8073
7814
|
seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType");
|
|
8074
|
-
|
|
8075
7815
|
let checkType = type;
|
|
8076
7816
|
if (type === "TSRestType") {
|
|
8077
7817
|
elementNode = elementNode.typeAnnotation;
|
|
@@ -8088,7 +7828,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8088
7828
|
return this.finishNode(node, "TSTupleType");
|
|
8089
7829
|
}
|
|
8090
7830
|
tsParseTupleElementType() {
|
|
8091
|
-
|
|
8092
7831
|
const {
|
|
8093
7832
|
startLoc
|
|
8094
7833
|
} = this.state;
|
|
@@ -8135,7 +7874,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8135
7874
|
if (abstract) this.next();
|
|
8136
7875
|
this.next();
|
|
8137
7876
|
}
|
|
8138
|
-
|
|
8139
7877
|
this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node));
|
|
8140
7878
|
return this.finishNode(node, type);
|
|
8141
7879
|
}
|
|
@@ -8249,8 +7987,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8249
7987
|
node.operator = operator;
|
|
8250
7988
|
node.typeAnnotation = this.tsParseTypeOperatorOrHigher();
|
|
8251
7989
|
if (operator === "readonly") {
|
|
8252
|
-
this.tsCheckTypeAnnotationForReadOnly(
|
|
8253
|
-
node);
|
|
7990
|
+
this.tsCheckTypeAnnotationForReadOnly(node);
|
|
8254
7991
|
}
|
|
8255
7992
|
return this.finishNode(node, "TSTypeOperator");
|
|
8256
7993
|
}
|
|
@@ -8386,14 +8123,12 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8386
8123
|
if (!asserts) {
|
|
8387
8124
|
return this.tsParseTypeAnnotation(false, t);
|
|
8388
8125
|
}
|
|
8389
|
-
|
|
8390
8126
|
node.parameterName = this.parseIdentifier();
|
|
8391
8127
|
node.asserts = asserts;
|
|
8392
8128
|
node.typeAnnotation = null;
|
|
8393
8129
|
t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
|
|
8394
8130
|
return this.finishNode(t, "TSTypeAnnotation");
|
|
8395
8131
|
}
|
|
8396
|
-
|
|
8397
8132
|
const type = this.tsParseTypeAnnotation(false);
|
|
8398
8133
|
node.parameterName = typePredicateVariable;
|
|
8399
8134
|
node.typeAnnotation = type;
|
|
@@ -8442,7 +8177,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8442
8177
|
});
|
|
8443
8178
|
return this.finishNode(t, "TSTypeAnnotation");
|
|
8444
8179
|
}
|
|
8445
|
-
|
|
8446
8180
|
tsParseType() {
|
|
8447
8181
|
assert(this.state.inType);
|
|
8448
8182
|
const type = this.tsParseNonConditionalType();
|
|
@@ -8552,7 +8286,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8552
8286
|
this.state.context = oldContext;
|
|
8553
8287
|
}
|
|
8554
8288
|
}
|
|
8555
|
-
|
|
8556
8289
|
tsInType(cb) {
|
|
8557
8290
|
const oldInType = this.state.inType;
|
|
8558
8291
|
this.state.inType = true;
|
|
@@ -8692,7 +8425,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8692
8425
|
this.expect(11);
|
|
8693
8426
|
return this.finishNode(node, "TSExternalModuleReference");
|
|
8694
8427
|
}
|
|
8695
|
-
|
|
8696
8428
|
tsLookAhead(f) {
|
|
8697
8429
|
const state = this.state.clone();
|
|
8698
8430
|
const res = f();
|
|
@@ -8700,8 +8432,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8700
8432
|
return res;
|
|
8701
8433
|
}
|
|
8702
8434
|
tsTryParseAndCatch(f) {
|
|
8703
|
-
const result = this.tryParse(abort =>
|
|
8704
|
-
f() || abort());
|
|
8435
|
+
const result = this.tryParse(abort => f() || abort());
|
|
8705
8436
|
if (result.aborted || !result.node) return undefined;
|
|
8706
8437
|
if (result.error) this.state = result.failState;
|
|
8707
8438
|
return result.node;
|
|
@@ -8726,7 +8457,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8726
8457
|
starttype = 74;
|
|
8727
8458
|
kind = "let";
|
|
8728
8459
|
}
|
|
8729
|
-
|
|
8730
8460
|
return this.tsInAmbientContext(() => {
|
|
8731
8461
|
if (starttype === 68) {
|
|
8732
8462
|
nany.declare = true;
|
|
@@ -8749,7 +8479,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8749
8479
|
nany.declare = true;
|
|
8750
8480
|
return this.parseVarStatement(nany, kind || this.state.value, true);
|
|
8751
8481
|
}
|
|
8752
|
-
|
|
8753
8482
|
this.expect(75);
|
|
8754
8483
|
return this.tsParseEnumDeclaration(nany, {
|
|
8755
8484
|
const: true,
|
|
@@ -8767,7 +8496,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8767
8496
|
}
|
|
8768
8497
|
});
|
|
8769
8498
|
}
|
|
8770
|
-
|
|
8771
8499
|
tsTryParseExportDeclaration() {
|
|
8772
8500
|
return this.tsParseDeclaration(this.startNode(), this.state.value, true, null);
|
|
8773
8501
|
}
|
|
@@ -8799,7 +8527,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8799
8527
|
return this.tsParseDeclaration(node, expr.name, false, decorators);
|
|
8800
8528
|
}
|
|
8801
8529
|
}
|
|
8802
|
-
|
|
8803
8530
|
tsParseDeclaration(node, value, next, decorators) {
|
|
8804
8531
|
switch (value) {
|
|
8805
8532
|
case "abstract":
|
|
@@ -8856,7 +8583,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8856
8583
|
}
|
|
8857
8584
|
return super.parseArrowExpression(res, null, true);
|
|
8858
8585
|
}
|
|
8859
|
-
|
|
8860
8586
|
tsParseTypeArgumentsInExpression() {
|
|
8861
8587
|
if (this.reScan_lt() !== 47) {
|
|
8862
8588
|
return undefined;
|
|
@@ -8865,8 +8591,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8865
8591
|
}
|
|
8866
8592
|
tsParseTypeArguments() {
|
|
8867
8593
|
const node = this.startNode();
|
|
8868
|
-
node.params = this.tsInType(() =>
|
|
8869
|
-
this.tsInNoContext(() => {
|
|
8594
|
+
node.params = this.tsInType(() => this.tsInNoContext(() => {
|
|
8870
8595
|
this.expect(47);
|
|
8871
8596
|
return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
|
|
8872
8597
|
}));
|
|
@@ -8881,7 +8606,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8881
8606
|
tsIsDeclarationStart() {
|
|
8882
8607
|
return tokenIsTSDeclarationStart(this.state.type);
|
|
8883
8608
|
}
|
|
8884
|
-
|
|
8885
8609
|
isExportDefaultSpecifier() {
|
|
8886
8610
|
if (this.tsIsDeclarationStart()) return false;
|
|
8887
8611
|
return super.isExportDefaultSpecifier();
|
|
@@ -8967,8 +8691,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8967
8691
|
}
|
|
8968
8692
|
});
|
|
8969
8693
|
}
|
|
8970
|
-
toReferencedList(exprList,
|
|
8971
|
-
isInParens) {
|
|
8694
|
+
toReferencedList(exprList, isInParens) {
|
|
8972
8695
|
this.tsCheckForInvalidTypeCasts(exprList);
|
|
8973
8696
|
return exprList;
|
|
8974
8697
|
}
|
|
@@ -8996,7 +8719,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
8996
8719
|
state.optionalChainMember = isOptionalCall = true;
|
|
8997
8720
|
this.next();
|
|
8998
8721
|
}
|
|
8999
|
-
|
|
9000
8722
|
if (this.match(47) || this.match(51)) {
|
|
9001
8723
|
let missingParenErrorLoc;
|
|
9002
8724
|
const result = this.tsTryParseAndCatch(() => {
|
|
@@ -9021,7 +8743,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9021
8743
|
const node = this.startNodeAt(startLoc);
|
|
9022
8744
|
node.callee = base;
|
|
9023
8745
|
node.arguments = this.parseCallExpressionArguments(11, false);
|
|
9024
|
-
|
|
9025
8746
|
this.tsCheckForInvalidTypeCasts(node.arguments);
|
|
9026
8747
|
node.typeParameters = typeArguments;
|
|
9027
8748
|
if (state.optionalChainMember) {
|
|
@@ -9030,10 +8751,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9030
8751
|
return this.finishCallExpression(node, state.optionalChainMember);
|
|
9031
8752
|
}
|
|
9032
8753
|
const tokenType = this.state.type;
|
|
9033
|
-
if (
|
|
9034
|
-
tokenType === 48 ||
|
|
9035
|
-
tokenType === 52 ||
|
|
9036
|
-
tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
|
|
8754
|
+
if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) {
|
|
9037
8755
|
return;
|
|
9038
8756
|
}
|
|
9039
8757
|
const node = this.startNodeAt(startLoc);
|
|
@@ -9086,8 +8804,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9086
8804
|
});
|
|
9087
8805
|
this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression");
|
|
9088
8806
|
this.reScan_lt_gt();
|
|
9089
|
-
return this.parseExprOp(
|
|
9090
|
-
node, leftStartLoc, minPrec);
|
|
8807
|
+
return this.parseExprOp(node, leftStartLoc, minPrec);
|
|
9091
8808
|
}
|
|
9092
8809
|
return super.parseExprOp(left, leftStartLoc, minPrec);
|
|
9093
8810
|
}
|
|
@@ -9104,16 +8821,12 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9104
8821
|
});
|
|
9105
8822
|
}
|
|
9106
8823
|
}
|
|
9107
|
-
|
|
9108
8824
|
checkDuplicateExports() {}
|
|
9109
8825
|
parseImport(node) {
|
|
9110
8826
|
node.importKind = "value";
|
|
9111
8827
|
if (tokenIsIdentifier(this.state.type) || this.match(55) || this.match(5)) {
|
|
9112
8828
|
let ahead = this.lookahead();
|
|
9113
|
-
if (this.isContextual(128) &&
|
|
9114
|
-
ahead.type !== 12 &&
|
|
9115
|
-
ahead.type !== 97 &&
|
|
9116
|
-
ahead.type !== 29) {
|
|
8829
|
+
if (this.isContextual(128) && ahead.type !== 12 && ahead.type !== 97 && ahead.type !== 29) {
|
|
9117
8830
|
node.importKind = "type";
|
|
9118
8831
|
this.next();
|
|
9119
8832
|
ahead = this.lookahead();
|
|
@@ -9123,10 +8836,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9123
8836
|
}
|
|
9124
8837
|
}
|
|
9125
8838
|
const importNode = super.parseImport(node);
|
|
9126
|
-
|
|
9127
|
-
if (importNode.importKind === "type" &&
|
|
9128
|
-
importNode.specifiers.length > 1 &&
|
|
9129
|
-
importNode.specifiers[0].type === "ImportDefaultSpecifier") {
|
|
8839
|
+
if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") {
|
|
9130
8840
|
this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, {
|
|
9131
8841
|
at: importNode
|
|
9132
8842
|
});
|
|
@@ -9174,7 +8884,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9174
8884
|
cls.abstract = true;
|
|
9175
8885
|
return this.parseClass(cls, true, true);
|
|
9176
8886
|
}
|
|
9177
|
-
|
|
9178
8887
|
if (this.match(127)) {
|
|
9179
8888
|
const result = this.tsParseInterfaceDeclaration(this.startNode());
|
|
9180
8889
|
if (result) return result;
|
|
@@ -9192,12 +8901,11 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9192
8901
|
init
|
|
9193
8902
|
} of declaration.declarations) {
|
|
9194
8903
|
if (!init) continue;
|
|
9195
|
-
|
|
9196
8904
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
9197
8905
|
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, {
|
|
9198
8906
|
at: init
|
|
9199
8907
|
});
|
|
9200
|
-
} else if (init
|
|
8908
|
+
} else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) {
|
|
9201
8909
|
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, {
|
|
9202
8910
|
at: init
|
|
9203
8911
|
});
|
|
@@ -9304,7 +9012,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9304
9012
|
});
|
|
9305
9013
|
}
|
|
9306
9014
|
}
|
|
9307
|
-
|
|
9308
9015
|
super.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
|
|
9309
9016
|
}
|
|
9310
9017
|
parsePostMemberNameModifiers(methodOrProp) {
|
|
@@ -9321,18 +9028,14 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9321
9028
|
});
|
|
9322
9029
|
}
|
|
9323
9030
|
}
|
|
9324
|
-
|
|
9325
9031
|
parseExpressionStatement(node, expr, decorators) {
|
|
9326
|
-
const decl = expr.type === "Identifier" ?
|
|
9327
|
-
this.tsParseExpressionStatement(node, expr, decorators) : undefined;
|
|
9032
|
+
const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined;
|
|
9328
9033
|
return decl || super.parseExpressionStatement(node, expr, decorators);
|
|
9329
9034
|
}
|
|
9330
|
-
|
|
9331
9035
|
shouldParseExportDeclaration() {
|
|
9332
9036
|
if (this.tsIsDeclarationStart()) return true;
|
|
9333
9037
|
return super.shouldParseExportDeclaration();
|
|
9334
9038
|
}
|
|
9335
|
-
|
|
9336
9039
|
parseConditional(expr, startLoc, refExpressionErrors) {
|
|
9337
9040
|
if (!this.state.maybeInArrowParameters || !this.match(17)) {
|
|
9338
9041
|
return super.parseConditional(expr, startLoc, refExpressionErrors);
|
|
@@ -9347,7 +9050,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9347
9050
|
if (result.error) this.state = result.failState;
|
|
9348
9051
|
return result.node;
|
|
9349
9052
|
}
|
|
9350
|
-
|
|
9351
9053
|
parseParenItem(node, startLoc) {
|
|
9352
9054
|
node = super.parseParenItem(node, startLoc);
|
|
9353
9055
|
if (this.eat(17)) {
|
|
@@ -9366,7 +9068,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9366
9068
|
if (!this.state.isAmbientContext && this.isContextual(123)) {
|
|
9367
9069
|
return this.tsInAmbientContext(() => this.parseExportDeclaration(node));
|
|
9368
9070
|
}
|
|
9369
|
-
|
|
9370
9071
|
const startLoc = this.state.startLoc;
|
|
9371
9072
|
const isDeclare = this.eatContextual(123);
|
|
9372
9073
|
if (isDeclare && (this.isContextual(123) || !this.shouldParseExportDeclaration())) {
|
|
@@ -9386,8 +9087,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9386
9087
|
}
|
|
9387
9088
|
return declaration;
|
|
9388
9089
|
}
|
|
9389
|
-
parseClassId(node, isStatement, optionalId,
|
|
9390
|
-
bindingType) {
|
|
9090
|
+
parseClassId(node, isStatement, optionalId, bindingType) {
|
|
9391
9091
|
if ((!isStatement || optionalId) && this.isContextual(111)) {
|
|
9392
9092
|
return;
|
|
9393
9093
|
}
|
|
@@ -9396,8 +9096,12 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9396
9096
|
if (typeParameters) node.typeParameters = typeParameters;
|
|
9397
9097
|
}
|
|
9398
9098
|
parseClassPropertyAnnotation(node) {
|
|
9399
|
-
if (!node.optional
|
|
9400
|
-
|
|
9099
|
+
if (!node.optional) {
|
|
9100
|
+
if (this.eat(35)) {
|
|
9101
|
+
node.definite = true;
|
|
9102
|
+
} else if (this.eat(17)) {
|
|
9103
|
+
node.optional = true;
|
|
9104
|
+
}
|
|
9401
9105
|
}
|
|
9402
9106
|
const type = this.tsTryParseTypeAnnotation();
|
|
9403
9107
|
if (type) node.typeAnnotation = type;
|
|
@@ -9426,7 +9130,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9426
9130
|
at: node
|
|
9427
9131
|
});
|
|
9428
9132
|
}
|
|
9429
|
-
|
|
9430
9133
|
if (node.accessibility) {
|
|
9431
9134
|
this.raise(TSErrors.PrivateElementHasAccessibility, {
|
|
9432
9135
|
at: node,
|
|
@@ -9436,6 +9139,15 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9436
9139
|
this.parseClassPropertyAnnotation(node);
|
|
9437
9140
|
return super.parseClassPrivateProperty(node);
|
|
9438
9141
|
}
|
|
9142
|
+
parseClassAccessorProperty(node) {
|
|
9143
|
+
this.parseClassPropertyAnnotation(node);
|
|
9144
|
+
if (node.optional) {
|
|
9145
|
+
this.raise(TSErrors.AccessorCannotBeOptional, {
|
|
9146
|
+
at: node
|
|
9147
|
+
});
|
|
9148
|
+
}
|
|
9149
|
+
return super.parseClassAccessorProperty(node);
|
|
9150
|
+
}
|
|
9439
9151
|
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
9440
9152
|
const typeParameters = this.tsTryParseTypeParameters();
|
|
9441
9153
|
if (typeParameters && isConstructor) {
|
|
@@ -9443,7 +9155,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9443
9155
|
at: typeParameters
|
|
9444
9156
|
});
|
|
9445
9157
|
}
|
|
9446
|
-
|
|
9447
9158
|
const {
|
|
9448
9159
|
declare = false,
|
|
9449
9160
|
kind
|
|
@@ -9486,7 +9197,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9486
9197
|
if (typeParameters) node.typeParameters = typeParameters;
|
|
9487
9198
|
super.parseFunctionParams(node, allowModifiers);
|
|
9488
9199
|
}
|
|
9489
|
-
|
|
9490
9200
|
parseVarId(decl, kind) {
|
|
9491
9201
|
super.parseVarId(decl, kind);
|
|
9492
9202
|
if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) {
|
|
@@ -9498,7 +9208,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9498
9208
|
this.resetEndLocation(decl.id);
|
|
9499
9209
|
}
|
|
9500
9210
|
}
|
|
9501
|
-
|
|
9502
9211
|
parseAsyncArrowFromCallExpression(node, call) {
|
|
9503
9212
|
if (this.match(14)) {
|
|
9504
9213
|
node.returnType = this.tsParseTypeAnnotation();
|
|
@@ -9507,16 +9216,13 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9507
9216
|
}
|
|
9508
9217
|
parseMaybeAssign(refExpressionErrors, afterLeftParse) {
|
|
9509
9218
|
var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2, _jsx4, _typeCast3;
|
|
9510
|
-
|
|
9511
9219
|
let state;
|
|
9512
9220
|
let jsx;
|
|
9513
9221
|
let typeCast;
|
|
9514
9222
|
if (this.hasPlugin("jsx") && (this.match(140) || this.match(47))) {
|
|
9515
9223
|
state = this.state.clone();
|
|
9516
9224
|
jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
|
|
9517
|
-
|
|
9518
9225
|
if (!jsx.error) return jsx.node;
|
|
9519
|
-
|
|
9520
9226
|
const {
|
|
9521
9227
|
context
|
|
9522
9228
|
} = this.state;
|
|
@@ -9528,7 +9234,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9528
9234
|
if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) {
|
|
9529
9235
|
return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);
|
|
9530
9236
|
}
|
|
9531
|
-
|
|
9532
9237
|
if (!state || state === this.state) state = this.state.clone();
|
|
9533
9238
|
let typeParameters;
|
|
9534
9239
|
const arrow = this.tryParse(abort => {
|
|
@@ -9538,21 +9243,18 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9538
9243
|
if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
|
|
9539
9244
|
abort();
|
|
9540
9245
|
}
|
|
9541
|
-
|
|
9542
9246
|
if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) {
|
|
9543
9247
|
this.resetStartLocationFromNode(expr, typeParameters);
|
|
9544
9248
|
}
|
|
9545
9249
|
expr.typeParameters = typeParameters;
|
|
9546
9250
|
return expr;
|
|
9547
9251
|
}, state);
|
|
9548
|
-
|
|
9549
9252
|
if (!arrow.error && !arrow.aborted) {
|
|
9550
9253
|
if (typeParameters) this.reportReservedArrowTypeParam(typeParameters);
|
|
9551
9254
|
return arrow.node;
|
|
9552
9255
|
}
|
|
9553
9256
|
if (!jsx) {
|
|
9554
9257
|
assert(!this.hasPlugin("jsx"));
|
|
9555
|
-
|
|
9556
9258
|
typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state);
|
|
9557
9259
|
if (!typeCast.error) return typeCast.node;
|
|
9558
9260
|
}
|
|
@@ -9582,7 +9284,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9582
9284
|
});
|
|
9583
9285
|
}
|
|
9584
9286
|
}
|
|
9585
|
-
|
|
9586
9287
|
parseMaybeUnary(refExpressionErrors, sawUnary) {
|
|
9587
9288
|
if (!this.hasPlugin("jsx") && this.match(47)) {
|
|
9588
9289
|
return this.tsParseTypeAssertion();
|
|
@@ -9592,7 +9293,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9592
9293
|
}
|
|
9593
9294
|
parseArrow(node) {
|
|
9594
9295
|
if (this.match(14)) {
|
|
9595
|
-
|
|
9596
9296
|
const result = this.tryParse(abort => {
|
|
9597
9297
|
const returnType = this.tsParseTypeOrTypePredicateAnnotation(14);
|
|
9598
9298
|
if (this.canInsertSemicolon() || !this.match(19)) abort();
|
|
@@ -9606,7 +9306,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9606
9306
|
}
|
|
9607
9307
|
return super.parseArrow(node);
|
|
9608
9308
|
}
|
|
9609
|
-
|
|
9610
9309
|
parseAssignableListItemTypes(param) {
|
|
9611
9310
|
if (this.eat(17)) {
|
|
9612
9311
|
if (param.type !== "Identifier" && !this.state.isAmbientContext && !this.state.inType) {
|
|
@@ -9641,7 +9340,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9641
9340
|
case "TSNonNullExpression":
|
|
9642
9341
|
case "TSTypeAssertion":
|
|
9643
9342
|
if (isLHS) {
|
|
9644
|
-
this.expressionScope.
|
|
9343
|
+
this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, {
|
|
9645
9344
|
at: node
|
|
9646
9345
|
});
|
|
9647
9346
|
} else {
|
|
@@ -9684,7 +9383,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9684
9383
|
super.checkToRestConversion(node, allowPattern);
|
|
9685
9384
|
}
|
|
9686
9385
|
}
|
|
9687
|
-
|
|
9688
9386
|
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
9689
9387
|
return getOwn$1({
|
|
9690
9388
|
TSTypeCastExpression: true,
|
|
@@ -9723,7 +9421,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9723
9421
|
return super.checkCommaAfterRest(close);
|
|
9724
9422
|
}
|
|
9725
9423
|
}
|
|
9726
|
-
|
|
9727
9424
|
isClassMethod() {
|
|
9728
9425
|
return this.match(47) || super.isClassMethod();
|
|
9729
9426
|
}
|
|
@@ -9739,7 +9436,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9739
9436
|
}
|
|
9740
9437
|
return node;
|
|
9741
9438
|
}
|
|
9742
|
-
|
|
9743
9439
|
getTokenFromCode(code) {
|
|
9744
9440
|
if (this.state.inType) {
|
|
9745
9441
|
if (code === 62) {
|
|
@@ -9751,7 +9447,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9751
9447
|
}
|
|
9752
9448
|
return super.getTokenFromCode(code);
|
|
9753
9449
|
}
|
|
9754
|
-
|
|
9755
9450
|
reScan_lt_gt() {
|
|
9756
9451
|
const {
|
|
9757
9452
|
type
|
|
@@ -9803,8 +9498,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9803
9498
|
}
|
|
9804
9499
|
jsxParseOpeningElementAfterName(node) {
|
|
9805
9500
|
if (this.match(47) || this.match(51)) {
|
|
9806
|
-
const typeArguments = this.tsTryParseAndCatch(() =>
|
|
9807
|
-
this.tsParseTypeArgumentsInExpression());
|
|
9501
|
+
const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression());
|
|
9808
9502
|
if (typeArguments) node.typeParameters = typeArguments;
|
|
9809
9503
|
}
|
|
9810
9504
|
return super.jsxParseOpeningElementAfterName(node);
|
|
@@ -9848,7 +9542,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9848
9542
|
node.abstract = true;
|
|
9849
9543
|
return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));
|
|
9850
9544
|
} else if (this.isContextual(127)) {
|
|
9851
|
-
|
|
9852
9545
|
if (!this.hasFollowingLineBreak()) {
|
|
9853
9546
|
node.abstract = true;
|
|
9854
9547
|
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifer, {
|
|
@@ -9863,8 +9556,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9863
9556
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) {
|
|
9864
9557
|
const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
|
|
9865
9558
|
if (method.abstract) {
|
|
9866
|
-
const hasBody = this.hasPlugin("estree") ?
|
|
9867
|
-
!!method.value.body : !!method.body;
|
|
9559
|
+
const hasBody = this.hasPlugin("estree") ? !!method.value.body : !!method.body;
|
|
9868
9560
|
if (hasBody) {
|
|
9869
9561
|
const {
|
|
9870
9562
|
key
|
|
@@ -9904,8 +9596,7 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9904
9596
|
node.exportKind = "value";
|
|
9905
9597
|
return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly);
|
|
9906
9598
|
}
|
|
9907
|
-
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly,
|
|
9908
|
-
bindingType) {
|
|
9599
|
+
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
|
|
9909
9600
|
if (!importedIsString && isMaybeTypeOnly) {
|
|
9910
9601
|
this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport);
|
|
9911
9602
|
return this.finishNode(specifier, "ImportSpecifier");
|
|
@@ -9921,7 +9612,6 @@ var typescript = (superClass => class TypeScriptParserMixin extends superClass {
|
|
|
9921
9612
|
let hasTypeSpecifier = false;
|
|
9922
9613
|
let canParseAsKeyword = true;
|
|
9923
9614
|
const loc = leftOfAs.loc.start;
|
|
9924
|
-
|
|
9925
9615
|
if (this.isContextual(93)) {
|
|
9926
9616
|
const firstAs = this.parseIdentifier();
|
|
9927
9617
|
if (this.isContextual(93)) {
|
|
@@ -9984,6 +9674,58 @@ function isPossiblyLiteralEnum(expression) {
|
|
|
9984
9674
|
}
|
|
9985
9675
|
return isUncomputedMemberExpressionChain(expression.object);
|
|
9986
9676
|
}
|
|
9677
|
+
function isValidAmbientConstInitializer(expression, estree) {
|
|
9678
|
+
var _expression$extra;
|
|
9679
|
+
const {
|
|
9680
|
+
type
|
|
9681
|
+
} = expression;
|
|
9682
|
+
if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) {
|
|
9683
|
+
return false;
|
|
9684
|
+
}
|
|
9685
|
+
if (estree) {
|
|
9686
|
+
if (type === "Literal") {
|
|
9687
|
+
const {
|
|
9688
|
+
value
|
|
9689
|
+
} = expression;
|
|
9690
|
+
if (typeof value === "string" || typeof value === "boolean") {
|
|
9691
|
+
return true;
|
|
9692
|
+
}
|
|
9693
|
+
}
|
|
9694
|
+
} else {
|
|
9695
|
+
if (type === "StringLiteral" || type === "BooleanLiteral") {
|
|
9696
|
+
return true;
|
|
9697
|
+
}
|
|
9698
|
+
}
|
|
9699
|
+
if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) {
|
|
9700
|
+
return true;
|
|
9701
|
+
}
|
|
9702
|
+
if (type === "TemplateLiteral" && expression.expressions.length === 0) {
|
|
9703
|
+
return true;
|
|
9704
|
+
}
|
|
9705
|
+
if (isPossiblyLiteralEnum(expression)) {
|
|
9706
|
+
return true;
|
|
9707
|
+
}
|
|
9708
|
+
return false;
|
|
9709
|
+
}
|
|
9710
|
+
function isNumber(expression, estree) {
|
|
9711
|
+
if (estree) {
|
|
9712
|
+
return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression);
|
|
9713
|
+
} else {
|
|
9714
|
+
return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral";
|
|
9715
|
+
}
|
|
9716
|
+
}
|
|
9717
|
+
function isNegativeNumber(expression, estree) {
|
|
9718
|
+
if (expression.type === "UnaryExpression") {
|
|
9719
|
+
const {
|
|
9720
|
+
operator,
|
|
9721
|
+
argument
|
|
9722
|
+
} = expression;
|
|
9723
|
+
if (operator === "-" && isNumber(argument, estree)) {
|
|
9724
|
+
return true;
|
|
9725
|
+
}
|
|
9726
|
+
}
|
|
9727
|
+
return false;
|
|
9728
|
+
}
|
|
9987
9729
|
function isUncomputedMemberExpressionChain(expression) {
|
|
9988
9730
|
if (expression.type === "Identifier") return true;
|
|
9989
9731
|
if (expression.type !== "MemberExpression") return false;
|
|
@@ -9995,14 +9737,12 @@ const PlaceholderErrors = ParseErrorEnum`placeholders`({
|
|
|
9995
9737
|
ClassNameIsRequired: "A class name is required.",
|
|
9996
9738
|
UnexpectedSpace: "Unexpected space in placeholder."
|
|
9997
9739
|
});
|
|
9998
|
-
|
|
9999
9740
|
var placeholders = (superClass => class PlaceholdersParserMixin extends superClass {
|
|
10000
9741
|
parsePlaceholder(expectedNode) {
|
|
10001
9742
|
if (this.match(142)) {
|
|
10002
9743
|
const node = this.startNode();
|
|
10003
9744
|
this.next();
|
|
10004
9745
|
this.assertNoSpace();
|
|
10005
|
-
|
|
10006
9746
|
node.name = super.parseIdentifier(true);
|
|
10007
9747
|
this.assertNoSpace();
|
|
10008
9748
|
this.expect(142);
|
|
@@ -10012,17 +9752,14 @@ var placeholders = (superClass => class PlaceholdersParserMixin extends superCla
|
|
|
10012
9752
|
finishPlaceholder(node, expectedNode) {
|
|
10013
9753
|
const isFinished = !!(node.expectedNode && node.type === "Placeholder");
|
|
10014
9754
|
node.expectedNode = expectedNode;
|
|
10015
|
-
|
|
10016
9755
|
return isFinished ? node : this.finishNode(node, "Placeholder");
|
|
10017
9756
|
}
|
|
10018
|
-
|
|
10019
9757
|
getTokenFromCode(code) {
|
|
10020
9758
|
if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
|
|
10021
9759
|
return this.finishOp(142, 2);
|
|
10022
9760
|
}
|
|
10023
9761
|
return super.getTokenFromCode(code);
|
|
10024
9762
|
}
|
|
10025
|
-
|
|
10026
9763
|
parseExprAtom(refExpressionErrors) {
|
|
10027
9764
|
return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors);
|
|
10028
9765
|
}
|
|
@@ -10034,7 +9771,6 @@ var placeholders = (superClass => class PlaceholdersParserMixin extends superCla
|
|
|
10034
9771
|
super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
|
|
10035
9772
|
}
|
|
10036
9773
|
}
|
|
10037
|
-
|
|
10038
9774
|
parseBindingAtom() {
|
|
10039
9775
|
return this.parsePlaceholder("Pattern") || super.parseBindingAtom();
|
|
10040
9776
|
}
|
|
@@ -10048,12 +9784,10 @@ var placeholders = (superClass => class PlaceholdersParserMixin extends superCla
|
|
|
10048
9784
|
super.toAssignable(node, isLHS);
|
|
10049
9785
|
}
|
|
10050
9786
|
}
|
|
10051
|
-
|
|
10052
9787
|
chStartsBindingIdentifier(ch, pos) {
|
|
10053
9788
|
if (super.chStartsBindingIdentifier(ch, pos)) {
|
|
10054
9789
|
return true;
|
|
10055
9790
|
}
|
|
10056
|
-
|
|
10057
9791
|
const nextToken = this.lookahead();
|
|
10058
9792
|
if (nextToken.type === 142) {
|
|
10059
9793
|
return true;
|
|
@@ -10064,7 +9798,6 @@ var placeholders = (superClass => class PlaceholdersParserMixin extends superCla
|
|
|
10064
9798
|
if (node.label && node.label.type === "Placeholder") return;
|
|
10065
9799
|
super.verifyBreakContinue(node, isBreak);
|
|
10066
9800
|
}
|
|
10067
|
-
|
|
10068
9801
|
parseExpressionStatement(node, expr) {
|
|
10069
9802
|
if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) {
|
|
10070
9803
|
return super.parseExpressionStatement(node, expr);
|
|
@@ -10119,7 +9852,6 @@ var placeholders = (superClass => class PlaceholdersParserMixin extends superCla
|
|
|
10119
9852
|
node.declaration = this.finishPlaceholder(placeholder, "Declaration");
|
|
10120
9853
|
return this.finishNode(node, "ExportNamedDeclaration");
|
|
10121
9854
|
}
|
|
10122
|
-
|
|
10123
9855
|
this.expectPlugin("exportDefaultFrom");
|
|
10124
9856
|
const specifier = this.startNode();
|
|
10125
9857
|
specifier.exported = placeholder;
|
|
@@ -10148,8 +9880,7 @@ var placeholders = (superClass => class PlaceholdersParserMixin extends superCla
|
|
|
10148
9880
|
specifiers
|
|
10149
9881
|
} = node;
|
|
10150
9882
|
if (specifiers != null && specifiers.length) {
|
|
10151
|
-
node.specifiers = specifiers.filter(
|
|
10152
|
-
node => node.exported.type === "Placeholder");
|
|
9883
|
+
node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder");
|
|
10153
9884
|
}
|
|
10154
9885
|
super.checkExport(node);
|
|
10155
9886
|
node.specifiers = specifiers;
|
|
@@ -10163,13 +9894,11 @@ var placeholders = (superClass => class PlaceholdersParserMixin extends superCla
|
|
|
10163
9894
|
this.semicolon();
|
|
10164
9895
|
return this.finishNode(node, "ImportDeclaration");
|
|
10165
9896
|
}
|
|
10166
|
-
|
|
10167
9897
|
const specifier = this.startNodeAtNode(placeholder);
|
|
10168
9898
|
specifier.local = placeholder;
|
|
10169
9899
|
node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier"));
|
|
10170
9900
|
if (this.eat(12)) {
|
|
10171
9901
|
const hasStarImport = this.maybeParseStarImportSpecifier(node);
|
|
10172
|
-
|
|
10173
9902
|
if (!hasStarImport) this.parseNamedImportSpecifiers(node);
|
|
10174
9903
|
}
|
|
10175
9904
|
this.expectContextual(97);
|
|
@@ -10178,10 +9907,8 @@ var placeholders = (superClass => class PlaceholdersParserMixin extends superCla
|
|
|
10178
9907
|
return this.finishNode(node, "ImportDeclaration");
|
|
10179
9908
|
}
|
|
10180
9909
|
parseImportSource() {
|
|
10181
|
-
|
|
10182
9910
|
return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
|
|
10183
9911
|
}
|
|
10184
|
-
|
|
10185
9912
|
assertNoSpace() {
|
|
10186
9913
|
if (this.state.start > this.state.lastTokEndLoc.index) {
|
|
10187
9914
|
this.raise(PlaceholderErrors.UnexpectedSpace, {
|
|
@@ -10208,7 +9935,6 @@ var v8intrinsic = (superClass => class V8IntrinsicMixin extends superClass {
|
|
|
10208
9935
|
this.unexpected(v8IntrinsicStartLoc);
|
|
10209
9936
|
}
|
|
10210
9937
|
}
|
|
10211
|
-
|
|
10212
9938
|
parseExprAtom(refExpressionErrors) {
|
|
10213
9939
|
return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors);
|
|
10214
9940
|
}
|
|
@@ -10319,7 +10045,6 @@ function validatePlugins(plugins) {
|
|
|
10319
10045
|
throw error;
|
|
10320
10046
|
}
|
|
10321
10047
|
}
|
|
10322
|
-
|
|
10323
10048
|
const mixinPlugins = {
|
|
10324
10049
|
estree,
|
|
10325
10050
|
jsx,
|
|
@@ -10348,7 +10073,6 @@ const defaultOptions = {
|
|
|
10348
10073
|
errorRecovery: false,
|
|
10349
10074
|
attachComment: true
|
|
10350
10075
|
};
|
|
10351
|
-
|
|
10352
10076
|
function getOptions(opts) {
|
|
10353
10077
|
const options = {};
|
|
10354
10078
|
for (const key of Object.keys(defaultOptions)) {
|
|
@@ -10362,7 +10086,6 @@ const unwrapParenthesizedExpression = node => {
|
|
|
10362
10086
|
return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
|
|
10363
10087
|
};
|
|
10364
10088
|
class LValParser extends NodeUtils {
|
|
10365
|
-
|
|
10366
10089
|
toAssignable(node, isLHS = false) {
|
|
10367
10090
|
var _node$extra, _node$extra3;
|
|
10368
10091
|
let parenthesized = undefined;
|
|
@@ -10370,7 +10093,7 @@ class LValParser extends NodeUtils {
|
|
|
10370
10093
|
parenthesized = unwrapParenthesizedExpression(node);
|
|
10371
10094
|
if (isLHS) {
|
|
10372
10095
|
if (parenthesized.type === "Identifier") {
|
|
10373
|
-
this.expressionScope.
|
|
10096
|
+
this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, {
|
|
10374
10097
|
at: node
|
|
10375
10098
|
});
|
|
10376
10099
|
} else if (parenthesized.type !== "MemberExpression") {
|
|
@@ -10440,7 +10163,6 @@ class LValParser extends NodeUtils {
|
|
|
10440
10163
|
break;
|
|
10441
10164
|
}
|
|
10442
10165
|
}
|
|
10443
|
-
|
|
10444
10166
|
toAssignableObjectExpressionProp(prop, isLast, isLHS) {
|
|
10445
10167
|
if (prop.type === "ObjectMethod") {
|
|
10446
10168
|
this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, {
|
|
@@ -10460,7 +10182,6 @@ class LValParser extends NodeUtils {
|
|
|
10460
10182
|
this.toAssignable(prop, isLHS);
|
|
10461
10183
|
}
|
|
10462
10184
|
}
|
|
10463
|
-
|
|
10464
10185
|
toAssignableList(exprList, trailingCommaLoc, isLHS) {
|
|
10465
10186
|
const end = exprList.length - 1;
|
|
10466
10187
|
for (let i = 0; i <= end; i++) {
|
|
@@ -10519,9 +10240,7 @@ class LValParser extends NodeUtils {
|
|
|
10519
10240
|
return false;
|
|
10520
10241
|
}
|
|
10521
10242
|
}
|
|
10522
|
-
|
|
10523
|
-
toReferencedList(exprList,
|
|
10524
|
-
isParenthesizedExpr) {
|
|
10243
|
+
toReferencedList(exprList, isParenthesizedExpr) {
|
|
10525
10244
|
return exprList;
|
|
10526
10245
|
}
|
|
10527
10246
|
toReferencedListDeep(exprList, isParenthesizedExpr) {
|
|
@@ -10532,21 +10251,18 @@ class LValParser extends NodeUtils {
|
|
|
10532
10251
|
}
|
|
10533
10252
|
}
|
|
10534
10253
|
}
|
|
10535
|
-
|
|
10536
10254
|
parseSpread(refExpressionErrors) {
|
|
10537
10255
|
const node = this.startNode();
|
|
10538
10256
|
this.next();
|
|
10539
10257
|
node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined);
|
|
10540
10258
|
return this.finishNode(node, "SpreadElement");
|
|
10541
10259
|
}
|
|
10542
|
-
|
|
10543
10260
|
parseRestBinding() {
|
|
10544
10261
|
const node = this.startNode();
|
|
10545
10262
|
this.next();
|
|
10546
10263
|
node.argument = this.parseBindingAtom();
|
|
10547
10264
|
return this.finishNode(node, "RestElement");
|
|
10548
10265
|
}
|
|
10549
|
-
|
|
10550
10266
|
parseBindingAtom() {
|
|
10551
10267
|
switch (this.state.type) {
|
|
10552
10268
|
case 0:
|
|
@@ -10559,10 +10275,8 @@ class LValParser extends NodeUtils {
|
|
|
10559
10275
|
case 5:
|
|
10560
10276
|
return this.parseObjectLike(8, true);
|
|
10561
10277
|
}
|
|
10562
|
-
|
|
10563
10278
|
return this.parseIdentifier();
|
|
10564
10279
|
}
|
|
10565
|
-
|
|
10566
10280
|
parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {
|
|
10567
10281
|
const elts = [];
|
|
10568
10282
|
let first = true;
|
|
@@ -10597,14 +10311,12 @@ class LValParser extends NodeUtils {
|
|
|
10597
10311
|
}
|
|
10598
10312
|
return elts;
|
|
10599
10313
|
}
|
|
10600
|
-
|
|
10601
10314
|
parseBindingRestProperty(prop) {
|
|
10602
10315
|
this.next();
|
|
10603
10316
|
prop.argument = this.parseIdentifier();
|
|
10604
10317
|
this.checkCommaAfterRest(125);
|
|
10605
10318
|
return this.finishNode(prop, "RestElement");
|
|
10606
10319
|
}
|
|
10607
|
-
|
|
10608
10320
|
parseBindingProperty() {
|
|
10609
10321
|
const prop = this.startNode();
|
|
10610
10322
|
const {
|
|
@@ -10623,7 +10335,6 @@ class LValParser extends NodeUtils {
|
|
|
10623
10335
|
prop.method = false;
|
|
10624
10336
|
return this.parseObjPropValue(prop, startLoc, false, false, true, false);
|
|
10625
10337
|
}
|
|
10626
|
-
|
|
10627
10338
|
parseAssignableListItem(allowModifiers, decorators) {
|
|
10628
10339
|
const left = this.parseMaybeDefault();
|
|
10629
10340
|
this.parseAssignableListItemTypes(left);
|
|
@@ -10633,11 +10344,9 @@ class LValParser extends NodeUtils {
|
|
|
10633
10344
|
}
|
|
10634
10345
|
return elt;
|
|
10635
10346
|
}
|
|
10636
|
-
|
|
10637
10347
|
parseAssignableListItemTypes(param) {
|
|
10638
10348
|
return param;
|
|
10639
10349
|
}
|
|
10640
|
-
|
|
10641
10350
|
parseMaybeDefault(startLoc, left) {
|
|
10642
10351
|
var _startLoc, _left;
|
|
10643
10352
|
(_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;
|
|
@@ -10648,9 +10357,7 @@ class LValParser extends NodeUtils {
|
|
|
10648
10357
|
node.right = this.parseMaybeAssignAllowIn();
|
|
10649
10358
|
return this.finishNode(node, "AssignmentPattern");
|
|
10650
10359
|
}
|
|
10651
|
-
isValidLVal(type,
|
|
10652
|
-
isUnparenthesizedInAssign,
|
|
10653
|
-
binding) {
|
|
10360
|
+
isValidLVal(type, isUnparenthesizedInAssign, binding) {
|
|
10654
10361
|
return getOwn({
|
|
10655
10362
|
AssignmentPattern: "left",
|
|
10656
10363
|
RestElement: "argument",
|
|
@@ -10658,10 +10365,8 @@ class LValParser extends NodeUtils {
|
|
|
10658
10365
|
ParenthesizedExpression: "expression",
|
|
10659
10366
|
ArrayPattern: "elements",
|
|
10660
10367
|
ObjectPattern: "properties"
|
|
10661
|
-
},
|
|
10662
|
-
type);
|
|
10368
|
+
}, type);
|
|
10663
10369
|
}
|
|
10664
|
-
|
|
10665
10370
|
checkLVal(expression, {
|
|
10666
10371
|
in: ancestor,
|
|
10667
10372
|
binding = BIND_NONE,
|
|
@@ -10672,7 +10377,6 @@ class LValParser extends NodeUtils {
|
|
|
10672
10377
|
}) {
|
|
10673
10378
|
var _expression$extra;
|
|
10674
10379
|
const type = expression.type;
|
|
10675
|
-
|
|
10676
10380
|
if (this.isObjectMethod(expression)) return;
|
|
10677
10381
|
if (type === "MemberExpression") {
|
|
10678
10382
|
if (binding !== BIND_NONE) {
|
|
@@ -10715,7 +10419,6 @@ class LValParser extends NodeUtils {
|
|
|
10715
10419
|
}
|
|
10716
10420
|
const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === "ParenthesizedExpression"];
|
|
10717
10421
|
const nextAncestor = expression.type === "ArrayPattern" || expression.type === "ObjectPattern" || expression.type === "ParenthesizedExpression" ? expression : ancestor;
|
|
10718
|
-
|
|
10719
10422
|
for (const child of [].concat(expression[key])) {
|
|
10720
10423
|
if (child) {
|
|
10721
10424
|
this.checkLVal(child, {
|
|
@@ -10784,10 +10487,8 @@ class LValParser extends NodeUtils {
|
|
|
10784
10487
|
}
|
|
10785
10488
|
|
|
10786
10489
|
class ExpressionParser extends LValParser {
|
|
10787
|
-
|
|
10788
10490
|
checkProto(prop, isRecord, protoRef, refExpressionErrors) {
|
|
10789
|
-
if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed ||
|
|
10790
|
-
prop.shorthand) {
|
|
10491
|
+
if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) {
|
|
10791
10492
|
return;
|
|
10792
10493
|
}
|
|
10793
10494
|
const key = prop.key;
|
|
@@ -10816,7 +10517,6 @@ class ExpressionParser extends LValParser {
|
|
|
10816
10517
|
shouldExitDescending(expr, potentialArrowAt) {
|
|
10817
10518
|
return expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt;
|
|
10818
10519
|
}
|
|
10819
|
-
|
|
10820
10520
|
getExpression() {
|
|
10821
10521
|
this.enterInitialScopes();
|
|
10822
10522
|
this.nextToken();
|
|
@@ -10832,14 +10532,12 @@ class ExpressionParser extends LValParser {
|
|
|
10832
10532
|
}
|
|
10833
10533
|
return expr;
|
|
10834
10534
|
}
|
|
10835
|
-
|
|
10836
10535
|
parseExpression(disallowIn, refExpressionErrors) {
|
|
10837
10536
|
if (disallowIn) {
|
|
10838
10537
|
return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors));
|
|
10839
10538
|
}
|
|
10840
10539
|
return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
|
|
10841
10540
|
}
|
|
10842
|
-
|
|
10843
10541
|
parseExpressionBase(refExpressionErrors) {
|
|
10844
10542
|
const startLoc = this.state.startLoc;
|
|
10845
10543
|
const expr = this.parseMaybeAssign(refExpressionErrors);
|
|
@@ -10854,20 +10552,16 @@ class ExpressionParser extends LValParser {
|
|
|
10854
10552
|
}
|
|
10855
10553
|
return expr;
|
|
10856
10554
|
}
|
|
10857
|
-
|
|
10858
10555
|
parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) {
|
|
10859
10556
|
return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
|
|
10860
10557
|
}
|
|
10861
|
-
|
|
10862
10558
|
parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) {
|
|
10863
10559
|
return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse));
|
|
10864
10560
|
}
|
|
10865
|
-
|
|
10866
10561
|
setOptionalParametersError(refExpressionErrors, resultError) {
|
|
10867
10562
|
var _resultError$loc;
|
|
10868
10563
|
refExpressionErrors.optionalParametersLoc = (_resultError$loc = resultError == null ? void 0 : resultError.loc) != null ? _resultError$loc : this.state.startLoc;
|
|
10869
10564
|
}
|
|
10870
|
-
|
|
10871
10565
|
parseMaybeAssign(refExpressionErrors, afterLeftParse) {
|
|
10872
10566
|
const startLoc = this.state.startLoc;
|
|
10873
10567
|
if (this.isContextual(106)) {
|
|
@@ -10907,11 +10601,9 @@ class ExpressionParser extends LValParser {
|
|
|
10907
10601
|
if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) {
|
|
10908
10602
|
refExpressionErrors.doubleProtoLoc = null;
|
|
10909
10603
|
}
|
|
10910
|
-
|
|
10911
10604
|
if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) {
|
|
10912
10605
|
refExpressionErrors.shorthandAssignLoc = null;
|
|
10913
10606
|
}
|
|
10914
|
-
|
|
10915
10607
|
if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) {
|
|
10916
10608
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
10917
10609
|
refExpressionErrors.privateKeyLoc = null;
|
|
@@ -10930,7 +10622,6 @@ class ExpressionParser extends LValParser {
|
|
|
10930
10622
|
}
|
|
10931
10623
|
return left;
|
|
10932
10624
|
}
|
|
10933
|
-
|
|
10934
10625
|
parseMaybeConditional(refExpressionErrors) {
|
|
10935
10626
|
const startLoc = this.state.startLoc;
|
|
10936
10627
|
const potentialArrowAt = this.state.potentialArrowAt;
|
|
@@ -10940,8 +10631,7 @@ class ExpressionParser extends LValParser {
|
|
|
10940
10631
|
}
|
|
10941
10632
|
return this.parseConditional(expr, startLoc, refExpressionErrors);
|
|
10942
10633
|
}
|
|
10943
|
-
parseConditional(expr, startLoc,
|
|
10944
|
-
refExpressionErrors) {
|
|
10634
|
+
parseConditional(expr, startLoc, refExpressionErrors) {
|
|
10945
10635
|
if (this.eat(17)) {
|
|
10946
10636
|
const node = this.startNodeAt(startLoc);
|
|
10947
10637
|
node.test = expr;
|
|
@@ -10955,7 +10645,6 @@ class ExpressionParser extends LValParser {
|
|
|
10955
10645
|
parseMaybeUnaryOrPrivate(refExpressionErrors) {
|
|
10956
10646
|
return this.match(136) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
|
|
10957
10647
|
}
|
|
10958
|
-
|
|
10959
10648
|
parseExprOps(refExpressionErrors) {
|
|
10960
10649
|
const startLoc = this.state.startLoc;
|
|
10961
10650
|
const potentialArrowAt = this.state.potentialArrowAt;
|
|
@@ -10965,10 +10654,8 @@ class ExpressionParser extends LValParser {
|
|
|
10965
10654
|
}
|
|
10966
10655
|
return this.parseExprOp(expr, startLoc, -1);
|
|
10967
10656
|
}
|
|
10968
|
-
|
|
10969
10657
|
parseExprOp(left, leftStartLoc, minPrec) {
|
|
10970
10658
|
if (this.isPrivateName(left)) {
|
|
10971
|
-
|
|
10972
10659
|
const value = this.getPrivateNameSV(left);
|
|
10973
10660
|
if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) {
|
|
10974
10661
|
this.raise(Errors.PrivateInExpectedIn, {
|
|
@@ -11020,7 +10707,6 @@ class ExpressionParser extends LValParser {
|
|
|
11020
10707
|
}
|
|
11021
10708
|
return left;
|
|
11022
10709
|
}
|
|
11023
|
-
|
|
11024
10710
|
parseExprOpRightExpr(op, prec) {
|
|
11025
10711
|
const startLoc = this.state.startLoc;
|
|
11026
10712
|
switch (op) {
|
|
@@ -11044,12 +10730,10 @@ class ExpressionParser extends LValParser {
|
|
|
11044
10730
|
return this.parseFSharpPipelineBody(prec);
|
|
11045
10731
|
});
|
|
11046
10732
|
}
|
|
11047
|
-
|
|
11048
10733
|
default:
|
|
11049
10734
|
return this.parseExprOpBaseRightExpr(op, prec);
|
|
11050
10735
|
}
|
|
11051
10736
|
}
|
|
11052
|
-
|
|
11053
10737
|
parseExprOpBaseRightExpr(op, prec) {
|
|
11054
10738
|
const startLoc = this.state.startLoc;
|
|
11055
10739
|
return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec);
|
|
@@ -11060,9 +10744,7 @@ class ExpressionParser extends LValParser {
|
|
|
11060
10744
|
startLoc
|
|
11061
10745
|
} = this.state;
|
|
11062
10746
|
const body = this.parseMaybeAssign();
|
|
11063
|
-
const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(
|
|
11064
|
-
body.type);
|
|
11065
|
-
|
|
10747
|
+
const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type);
|
|
11066
10748
|
if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) {
|
|
11067
10749
|
this.raise(Errors.PipeUnparenthesizedBody, {
|
|
11068
10750
|
at: startLoc,
|
|
@@ -11083,7 +10765,6 @@ class ExpressionParser extends LValParser {
|
|
|
11083
10765
|
});
|
|
11084
10766
|
}
|
|
11085
10767
|
}
|
|
11086
|
-
|
|
11087
10768
|
parseMaybeUnary(refExpressionErrors, sawUnary) {
|
|
11088
10769
|
const startLoc = this.state.startLoc;
|
|
11089
10770
|
const isAwait = this.isContextual(96);
|
|
@@ -11124,8 +10805,7 @@ class ExpressionParser extends LValParser {
|
|
|
11124
10805
|
return this.finishNode(node, "UnaryExpression");
|
|
11125
10806
|
}
|
|
11126
10807
|
}
|
|
11127
|
-
const expr = this.parseUpdate(
|
|
11128
|
-
node, update, refExpressionErrors);
|
|
10808
|
+
const expr = this.parseUpdate(node, update, refExpressionErrors);
|
|
11129
10809
|
if (isAwait) {
|
|
11130
10810
|
const {
|
|
11131
10811
|
type
|
|
@@ -11140,7 +10820,6 @@ class ExpressionParser extends LValParser {
|
|
|
11140
10820
|
}
|
|
11141
10821
|
return expr;
|
|
11142
10822
|
}
|
|
11143
|
-
|
|
11144
10823
|
parseUpdate(node, update, refExpressionErrors) {
|
|
11145
10824
|
if (update) {
|
|
11146
10825
|
const updateExpressionNode = node;
|
|
@@ -11164,7 +10843,6 @@ class ExpressionParser extends LValParser {
|
|
|
11164
10843
|
}
|
|
11165
10844
|
return expr;
|
|
11166
10845
|
}
|
|
11167
|
-
|
|
11168
10846
|
parseExprSubscripts(refExpressionErrors) {
|
|
11169
10847
|
const startLoc = this.state.startLoc;
|
|
11170
10848
|
const potentialArrowAt = this.state.potentialArrowAt;
|
|
@@ -11182,12 +10860,10 @@ class ExpressionParser extends LValParser {
|
|
|
11182
10860
|
};
|
|
11183
10861
|
do {
|
|
11184
10862
|
base = this.parseSubscript(base, startLoc, noCalls, state);
|
|
11185
|
-
|
|
11186
10863
|
state.maybeAsyncArrow = false;
|
|
11187
10864
|
} while (!state.stop);
|
|
11188
10865
|
return base;
|
|
11189
10866
|
}
|
|
11190
|
-
|
|
11191
10867
|
parseSubscript(base, startLoc, noCalls, state) {
|
|
11192
10868
|
const {
|
|
11193
10869
|
type
|
|
@@ -11218,7 +10894,6 @@ class ExpressionParser extends LValParser {
|
|
|
11218
10894
|
}
|
|
11219
10895
|
}
|
|
11220
10896
|
}
|
|
11221
|
-
|
|
11222
10897
|
parseMember(base, startLoc, state, computed, optional) {
|
|
11223
10898
|
const node = this.startNodeAt(startLoc);
|
|
11224
10899
|
node.object = base;
|
|
@@ -11244,7 +10919,6 @@ class ExpressionParser extends LValParser {
|
|
|
11244
10919
|
return this.finishNode(node, "MemberExpression");
|
|
11245
10920
|
}
|
|
11246
10921
|
}
|
|
11247
|
-
|
|
11248
10922
|
parseBind(base, startLoc, noCalls, state) {
|
|
11249
10923
|
const node = this.startNodeAt(startLoc);
|
|
11250
10924
|
node.object = base;
|
|
@@ -11253,13 +10927,11 @@ class ExpressionParser extends LValParser {
|
|
|
11253
10927
|
state.stop = true;
|
|
11254
10928
|
return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls);
|
|
11255
10929
|
}
|
|
11256
|
-
|
|
11257
10930
|
parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) {
|
|
11258
10931
|
const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
|
|
11259
10932
|
let refExpressionErrors = null;
|
|
11260
10933
|
this.state.maybeInArrowParameters = true;
|
|
11261
10934
|
this.next();
|
|
11262
|
-
|
|
11263
10935
|
const node = this.startNodeAt(startLoc);
|
|
11264
10936
|
node.callee = base;
|
|
11265
10937
|
const {
|
|
@@ -11276,8 +10948,7 @@ class ExpressionParser extends LValParser {
|
|
|
11276
10948
|
if (optional) {
|
|
11277
10949
|
node.arguments = this.parseCallExpressionArguments(11);
|
|
11278
10950
|
} else {
|
|
11279
|
-
node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type !== "Super",
|
|
11280
|
-
node, refExpressionErrors);
|
|
10951
|
+
node.arguments = this.parseCallExpressionArguments(11, base.type === "Import", base.type !== "Super", node, refExpressionErrors);
|
|
11281
10952
|
}
|
|
11282
10953
|
let finishedNode = this.finishCallExpression(node, optionalChainMember);
|
|
11283
10954
|
if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
|
|
@@ -11299,7 +10970,6 @@ class ExpressionParser extends LValParser {
|
|
|
11299
10970
|
toReferencedArguments(node, isParenthesizedExpr) {
|
|
11300
10971
|
this.toReferencedListDeep(node.arguments, isParenthesizedExpr);
|
|
11301
10972
|
}
|
|
11302
|
-
|
|
11303
10973
|
parseTaggedTemplateExpression(base, startLoc, state) {
|
|
11304
10974
|
const node = this.startNodeAt(startLoc);
|
|
11305
10975
|
node.tag = base;
|
|
@@ -11312,8 +10982,7 @@ class ExpressionParser extends LValParser {
|
|
|
11312
10982
|
return this.finishNode(node, "TaggedTemplateExpression");
|
|
11313
10983
|
}
|
|
11314
10984
|
atPossibleAsyncArrow(base) {
|
|
11315
|
-
return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() &&
|
|
11316
|
-
base.end - base.start === 5 && base.start === this.state.potentialArrowAt;
|
|
10985
|
+
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;
|
|
11317
10986
|
}
|
|
11318
10987
|
finishCallExpression(node, optional) {
|
|
11319
10988
|
if (node.callee.type === "Import") {
|
|
@@ -11385,12 +11054,10 @@ class ExpressionParser extends LValParser {
|
|
|
11385
11054
|
}
|
|
11386
11055
|
return node;
|
|
11387
11056
|
}
|
|
11388
|
-
|
|
11389
11057
|
parseNoCallExpr() {
|
|
11390
11058
|
const startLoc = this.state.startLoc;
|
|
11391
11059
|
return this.parseSubscripts(this.parseExprAtom(), startLoc, true);
|
|
11392
11060
|
}
|
|
11393
|
-
|
|
11394
11061
|
parseExprAtom(refExpressionErrors) {
|
|
11395
11062
|
let node;
|
|
11396
11063
|
let decorators = null;
|
|
@@ -11474,7 +11141,6 @@ class ExpressionParser extends LValParser {
|
|
|
11474
11141
|
case 25:
|
|
11475
11142
|
case 24:
|
|
11476
11143
|
return this.parseTemplate(false);
|
|
11477
|
-
|
|
11478
11144
|
case 15:
|
|
11479
11145
|
{
|
|
11480
11146
|
node = this.startNode();
|
|
@@ -11524,8 +11190,7 @@ class ExpressionParser extends LValParser {
|
|
|
11524
11190
|
case 47:
|
|
11525
11191
|
{
|
|
11526
11192
|
const lookaheadCh = this.input.codePointAt(this.nextTokenStart());
|
|
11527
|
-
if (isIdentifierStart(lookaheadCh) ||
|
|
11528
|
-
lookaheadCh === 62) {
|
|
11193
|
+
if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) {
|
|
11529
11194
|
this.expectOnePlugin(["jsx", "flow", "typescript"]);
|
|
11530
11195
|
break;
|
|
11531
11196
|
} else {
|
|
@@ -11569,7 +11234,6 @@ class ExpressionParser extends LValParser {
|
|
|
11569
11234
|
}
|
|
11570
11235
|
}
|
|
11571
11236
|
}
|
|
11572
|
-
|
|
11573
11237
|
parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) {
|
|
11574
11238
|
const pipeProposal = this.getPluginOption("pipelineOperator", "proposal");
|
|
11575
11239
|
if (pipeProposal) {
|
|
@@ -11583,30 +11247,21 @@ class ExpressionParser extends LValParser {
|
|
|
11583
11247
|
throw this.unexpected();
|
|
11584
11248
|
}
|
|
11585
11249
|
}
|
|
11586
|
-
|
|
11587
11250
|
parseTopicReference(pipeProposal) {
|
|
11588
11251
|
const node = this.startNode();
|
|
11589
11252
|
const startLoc = this.state.startLoc;
|
|
11590
11253
|
const tokenType = this.state.type;
|
|
11591
|
-
|
|
11592
11254
|
this.next();
|
|
11593
|
-
|
|
11594
11255
|
return this.finishTopicReference(node, startLoc, pipeProposal, tokenType);
|
|
11595
11256
|
}
|
|
11596
|
-
|
|
11597
11257
|
finishTopicReference(node, startLoc, pipeProposal, tokenType) {
|
|
11598
11258
|
if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) {
|
|
11599
|
-
|
|
11600
|
-
const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" :
|
|
11601
|
-
"TopicReference";
|
|
11259
|
+
const nodeType = pipeProposal === "smart" ? "PipelinePrimaryTopicReference" : "TopicReference";
|
|
11602
11260
|
if (!this.topicReferenceIsAllowedInCurrentContext()) {
|
|
11603
|
-
this.raise(
|
|
11604
|
-
pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed :
|
|
11605
|
-
Errors.PipeTopicUnbound, {
|
|
11261
|
+
this.raise(pipeProposal === "smart" ? Errors.PrimaryTopicNotAllowed : Errors.PipeTopicUnbound, {
|
|
11606
11262
|
at: startLoc
|
|
11607
11263
|
});
|
|
11608
11264
|
}
|
|
11609
|
-
|
|
11610
11265
|
this.registerTopicReference();
|
|
11611
11266
|
return this.finishNode(node, nodeType);
|
|
11612
11267
|
} else {
|
|
@@ -11616,7 +11271,6 @@ class ExpressionParser extends LValParser {
|
|
|
11616
11271
|
});
|
|
11617
11272
|
}
|
|
11618
11273
|
}
|
|
11619
|
-
|
|
11620
11274
|
testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) {
|
|
11621
11275
|
switch (pipeProposal) {
|
|
11622
11276
|
case "hack":
|
|
@@ -11633,7 +11287,6 @@ class ExpressionParser extends LValParser {
|
|
|
11633
11287
|
});
|
|
11634
11288
|
}
|
|
11635
11289
|
}
|
|
11636
|
-
|
|
11637
11290
|
parseAsyncArrowUnaryFunction(node) {
|
|
11638
11291
|
this.prodParam.enter(functionFlags(true, this.prodParam.hasYield));
|
|
11639
11292
|
const params = [this.parseIdentifier()];
|
|
@@ -11646,7 +11299,6 @@ class ExpressionParser extends LValParser {
|
|
|
11646
11299
|
this.expect(19);
|
|
11647
11300
|
return this.parseArrowExpression(node, params, true);
|
|
11648
11301
|
}
|
|
11649
|
-
|
|
11650
11302
|
parseDo(node, isAsync) {
|
|
11651
11303
|
this.expectPlugin("doExpressions");
|
|
11652
11304
|
if (isAsync) {
|
|
@@ -11666,7 +11318,6 @@ class ExpressionParser extends LValParser {
|
|
|
11666
11318
|
this.state.labels = oldLabels;
|
|
11667
11319
|
return this.finishNode(node, "DoExpression");
|
|
11668
11320
|
}
|
|
11669
|
-
|
|
11670
11321
|
parseSuper() {
|
|
11671
11322
|
const node = this.startNode();
|
|
11672
11323
|
this.next();
|
|
@@ -11688,8 +11339,7 @@ class ExpressionParser extends LValParser {
|
|
|
11688
11339
|
}
|
|
11689
11340
|
parsePrivateName() {
|
|
11690
11341
|
const node = this.startNode();
|
|
11691
|
-
const id = this.startNodeAt(
|
|
11692
|
-
createPositionWithColumnOffset(this.state.startLoc, 1));
|
|
11342
|
+
const id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1));
|
|
11693
11343
|
const name = this.state.value;
|
|
11694
11344
|
this.next();
|
|
11695
11345
|
node.id = this.createIdentifier(id, name);
|
|
@@ -11697,9 +11347,7 @@ class ExpressionParser extends LValParser {
|
|
|
11697
11347
|
}
|
|
11698
11348
|
parseFunctionOrFunctionSent() {
|
|
11699
11349
|
const node = this.startNode();
|
|
11700
|
-
|
|
11701
11350
|
this.next();
|
|
11702
|
-
|
|
11703
11351
|
if (this.prodParam.hasYield && this.match(16)) {
|
|
11704
11352
|
const meta = this.createIdentifier(this.startNodeAtNode(node), "function");
|
|
11705
11353
|
this.next();
|
|
@@ -11725,11 +11373,9 @@ class ExpressionParser extends LValParser {
|
|
|
11725
11373
|
}
|
|
11726
11374
|
return this.finishNode(node, "MetaProperty");
|
|
11727
11375
|
}
|
|
11728
|
-
|
|
11729
11376
|
parseImportMetaProperty(node) {
|
|
11730
11377
|
const id = this.createIdentifier(this.startNodeAtNode(node), "import");
|
|
11731
11378
|
this.next();
|
|
11732
|
-
|
|
11733
11379
|
if (this.isContextual(100)) {
|
|
11734
11380
|
if (!this.inModule) {
|
|
11735
11381
|
this.raise(Errors.ImportMetaOutsideModule, {
|
|
@@ -11780,7 +11426,6 @@ class ExpressionParser extends LValParser {
|
|
|
11780
11426
|
this.next();
|
|
11781
11427
|
return this.finishNode(node, "NullLiteral");
|
|
11782
11428
|
}
|
|
11783
|
-
|
|
11784
11429
|
parseParenAndDistinguishExpression(canBeArrow) {
|
|
11785
11430
|
const startLoc = this.state.startLoc;
|
|
11786
11431
|
let val;
|
|
@@ -11845,8 +11490,7 @@ class ExpressionParser extends LValParser {
|
|
|
11845
11490
|
} else {
|
|
11846
11491
|
val = exprList[0];
|
|
11847
11492
|
}
|
|
11848
|
-
return this.wrapParenthesis(startLoc,
|
|
11849
|
-
val);
|
|
11493
|
+
return this.wrapParenthesis(startLoc, val);
|
|
11850
11494
|
}
|
|
11851
11495
|
wrapParenthesis(startLoc, expression) {
|
|
11852
11496
|
if (!this.options.createParenthesizedExpressions) {
|
|
@@ -11859,7 +11503,6 @@ class ExpressionParser extends LValParser {
|
|
|
11859
11503
|
parenExpression.expression = expression;
|
|
11860
11504
|
return this.finishNode(parenExpression, "ParenthesizedExpression");
|
|
11861
11505
|
}
|
|
11862
|
-
|
|
11863
11506
|
shouldParseArrow(params) {
|
|
11864
11507
|
return !this.canInsertSemicolon();
|
|
11865
11508
|
}
|
|
@@ -11868,8 +11511,7 @@ class ExpressionParser extends LValParser {
|
|
|
11868
11511
|
return node;
|
|
11869
11512
|
}
|
|
11870
11513
|
}
|
|
11871
|
-
parseParenItem(node,
|
|
11872
|
-
startLoc) {
|
|
11514
|
+
parseParenItem(node, startLoc) {
|
|
11873
11515
|
return node;
|
|
11874
11516
|
}
|
|
11875
11517
|
parseNewOrNewTarget() {
|
|
@@ -11888,7 +11530,6 @@ class ExpressionParser extends LValParser {
|
|
|
11888
11530
|
}
|
|
11889
11531
|
return this.parseNew(node);
|
|
11890
11532
|
}
|
|
11891
|
-
|
|
11892
11533
|
parseNew(node) {
|
|
11893
11534
|
this.parseNewCallee(node);
|
|
11894
11535
|
if (this.eat(10)) {
|
|
@@ -11916,7 +11557,6 @@ class ExpressionParser extends LValParser {
|
|
|
11916
11557
|
});
|
|
11917
11558
|
}
|
|
11918
11559
|
}
|
|
11919
|
-
|
|
11920
11560
|
parseTemplateElement(isTagged) {
|
|
11921
11561
|
const {
|
|
11922
11562
|
start,
|
|
@@ -11946,7 +11586,6 @@ class ExpressionParser extends LValParser {
|
|
|
11946
11586
|
this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset));
|
|
11947
11587
|
return finishedNode;
|
|
11948
11588
|
}
|
|
11949
|
-
|
|
11950
11589
|
parseTemplate(isTagged) {
|
|
11951
11590
|
const node = this.startNode();
|
|
11952
11591
|
node.expressions = [];
|
|
@@ -11959,11 +11598,9 @@ class ExpressionParser extends LValParser {
|
|
|
11959
11598
|
}
|
|
11960
11599
|
return this.finishNode(node, "TemplateLiteral");
|
|
11961
11600
|
}
|
|
11962
|
-
|
|
11963
11601
|
parseTemplateSubstitution() {
|
|
11964
11602
|
return this.parseExpression();
|
|
11965
11603
|
}
|
|
11966
|
-
|
|
11967
11604
|
parseObjectLike(close, isPattern, isRecord, refExpressionErrors) {
|
|
11968
11605
|
if (isRecord) {
|
|
11969
11606
|
this.expectPlugin("recordAndTuple");
|
|
@@ -11981,8 +11618,7 @@ class ExpressionParser extends LValParser {
|
|
|
11981
11618
|
} else {
|
|
11982
11619
|
this.expect(12);
|
|
11983
11620
|
if (this.match(close)) {
|
|
11984
|
-
this.addTrailingCommaExtraToNode(
|
|
11985
|
-
node);
|
|
11621
|
+
this.addTrailingCommaExtraToNode(node);
|
|
11986
11622
|
break;
|
|
11987
11623
|
}
|
|
11988
11624
|
}
|
|
@@ -11998,11 +11634,9 @@ class ExpressionParser extends LValParser {
|
|
|
11998
11634
|
at: prop
|
|
11999
11635
|
});
|
|
12000
11636
|
}
|
|
12001
|
-
|
|
12002
11637
|
if (prop.shorthand) {
|
|
12003
11638
|
this.addExtra(prop, "shorthand", true);
|
|
12004
11639
|
}
|
|
12005
|
-
|
|
12006
11640
|
node.properties.push(prop);
|
|
12007
11641
|
}
|
|
12008
11642
|
this.next();
|
|
@@ -12019,11 +11653,9 @@ class ExpressionParser extends LValParser {
|
|
|
12019
11653
|
this.addExtra(node, "trailingComma", this.state.lastTokStart);
|
|
12020
11654
|
this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false);
|
|
12021
11655
|
}
|
|
12022
|
-
|
|
12023
11656
|
maybeAsyncOrAccessorProp(prop) {
|
|
12024
11657
|
return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55));
|
|
12025
11658
|
}
|
|
12026
|
-
|
|
12027
11659
|
parsePropertyDefinition(refExpressionErrors) {
|
|
12028
11660
|
let decorators = [];
|
|
12029
11661
|
if (this.match(26)) {
|
|
@@ -12032,7 +11664,6 @@ class ExpressionParser extends LValParser {
|
|
|
12032
11664
|
at: this.state.startLoc
|
|
12033
11665
|
});
|
|
12034
11666
|
}
|
|
12035
|
-
|
|
12036
11667
|
while (this.match(26)) {
|
|
12037
11668
|
decorators.push(this.parseDecorator());
|
|
12038
11669
|
}
|
|
@@ -12085,11 +11716,9 @@ class ExpressionParser extends LValParser {
|
|
|
12085
11716
|
getGetterSetterExpectedParamCount(method) {
|
|
12086
11717
|
return method.kind === "get" ? 0 : 1;
|
|
12087
11718
|
}
|
|
12088
|
-
|
|
12089
11719
|
getObjectOrClassMethodParams(method) {
|
|
12090
11720
|
return method.params;
|
|
12091
11721
|
}
|
|
12092
|
-
|
|
12093
11722
|
checkGetterSetterParams(method) {
|
|
12094
11723
|
var _params;
|
|
12095
11724
|
const paramCount = this.getGetterSetterExpectedParamCount(method);
|
|
@@ -12105,11 +11734,9 @@ class ExpressionParser extends LValParser {
|
|
|
12105
11734
|
});
|
|
12106
11735
|
}
|
|
12107
11736
|
}
|
|
12108
|
-
|
|
12109
11737
|
parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
|
|
12110
11738
|
if (isAccessor) {
|
|
12111
|
-
const finishedProp = this.parseMethod(prop,
|
|
12112
|
-
isGenerator, false, false, false, "ObjectMethod");
|
|
11739
|
+
const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod");
|
|
12113
11740
|
this.checkGetterSetterParams(finishedProp);
|
|
12114
11741
|
return finishedProp;
|
|
12115
11742
|
}
|
|
@@ -12120,7 +11747,6 @@ class ExpressionParser extends LValParser {
|
|
|
12120
11747
|
return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod");
|
|
12121
11748
|
}
|
|
12122
11749
|
}
|
|
12123
|
-
|
|
12124
11750
|
parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
|
|
12125
11751
|
prop.shorthand = false;
|
|
12126
11752
|
if (this.eat(14)) {
|
|
@@ -12155,7 +11781,6 @@ class ExpressionParser extends LValParser {
|
|
|
12155
11781
|
if (!node) this.unexpected();
|
|
12156
11782
|
return node;
|
|
12157
11783
|
}
|
|
12158
|
-
|
|
12159
11784
|
parsePropertyName(prop, refExpressionErrors) {
|
|
12160
11785
|
if (this.eat(0)) {
|
|
12161
11786
|
prop.computed = true;
|
|
@@ -12209,13 +11834,11 @@ class ExpressionParser extends LValParser {
|
|
|
12209
11834
|
}
|
|
12210
11835
|
return prop.key;
|
|
12211
11836
|
}
|
|
12212
|
-
|
|
12213
11837
|
initFunction(node, isAsync) {
|
|
12214
11838
|
node.id = null;
|
|
12215
11839
|
node.generator = false;
|
|
12216
11840
|
node.async = isAsync;
|
|
12217
11841
|
}
|
|
12218
|
-
|
|
12219
11842
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
|
|
12220
11843
|
this.initFunction(node, isAsync);
|
|
12221
11844
|
node.generator = isGenerator;
|
|
@@ -12228,7 +11851,6 @@ class ExpressionParser extends LValParser {
|
|
|
12228
11851
|
this.scope.exit();
|
|
12229
11852
|
return finishedNode;
|
|
12230
11853
|
}
|
|
12231
|
-
|
|
12232
11854
|
parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) {
|
|
12233
11855
|
if (isTuple) {
|
|
12234
11856
|
this.expectPlugin("recordAndTuple");
|
|
@@ -12237,12 +11859,10 @@ class ExpressionParser extends LValParser {
|
|
|
12237
11859
|
this.state.inFSharpPipelineDirectBody = false;
|
|
12238
11860
|
const node = this.startNode();
|
|
12239
11861
|
this.next();
|
|
12240
|
-
node.elements = this.parseExprList(close, !isTuple, refExpressionErrors,
|
|
12241
|
-
node);
|
|
11862
|
+
node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node);
|
|
12242
11863
|
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
12243
11864
|
return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression");
|
|
12244
11865
|
}
|
|
12245
|
-
|
|
12246
11866
|
parseArrowExpression(node, params, isAsync, trailingCommaLoc) {
|
|
12247
11867
|
this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
|
|
12248
11868
|
let flags = functionFlags(isAsync, false);
|
|
@@ -12271,7 +11891,6 @@ class ExpressionParser extends LValParser {
|
|
|
12271
11891
|
this.parseFunctionBody(node, false, isMethod);
|
|
12272
11892
|
return this.finishNode(node, type);
|
|
12273
11893
|
}
|
|
12274
|
-
|
|
12275
11894
|
parseFunctionBody(node, allowExpression, isMethod = false) {
|
|
12276
11895
|
const isExpression = allowExpression && !this.match(5);
|
|
12277
11896
|
this.expressionScope.enter(newExpressionScope());
|
|
@@ -12282,23 +11901,16 @@ class ExpressionParser extends LValParser {
|
|
|
12282
11901
|
const oldStrict = this.state.strict;
|
|
12283
11902
|
const oldLabels = this.state.labels;
|
|
12284
11903
|
this.state.labels = [];
|
|
12285
|
-
|
|
12286
11904
|
this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);
|
|
12287
|
-
node.body = this.parseBlock(true, false,
|
|
12288
|
-
hasStrictModeDirective => {
|
|
11905
|
+
node.body = this.parseBlock(true, false, hasStrictModeDirective => {
|
|
12289
11906
|
const nonSimple = !this.isSimpleParamList(node.params);
|
|
12290
11907
|
if (hasStrictModeDirective && nonSimple) {
|
|
12291
11908
|
this.raise(Errors.IllegalLanguageModeDirective, {
|
|
12292
|
-
at:
|
|
12293
|
-
(node.kind === "method" || node.kind === "constructor") &&
|
|
12294
|
-
!!node.key ?
|
|
12295
|
-
node.key.loc.end : node
|
|
11909
|
+
at: (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node
|
|
12296
11910
|
});
|
|
12297
11911
|
}
|
|
12298
11912
|
const strictModeChanged = !oldStrict && this.state.strict;
|
|
12299
|
-
|
|
12300
11913
|
this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
|
|
12301
|
-
|
|
12302
11914
|
if (this.state.strict && node.id) {
|
|
12303
11915
|
this.checkIdentifier(node.id, BIND_OUTSIDE, strictModeChanged);
|
|
12304
11916
|
}
|
|
@@ -12317,8 +11929,7 @@ class ExpressionParser extends LValParser {
|
|
|
12317
11929
|
}
|
|
12318
11930
|
return true;
|
|
12319
11931
|
}
|
|
12320
|
-
checkParams(node, allowDuplicates,
|
|
12321
|
-
isArrowFunction, strictModeChanged = true) {
|
|
11932
|
+
checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
|
|
12322
11933
|
const checkClashes = !allowDuplicates && new Set();
|
|
12323
11934
|
const formalParameters = {
|
|
12324
11935
|
type: "FormalParameters"
|
|
@@ -12332,7 +11943,6 @@ class ExpressionParser extends LValParser {
|
|
|
12332
11943
|
});
|
|
12333
11944
|
}
|
|
12334
11945
|
}
|
|
12335
|
-
|
|
12336
11946
|
parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {
|
|
12337
11947
|
const elts = [];
|
|
12338
11948
|
let first = true;
|
|
@@ -12381,7 +11991,6 @@ class ExpressionParser extends LValParser {
|
|
|
12381
11991
|
}
|
|
12382
11992
|
return elt;
|
|
12383
11993
|
}
|
|
12384
|
-
|
|
12385
11994
|
parseIdentifier(liberal) {
|
|
12386
11995
|
const node = this.startNode();
|
|
12387
11996
|
const name = this.parseIdentifierName(liberal);
|
|
@@ -12474,7 +12083,6 @@ class ExpressionParser extends LValParser {
|
|
|
12474
12083
|
}
|
|
12475
12084
|
return false;
|
|
12476
12085
|
}
|
|
12477
|
-
|
|
12478
12086
|
parseAwait(startLoc) {
|
|
12479
12087
|
const node = this.startNodeAt(startLoc);
|
|
12480
12088
|
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, {
|
|
@@ -12502,13 +12110,8 @@ class ExpressionParser extends LValParser {
|
|
|
12502
12110
|
const {
|
|
12503
12111
|
type
|
|
12504
12112
|
} = this.state;
|
|
12505
|
-
return (
|
|
12506
|
-
type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 101 && !this.state.containsEsc ||
|
|
12507
|
-
type === 135 || type === 56 ||
|
|
12508
|
-
this.hasPlugin("v8intrinsic") && type === 54
|
|
12509
|
-
);
|
|
12113
|
+
return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 101 && !this.state.containsEsc || type === 135 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54;
|
|
12510
12114
|
}
|
|
12511
|
-
|
|
12512
12115
|
parseYield() {
|
|
12513
12116
|
const node = this.startNode();
|
|
12514
12117
|
this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, {
|
|
@@ -12537,7 +12140,6 @@ class ExpressionParser extends LValParser {
|
|
|
12537
12140
|
node.argument = argument;
|
|
12538
12141
|
return this.finishNode(node, "YieldExpression");
|
|
12539
12142
|
}
|
|
12540
|
-
|
|
12541
12143
|
checkPipelineAtInfixOperator(left, leftStartLoc) {
|
|
12542
12144
|
if (this.hasPlugin(["pipelineOperator", {
|
|
12543
12145
|
proposal: "smart"
|
|
@@ -12571,21 +12173,18 @@ class ExpressionParser extends LValParser {
|
|
|
12571
12173
|
return false;
|
|
12572
12174
|
}
|
|
12573
12175
|
}
|
|
12574
|
-
|
|
12575
12176
|
checkSmartPipeTopicBodyEarlyErrors(startLoc) {
|
|
12576
12177
|
if (this.match(19)) {
|
|
12577
12178
|
throw this.raise(Errors.PipelineBodyNoArrow, {
|
|
12578
12179
|
at: this.state.startLoc
|
|
12579
12180
|
});
|
|
12580
12181
|
}
|
|
12581
|
-
|
|
12582
12182
|
if (!this.topicReferenceWasUsedInCurrentContext()) {
|
|
12583
12183
|
this.raise(Errors.PipelineTopicUnused, {
|
|
12584
12184
|
at: startLoc
|
|
12585
12185
|
});
|
|
12586
12186
|
}
|
|
12587
12187
|
}
|
|
12588
|
-
|
|
12589
12188
|
withTopicBindingContext(callback) {
|
|
12590
12189
|
const outerContextTopicState = this.state.topicContext;
|
|
12591
12190
|
this.state.topicContext = {
|
|
@@ -12598,7 +12197,6 @@ class ExpressionParser extends LValParser {
|
|
|
12598
12197
|
this.state.topicContext = outerContextTopicState;
|
|
12599
12198
|
}
|
|
12600
12199
|
}
|
|
12601
|
-
|
|
12602
12200
|
withSmartMixTopicForbiddingContext(callback) {
|
|
12603
12201
|
if (this.hasPlugin(["pipelineOperator", {
|
|
12604
12202
|
proposal: "smart"
|
|
@@ -12652,7 +12250,6 @@ class ExpressionParser extends LValParser {
|
|
|
12652
12250
|
}
|
|
12653
12251
|
return callback();
|
|
12654
12252
|
}
|
|
12655
|
-
|
|
12656
12253
|
registerTopicReference() {
|
|
12657
12254
|
this.state.topicContext.maxTopicIndex = 0;
|
|
12658
12255
|
}
|
|
@@ -12671,7 +12268,6 @@ class ExpressionParser extends LValParser {
|
|
|
12671
12268
|
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
12672
12269
|
return ret;
|
|
12673
12270
|
}
|
|
12674
|
-
|
|
12675
12271
|
parseModuleExpression() {
|
|
12676
12272
|
this.expectPlugin("moduleBlocks");
|
|
12677
12273
|
const node = this.startNode();
|
|
@@ -12681,7 +12277,6 @@ class ExpressionParser extends LValParser {
|
|
|
12681
12277
|
}
|
|
12682
12278
|
const program = this.startNodeAt(this.state.endLoc);
|
|
12683
12279
|
this.next();
|
|
12684
|
-
|
|
12685
12280
|
const revertScopes = this.initializeScopes(true);
|
|
12686
12281
|
this.enterInitialScopes();
|
|
12687
12282
|
try {
|
|
@@ -12691,9 +12286,7 @@ class ExpressionParser extends LValParser {
|
|
|
12691
12286
|
}
|
|
12692
12287
|
return this.finishNode(node, "ModuleExpression");
|
|
12693
12288
|
}
|
|
12694
|
-
|
|
12695
|
-
parsePropertyNamePrefixOperator(
|
|
12696
|
-
prop) {}
|
|
12289
|
+
parsePropertyNamePrefixOperator(prop) {}
|
|
12697
12290
|
}
|
|
12698
12291
|
|
|
12699
12292
|
const loopLabel = {
|
|
@@ -12718,7 +12311,6 @@ var ParseStatementFlag = {
|
|
|
12718
12311
|
};
|
|
12719
12312
|
const loneSurrogate = /[\uD800-\uDFFF]/u;
|
|
12720
12313
|
const keywordRelationalOperator = /in(?:stanceof)?/y;
|
|
12721
|
-
|
|
12722
12314
|
function babel7CompatTokens(tokens, input) {
|
|
12723
12315
|
for (let i = 0; i < tokens.length; i++) {
|
|
12724
12316
|
const token = tokens[i];
|
|
@@ -12827,7 +12419,6 @@ function babel7CompatTokens(tokens, input) {
|
|
|
12827
12419
|
return tokens;
|
|
12828
12420
|
}
|
|
12829
12421
|
class StatementParser extends ExpressionParser {
|
|
12830
|
-
|
|
12831
12422
|
parseTopLevel(file, program) {
|
|
12832
12423
|
file.program = this.parseProgram(program);
|
|
12833
12424
|
file.comments = this.state.comments;
|
|
@@ -12856,7 +12447,6 @@ class StatementParser extends ExpressionParser {
|
|
|
12856
12447
|
}
|
|
12857
12448
|
return finishedProgram;
|
|
12858
12449
|
}
|
|
12859
|
-
|
|
12860
12450
|
stmtToDirective(stmt) {
|
|
12861
12451
|
const directive = stmt;
|
|
12862
12452
|
directive.type = "Directive";
|
|
@@ -12866,7 +12456,6 @@ class StatementParser extends ExpressionParser {
|
|
|
12866
12456
|
const expressionValue = directiveLiteral.value;
|
|
12867
12457
|
const raw = this.input.slice(directiveLiteral.start, directiveLiteral.end);
|
|
12868
12458
|
const val = directiveLiteral.value = raw.slice(1, -1);
|
|
12869
|
-
|
|
12870
12459
|
this.addExtra(directiveLiteral, "raw", raw);
|
|
12871
12460
|
this.addExtra(directiveLiteral, "rawValue", val);
|
|
12872
12461
|
this.addExtra(directiveLiteral, "expressionValue", expressionValue);
|
|
@@ -12907,13 +12496,11 @@ class StatementParser extends ExpressionParser {
|
|
|
12907
12496
|
chStartsBindingPattern(ch) {
|
|
12908
12497
|
return ch === 91 || ch === 123;
|
|
12909
12498
|
}
|
|
12910
|
-
|
|
12911
12499
|
hasFollowingBindingAtom() {
|
|
12912
12500
|
const next = this.nextTokenStart();
|
|
12913
12501
|
const nextCh = this.codePointAtPos(next);
|
|
12914
12502
|
return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next);
|
|
12915
12503
|
}
|
|
12916
|
-
|
|
12917
12504
|
hasFollowingBindingIdentifier() {
|
|
12918
12505
|
const next = this.nextTokenStart();
|
|
12919
12506
|
const nextCh = this.codePointAtPos(next);
|
|
@@ -12928,22 +12515,18 @@ class StatementParser extends ExpressionParser {
|
|
|
12928
12515
|
return true;
|
|
12929
12516
|
}
|
|
12930
12517
|
}
|
|
12931
|
-
|
|
12932
12518
|
parseModuleItem() {
|
|
12933
12519
|
return this.parseStatementLike(ParseStatementFlag.AllowImportExport | ParseStatementFlag.AllowDeclaration | ParseStatementFlag.AllowFunctionDeclaration | ParseStatementFlag.AllowLabeledFunction);
|
|
12934
12520
|
}
|
|
12935
|
-
|
|
12936
12521
|
parseStatementListItem() {
|
|
12937
12522
|
return this.parseStatementLike(ParseStatementFlag.AllowDeclaration | ParseStatementFlag.AllowFunctionDeclaration | ParseStatementFlag.AllowLabeledFunction);
|
|
12938
12523
|
}
|
|
12939
12524
|
parseStatementOrFunctionDeclaration(disallowLabeledFunction) {
|
|
12940
12525
|
return this.parseStatementLike(ParseStatementFlag.AllowFunctionDeclaration | (disallowLabeledFunction ? 0 : ParseStatementFlag.AllowLabeledFunction));
|
|
12941
12526
|
}
|
|
12942
|
-
|
|
12943
12527
|
parseStatement() {
|
|
12944
12528
|
return this.parseStatementLike(ParseStatementFlag.StatementOnly);
|
|
12945
12529
|
}
|
|
12946
|
-
|
|
12947
12530
|
parseStatementLike(flags) {
|
|
12948
12531
|
let decorators = null;
|
|
12949
12532
|
if (this.match(26)) {
|
|
@@ -12957,7 +12540,6 @@ class StatementParser extends ExpressionParser {
|
|
|
12957
12540
|
const allowDeclaration = !!(flags & ParseStatementFlag.AllowDeclaration);
|
|
12958
12541
|
const allowFunctionDeclaration = !!(flags & ParseStatementFlag.AllowFunctionDeclaration);
|
|
12959
12542
|
const topLevel = flags & ParseStatementFlag.AllowImportExport;
|
|
12960
|
-
|
|
12961
12543
|
switch (starttype) {
|
|
12962
12544
|
case 60:
|
|
12963
12545
|
return this.parseBreakContinueStatement(node, true);
|
|
@@ -13049,8 +12631,7 @@ class StatementParser extends ExpressionParser {
|
|
|
13049
12631
|
case 83:
|
|
13050
12632
|
{
|
|
13051
12633
|
const nextTokenCharCode = this.lookaheadCharCode();
|
|
13052
|
-
if (nextTokenCharCode === 40 ||
|
|
13053
|
-
nextTokenCharCode === 46) {
|
|
12634
|
+
if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
|
|
13054
12635
|
break;
|
|
13055
12636
|
}
|
|
13056
12637
|
}
|
|
@@ -13062,7 +12643,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13062
12643
|
});
|
|
13063
12644
|
}
|
|
13064
12645
|
this.next();
|
|
13065
|
-
|
|
13066
12646
|
let result;
|
|
13067
12647
|
if (starttype === 83) {
|
|
13068
12648
|
result = this.parseImport(node);
|
|
@@ -13091,12 +12671,10 @@ class StatementParser extends ExpressionParser {
|
|
|
13091
12671
|
}
|
|
13092
12672
|
}
|
|
13093
12673
|
}
|
|
13094
|
-
|
|
13095
12674
|
const maybeName = this.state.value;
|
|
13096
12675
|
const expr = this.parseExpression();
|
|
13097
12676
|
if (tokenIsIdentifier(starttype) && expr.type === "Identifier" && this.eat(14)) {
|
|
13098
|
-
return this.parseLabeledStatement(node, maybeName,
|
|
13099
|
-
expr, flags);
|
|
12677
|
+
return this.parseLabeledStatement(node, maybeName, expr, flags);
|
|
13100
12678
|
} else {
|
|
13101
12679
|
return this.parseExpressionStatement(node, expr, decorators);
|
|
13102
12680
|
}
|
|
@@ -13112,7 +12690,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13112
12690
|
if (this.hasPlugin("decorators-legacy")) return true;
|
|
13113
12691
|
return this.hasPlugin("decorators") && !!this.getPluginOption("decorators", "decoratorsBeforeExport");
|
|
13114
12692
|
}
|
|
13115
|
-
|
|
13116
12693
|
maybeTakeDecorators(maybeDecorators, classNode, exportNode) {
|
|
13117
12694
|
if (maybeDecorators) {
|
|
13118
12695
|
classNode.decorators = maybeDecorators;
|
|
@@ -13235,21 +12812,16 @@ class StatementParser extends ExpressionParser {
|
|
|
13235
12812
|
this.expect(11);
|
|
13236
12813
|
return val;
|
|
13237
12814
|
}
|
|
13238
|
-
|
|
13239
12815
|
parseDoWhileStatement(node) {
|
|
13240
12816
|
this.next();
|
|
13241
12817
|
this.state.labels.push(loopLabel);
|
|
13242
|
-
|
|
13243
|
-
node.body =
|
|
13244
|
-
this.withSmartMixTopicForbiddingContext(() =>
|
|
13245
|
-
this.parseStatement());
|
|
12818
|
+
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
13246
12819
|
this.state.labels.pop();
|
|
13247
12820
|
this.expect(92);
|
|
13248
12821
|
node.test = this.parseHeaderExpression();
|
|
13249
12822
|
this.eat(13);
|
|
13250
12823
|
return this.finishNode(node, "DoWhileStatement");
|
|
13251
12824
|
}
|
|
13252
|
-
|
|
13253
12825
|
parseForStatement(node) {
|
|
13254
12826
|
this.next();
|
|
13255
12827
|
this.state.labels.push(loopLabel);
|
|
@@ -13288,7 +12860,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13288
12860
|
}
|
|
13289
12861
|
return this.parseFor(node, init);
|
|
13290
12862
|
}
|
|
13291
|
-
|
|
13292
12863
|
const startsWithAsync = this.isContextual(95);
|
|
13293
12864
|
const refExpressionErrors = new ExpressionErrors();
|
|
13294
12865
|
const init = this.parseExpression(true, refExpressionErrors);
|
|
@@ -13299,8 +12870,7 @@ class StatementParser extends ExpressionParser {
|
|
|
13299
12870
|
at: init
|
|
13300
12871
|
});
|
|
13301
12872
|
}
|
|
13302
|
-
if (
|
|
13303
|
-
awaitAt === null && startsWithAsync && init.type === "Identifier") {
|
|
12873
|
+
if (awaitAt === null && startsWithAsync && init.type === "Identifier") {
|
|
13304
12874
|
this.raise(Errors.ForOfAsync, {
|
|
13305
12875
|
at: init
|
|
13306
12876
|
});
|
|
@@ -13315,8 +12885,7 @@ class StatementParser extends ExpressionParser {
|
|
|
13315
12885
|
type
|
|
13316
12886
|
}
|
|
13317
12887
|
});
|
|
13318
|
-
return this.parseForIn(node,
|
|
13319
|
-
init, awaitAt);
|
|
12888
|
+
return this.parseForIn(node, init, awaitAt);
|
|
13320
12889
|
} else {
|
|
13321
12890
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
13322
12891
|
}
|
|
@@ -13325,17 +12894,14 @@ class StatementParser extends ExpressionParser {
|
|
|
13325
12894
|
}
|
|
13326
12895
|
return this.parseFor(node, init);
|
|
13327
12896
|
}
|
|
13328
|
-
|
|
13329
12897
|
parseFunctionStatement(node, isAsync, isHangingDeclaration) {
|
|
13330
12898
|
this.next();
|
|
13331
12899
|
return this.parseFunction(node, ParseFunctionFlag.Declaration | (isHangingDeclaration ? ParseFunctionFlag.HangingDeclaration : 0) | (isAsync ? ParseFunctionFlag.Async : 0));
|
|
13332
12900
|
}
|
|
13333
|
-
|
|
13334
12901
|
parseIfStatement(node) {
|
|
13335
12902
|
this.next();
|
|
13336
12903
|
node.test = this.parseHeaderExpression();
|
|
13337
|
-
node.consequent = this.parseStatementOrFunctionDeclaration(
|
|
13338
|
-
true);
|
|
12904
|
+
node.consequent = this.parseStatementOrFunctionDeclaration(true);
|
|
13339
12905
|
node.alternate = this.eat(66) ? this.parseStatementOrFunctionDeclaration(true) : null;
|
|
13340
12906
|
return this.finishNode(node, "IfStatement");
|
|
13341
12907
|
}
|
|
@@ -13346,7 +12912,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13346
12912
|
});
|
|
13347
12913
|
}
|
|
13348
12914
|
this.next();
|
|
13349
|
-
|
|
13350
12915
|
if (this.isLineTerminator()) {
|
|
13351
12916
|
node.argument = null;
|
|
13352
12917
|
} else {
|
|
@@ -13355,7 +12920,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13355
12920
|
}
|
|
13356
12921
|
return this.finishNode(node, "ReturnStatement");
|
|
13357
12922
|
}
|
|
13358
|
-
|
|
13359
12923
|
parseSwitchStatement(node) {
|
|
13360
12924
|
this.next();
|
|
13361
12925
|
node.discriminant = this.parseHeaderExpression();
|
|
@@ -13363,7 +12927,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13363
12927
|
this.expect(5);
|
|
13364
12928
|
this.state.labels.push(switchLabel);
|
|
13365
12929
|
this.scope.enter(SCOPE_OTHER);
|
|
13366
|
-
|
|
13367
12930
|
let cur;
|
|
13368
12931
|
for (let sawDefault; !this.match(8);) {
|
|
13369
12932
|
if (this.match(61) || this.match(65)) {
|
|
@@ -13437,10 +13000,7 @@ class StatementParser extends ExpressionParser {
|
|
|
13437
13000
|
clause.param = null;
|
|
13438
13001
|
this.scope.enter(SCOPE_OTHER);
|
|
13439
13002
|
}
|
|
13440
|
-
|
|
13441
|
-
clause.body =
|
|
13442
|
-
this.withSmartMixTopicForbiddingContext(() =>
|
|
13443
|
-
this.parseBlock(false, false));
|
|
13003
|
+
clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false));
|
|
13444
13004
|
this.scope.exit();
|
|
13445
13005
|
node.handler = this.finishNode(clause, "CatchClause");
|
|
13446
13006
|
}
|
|
@@ -13452,22 +13012,17 @@ class StatementParser extends ExpressionParser {
|
|
|
13452
13012
|
}
|
|
13453
13013
|
return this.finishNode(node, "TryStatement");
|
|
13454
13014
|
}
|
|
13455
|
-
|
|
13456
13015
|
parseVarStatement(node, kind, allowMissingInitializer = false) {
|
|
13457
13016
|
this.next();
|
|
13458
13017
|
this.parseVar(node, false, kind, allowMissingInitializer);
|
|
13459
13018
|
this.semicolon();
|
|
13460
13019
|
return this.finishNode(node, "VariableDeclaration");
|
|
13461
13020
|
}
|
|
13462
|
-
|
|
13463
13021
|
parseWhileStatement(node) {
|
|
13464
13022
|
this.next();
|
|
13465
13023
|
node.test = this.parseHeaderExpression();
|
|
13466
13024
|
this.state.labels.push(loopLabel);
|
|
13467
|
-
|
|
13468
|
-
node.body =
|
|
13469
|
-
this.withSmartMixTopicForbiddingContext(() =>
|
|
13470
|
-
this.parseStatement());
|
|
13025
|
+
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
13471
13026
|
this.state.labels.pop();
|
|
13472
13027
|
return this.finishNode(node, "WhileStatement");
|
|
13473
13028
|
}
|
|
@@ -13479,17 +13034,13 @@ class StatementParser extends ExpressionParser {
|
|
|
13479
13034
|
}
|
|
13480
13035
|
this.next();
|
|
13481
13036
|
node.object = this.parseHeaderExpression();
|
|
13482
|
-
|
|
13483
|
-
node.body =
|
|
13484
|
-
this.withSmartMixTopicForbiddingContext(() =>
|
|
13485
|
-
this.parseStatement());
|
|
13037
|
+
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
13486
13038
|
return this.finishNode(node, "WithStatement");
|
|
13487
13039
|
}
|
|
13488
13040
|
parseEmptyStatement(node) {
|
|
13489
13041
|
this.next();
|
|
13490
13042
|
return this.finishNode(node, "EmptyStatement");
|
|
13491
13043
|
}
|
|
13492
|
-
|
|
13493
13044
|
parseLabeledStatement(node, maybeName, expr, flags) {
|
|
13494
13045
|
for (const label of this.state.labels) {
|
|
13495
13046
|
if (label.name === maybeName) {
|
|
@@ -13519,13 +13070,11 @@ class StatementParser extends ExpressionParser {
|
|
|
13519
13070
|
node.label = expr;
|
|
13520
13071
|
return this.finishNode(node, "LabeledStatement");
|
|
13521
13072
|
}
|
|
13522
|
-
parseExpressionStatement(node, expr,
|
|
13523
|
-
decorators) {
|
|
13073
|
+
parseExpressionStatement(node, expr, decorators) {
|
|
13524
13074
|
node.expression = expr;
|
|
13525
13075
|
this.semicolon();
|
|
13526
13076
|
return this.finishNode(node, "ExpressionStatement");
|
|
13527
13077
|
}
|
|
13528
|
-
|
|
13529
13078
|
parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) {
|
|
13530
13079
|
const node = this.startNode();
|
|
13531
13080
|
if (allowDirectives) {
|
|
@@ -13549,7 +13098,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13549
13098
|
const directives = node.directives = [];
|
|
13550
13099
|
this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse);
|
|
13551
13100
|
}
|
|
13552
|
-
|
|
13553
13101
|
parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) {
|
|
13554
13102
|
const oldStrict = this.state.strict;
|
|
13555
13103
|
let hasStrictModeDirective = false;
|
|
@@ -13579,7 +13127,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13579
13127
|
}
|
|
13580
13128
|
this.next();
|
|
13581
13129
|
}
|
|
13582
|
-
|
|
13583
13130
|
parseFor(node, init) {
|
|
13584
13131
|
node.init = init;
|
|
13585
13132
|
this.semicolon(false);
|
|
@@ -13587,15 +13134,11 @@ class StatementParser extends ExpressionParser {
|
|
|
13587
13134
|
this.semicolon(false);
|
|
13588
13135
|
node.update = this.match(11) ? null : this.parseExpression();
|
|
13589
13136
|
this.expect(11);
|
|
13590
|
-
|
|
13591
|
-
node.body =
|
|
13592
|
-
this.withSmartMixTopicForbiddingContext(() =>
|
|
13593
|
-
this.parseStatement());
|
|
13137
|
+
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
13594
13138
|
this.scope.exit();
|
|
13595
13139
|
this.state.labels.pop();
|
|
13596
13140
|
return this.finishNode(node, "ForStatement");
|
|
13597
13141
|
}
|
|
13598
|
-
|
|
13599
13142
|
parseForIn(node, init, awaitAt) {
|
|
13600
13143
|
const isForIn = this.match(58);
|
|
13601
13144
|
this.next();
|
|
@@ -13621,15 +13164,11 @@ class StatementParser extends ExpressionParser {
|
|
|
13621
13164
|
node.left = init;
|
|
13622
13165
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
13623
13166
|
this.expect(11);
|
|
13624
|
-
|
|
13625
|
-
node.body =
|
|
13626
|
-
this.withSmartMixTopicForbiddingContext(() =>
|
|
13627
|
-
this.parseStatement());
|
|
13167
|
+
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
13628
13168
|
this.scope.exit();
|
|
13629
13169
|
this.state.labels.pop();
|
|
13630
13170
|
return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
|
|
13631
13171
|
}
|
|
13632
|
-
|
|
13633
13172
|
parseVar(node, isFor, kind, allowMissingInitializer = false) {
|
|
13634
13173
|
const declarations = node.declarations = [];
|
|
13635
13174
|
node.kind = kind;
|
|
@@ -13665,11 +13204,9 @@ class StatementParser extends ExpressionParser {
|
|
|
13665
13204
|
});
|
|
13666
13205
|
decl.id = id;
|
|
13667
13206
|
}
|
|
13668
|
-
|
|
13669
13207
|
parseAsyncFunctionExpression(node) {
|
|
13670
13208
|
return this.parseFunction(node, ParseFunctionFlag.Async);
|
|
13671
13209
|
}
|
|
13672
|
-
|
|
13673
13210
|
parseFunction(node, flags = ParseFunctionFlag.Expression) {
|
|
13674
13211
|
const hangingDeclaration = flags & ParseFunctionFlag.HangingDeclaration;
|
|
13675
13212
|
const isDeclaration = !!(flags & ParseFunctionFlag.Declaration);
|
|
@@ -13696,7 +13233,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13696
13233
|
node.id = this.parseFunctionId();
|
|
13697
13234
|
}
|
|
13698
13235
|
this.parseFunctionParams(node, false);
|
|
13699
|
-
|
|
13700
13236
|
this.withSmartMixTopicForbiddingContext(() => {
|
|
13701
13237
|
this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression");
|
|
13702
13238
|
});
|
|
@@ -13719,13 +13255,10 @@ class StatementParser extends ExpressionParser {
|
|
|
13719
13255
|
}
|
|
13720
13256
|
registerFunctionStatementId(node) {
|
|
13721
13257
|
if (!node.id) return;
|
|
13722
|
-
|
|
13723
13258
|
this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.loc.start);
|
|
13724
13259
|
}
|
|
13725
|
-
|
|
13726
13260
|
parseClass(node, isStatement, optionalId) {
|
|
13727
13261
|
this.next();
|
|
13728
|
-
|
|
13729
13262
|
const oldStrict = this.state.strict;
|
|
13730
13263
|
this.state.strict = true;
|
|
13731
13264
|
this.parseClassId(node, isStatement, optionalId);
|
|
@@ -13740,10 +13273,8 @@ class StatementParser extends ExpressionParser {
|
|
|
13740
13273
|
return this.match(10);
|
|
13741
13274
|
}
|
|
13742
13275
|
isNonstaticConstructor(method) {
|
|
13743
|
-
return !method.computed && !method.static && (method.key.name === "constructor" ||
|
|
13744
|
-
method.key.value === "constructor");
|
|
13276
|
+
return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor");
|
|
13745
13277
|
}
|
|
13746
|
-
|
|
13747
13278
|
parseClassBody(hadSuperClass, oldStrict) {
|
|
13748
13279
|
this.classScope.enter();
|
|
13749
13280
|
const state = {
|
|
@@ -13754,7 +13285,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13754
13285
|
const classBody = this.startNode();
|
|
13755
13286
|
classBody.body = [];
|
|
13756
13287
|
this.expect(5);
|
|
13757
|
-
|
|
13758
13288
|
this.withSmartMixTopicForbiddingContext(() => {
|
|
13759
13289
|
while (!this.match(8)) {
|
|
13760
13290
|
if (this.eat(13)) {
|
|
@@ -13770,17 +13300,13 @@ class StatementParser extends ExpressionParser {
|
|
|
13770
13300
|
continue;
|
|
13771
13301
|
}
|
|
13772
13302
|
const member = this.startNode();
|
|
13773
|
-
|
|
13774
13303
|
if (decorators.length) {
|
|
13775
13304
|
member.decorators = decorators;
|
|
13776
13305
|
this.resetStartLocationFromNode(member, decorators[0]);
|
|
13777
13306
|
decorators = [];
|
|
13778
13307
|
}
|
|
13779
13308
|
this.parseClassMember(classBody, member, state);
|
|
13780
|
-
if (
|
|
13781
|
-
member.kind === "constructor" &&
|
|
13782
|
-
member.decorators &&
|
|
13783
|
-
member.decorators.length > 0) {
|
|
13309
|
+
if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
|
|
13784
13310
|
this.raise(Errors.DecoratorConstructor, {
|
|
13785
13311
|
at: member
|
|
13786
13312
|
});
|
|
@@ -13789,7 +13315,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13789
13315
|
});
|
|
13790
13316
|
this.state.strict = oldStrict;
|
|
13791
13317
|
this.next();
|
|
13792
|
-
|
|
13793
13318
|
if (decorators.length) {
|
|
13794
13319
|
throw this.raise(Errors.TrailingDecorator, {
|
|
13795
13320
|
at: this.state.startLoc
|
|
@@ -13798,13 +13323,10 @@ class StatementParser extends ExpressionParser {
|
|
|
13798
13323
|
this.classScope.exit();
|
|
13799
13324
|
return this.finishNode(classBody, "ClassBody");
|
|
13800
13325
|
}
|
|
13801
|
-
|
|
13802
13326
|
parseClassMemberFromModifier(classBody, member) {
|
|
13803
13327
|
const key = this.parseIdentifier(true);
|
|
13804
|
-
|
|
13805
13328
|
if (this.isClassMethod()) {
|
|
13806
13329
|
const method = member;
|
|
13807
|
-
|
|
13808
13330
|
method.kind = "method";
|
|
13809
13331
|
method.computed = false;
|
|
13810
13332
|
method.key = key;
|
|
@@ -13813,7 +13335,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13813
13335
|
return true;
|
|
13814
13336
|
} else if (this.isClassProperty()) {
|
|
13815
13337
|
const prop = member;
|
|
13816
|
-
|
|
13817
13338
|
prop.computed = false;
|
|
13818
13339
|
prop.key = key;
|
|
13819
13340
|
prop.static = false;
|
|
@@ -13873,12 +13394,10 @@ class StatementParser extends ExpressionParser {
|
|
|
13873
13394
|
this.pushClassPrivateMethod(classBody, privateMethod, false, false);
|
|
13874
13395
|
return;
|
|
13875
13396
|
}
|
|
13876
|
-
|
|
13877
13397
|
const isConstructor = this.isNonstaticConstructor(publicMethod);
|
|
13878
13398
|
let allowsDirectSuper = false;
|
|
13879
13399
|
if (isConstructor) {
|
|
13880
13400
|
publicMethod.kind = "constructor";
|
|
13881
|
-
|
|
13882
13401
|
if (state.hadConstructor && !this.hasPlugin("typescript")) {
|
|
13883
13402
|
this.raise(Errors.DuplicateConstructor, {
|
|
13884
13403
|
at: key
|
|
@@ -13938,7 +13457,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13938
13457
|
} else if (isContextual && key.name === "accessor" && !this.isLineTerminator()) {
|
|
13939
13458
|
this.expectPlugin("decoratorAutoAccessors");
|
|
13940
13459
|
this.resetPreviousNodeTrailingComments(key);
|
|
13941
|
-
|
|
13942
13460
|
const isPrivate = this.match(136);
|
|
13943
13461
|
this.parseClassElementName(publicProp);
|
|
13944
13462
|
this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);
|
|
@@ -13952,7 +13470,6 @@ class StatementParser extends ExpressionParser {
|
|
|
13952
13470
|
this.unexpected();
|
|
13953
13471
|
}
|
|
13954
13472
|
}
|
|
13955
|
-
|
|
13956
13473
|
parseClassElementName(member) {
|
|
13957
13474
|
const {
|
|
13958
13475
|
type,
|
|
@@ -14033,16 +13550,12 @@ class StatementParser extends ExpressionParser {
|
|
|
14033
13550
|
declareClassPrivateMethodInScope(node, kind) {
|
|
14034
13551
|
this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start);
|
|
14035
13552
|
}
|
|
14036
|
-
|
|
14037
|
-
parsePostMemberNameModifiers(
|
|
14038
|
-
methodOrProp) {}
|
|
14039
|
-
|
|
13553
|
+
parsePostMemberNameModifiers(methodOrProp) {}
|
|
14040
13554
|
parseClassPrivateProperty(node) {
|
|
14041
13555
|
this.parseInitializer(node);
|
|
14042
13556
|
this.semicolon();
|
|
14043
13557
|
return this.finishNode(node, "ClassPrivateProperty");
|
|
14044
13558
|
}
|
|
14045
|
-
|
|
14046
13559
|
parseClassProperty(node) {
|
|
14047
13560
|
this.parseInitializer(node);
|
|
14048
13561
|
this.semicolon();
|
|
@@ -14053,7 +13566,6 @@ class StatementParser extends ExpressionParser {
|
|
|
14053
13566
|
this.semicolon();
|
|
14054
13567
|
return this.finishNode(node, "ClassAccessorProperty");
|
|
14055
13568
|
}
|
|
14056
|
-
|
|
14057
13569
|
parseInitializer(node) {
|
|
14058
13570
|
this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
|
|
14059
13571
|
this.expressionScope.enter(newExpressionScope());
|
|
@@ -14079,19 +13591,14 @@ class StatementParser extends ExpressionParser {
|
|
|
14079
13591
|
}
|
|
14080
13592
|
}
|
|
14081
13593
|
}
|
|
14082
|
-
|
|
14083
13594
|
parseClassSuper(node) {
|
|
14084
13595
|
node.superClass = this.eat(81) ? this.parseExprSubscripts() : null;
|
|
14085
13596
|
}
|
|
14086
|
-
|
|
14087
13597
|
parseExport(node, decorators) {
|
|
14088
|
-
const hasDefault = this.maybeParseExportDefaultSpecifier(
|
|
14089
|
-
node);
|
|
13598
|
+
const hasDefault = this.maybeParseExportDefaultSpecifier(node);
|
|
14090
13599
|
const parseAfterDefault = !hasDefault || this.eat(12);
|
|
14091
|
-
const hasStar = parseAfterDefault && this.eatExportStar(
|
|
14092
|
-
node);
|
|
14093
|
-
const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(
|
|
14094
|
-
node);
|
|
13600
|
+
const hasStar = parseAfterDefault && this.eatExportStar(node);
|
|
13601
|
+
const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
|
|
14095
13602
|
const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12));
|
|
14096
13603
|
const isFromRequired = hasDefault || hasStar;
|
|
14097
13604
|
if (hasStar && !hasNamespace) {
|
|
@@ -14104,8 +13611,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14104
13611
|
this.parseExportFrom(node, true);
|
|
14105
13612
|
return this.finishNode(node, "ExportAllDeclaration");
|
|
14106
13613
|
}
|
|
14107
|
-
const hasSpecifiers = this.maybeParseExportNamedSpecifiers(
|
|
14108
|
-
node);
|
|
13614
|
+
const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
|
|
14109
13615
|
if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) {
|
|
14110
13616
|
throw this.unexpected(null, 5);
|
|
14111
13617
|
}
|
|
@@ -14150,7 +13656,6 @@ class StatementParser extends ExpressionParser {
|
|
|
14150
13656
|
}
|
|
14151
13657
|
throw this.unexpected(null, 5);
|
|
14152
13658
|
}
|
|
14153
|
-
|
|
14154
13659
|
eatExportStar(node) {
|
|
14155
13660
|
return this.eat(55);
|
|
14156
13661
|
}
|
|
@@ -14236,9 +13741,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14236
13741
|
this.semicolon();
|
|
14237
13742
|
return res;
|
|
14238
13743
|
}
|
|
14239
|
-
|
|
14240
|
-
parseExportDeclaration(
|
|
14241
|
-
node) {
|
|
13744
|
+
parseExportDeclaration(node) {
|
|
14242
13745
|
if (this.match(80)) {
|
|
14243
13746
|
const node = this.parseClass(this.startNode(), true, false);
|
|
14244
13747
|
return node;
|
|
@@ -14314,8 +13817,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14314
13817
|
if (this.hasPlugin("exportDefaultFrom")) {
|
|
14315
13818
|
var _declaration$extra;
|
|
14316
13819
|
const declaration = node.declaration;
|
|
14317
|
-
if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 &&
|
|
14318
|
-
!((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {
|
|
13820
|
+
if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) {
|
|
14319
13821
|
this.raise(Errors.ExportDefaultFromAsIdentifier, {
|
|
14320
13822
|
at: declaration
|
|
14321
13823
|
});
|
|
@@ -14393,11 +13895,9 @@ class StatementParser extends ExpressionParser {
|
|
|
14393
13895
|
}
|
|
14394
13896
|
this.exportedIdentifiers.add(exportName);
|
|
14395
13897
|
}
|
|
14396
|
-
|
|
14397
13898
|
parseExportSpecifiers(isInTypeExport) {
|
|
14398
13899
|
const nodes = [];
|
|
14399
13900
|
let first = true;
|
|
14400
|
-
|
|
14401
13901
|
this.expect(5);
|
|
14402
13902
|
while (!this.eat(8)) {
|
|
14403
13903
|
if (first) {
|
|
@@ -14414,9 +13914,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14414
13914
|
}
|
|
14415
13915
|
return nodes;
|
|
14416
13916
|
}
|
|
14417
|
-
parseExportSpecifier(node, isString,
|
|
14418
|
-
isInTypeExport, isMaybeTypeOnly
|
|
14419
|
-
) {
|
|
13917
|
+
parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) {
|
|
14420
13918
|
if (this.eatContextual(93)) {
|
|
14421
13919
|
node.exported = this.parseModuleExportName();
|
|
14422
13920
|
} else if (isString) {
|
|
@@ -14426,7 +13924,6 @@ class StatementParser extends ExpressionParser {
|
|
|
14426
13924
|
}
|
|
14427
13925
|
return this.finishNode(node, "ExportSpecifier");
|
|
14428
13926
|
}
|
|
14429
|
-
|
|
14430
13927
|
parseModuleExportName() {
|
|
14431
13928
|
if (this.match(131)) {
|
|
14432
13929
|
const result = this.parseStringLiteral(this.state.value);
|
|
@@ -14518,7 +14015,6 @@ class StatementParser extends ExpressionParser {
|
|
|
14518
14015
|
node.module = false;
|
|
14519
14016
|
}
|
|
14520
14017
|
}
|
|
14521
|
-
|
|
14522
14018
|
parseImport(node) {
|
|
14523
14019
|
node.specifiers = [];
|
|
14524
14020
|
if (!this.match(131)) {
|
|
@@ -14548,7 +14044,6 @@ class StatementParser extends ExpressionParser {
|
|
|
14548
14044
|
if (!this.match(131)) this.unexpected();
|
|
14549
14045
|
return this.parseExprAtom();
|
|
14550
14046
|
}
|
|
14551
|
-
|
|
14552
14047
|
shouldParseDefaultImport(node) {
|
|
14553
14048
|
return tokenIsIdentifier(this.state.type);
|
|
14554
14049
|
}
|
|
@@ -14563,7 +14058,6 @@ class StatementParser extends ExpressionParser {
|
|
|
14563
14058
|
});
|
|
14564
14059
|
return this.finishNode(specifier, type);
|
|
14565
14060
|
}
|
|
14566
|
-
|
|
14567
14061
|
parseAssertEntries() {
|
|
14568
14062
|
const attrs = [];
|
|
14569
14063
|
const attrNames = new Set();
|
|
@@ -14572,7 +14066,6 @@ class StatementParser extends ExpressionParser {
|
|
|
14572
14066
|
break;
|
|
14573
14067
|
}
|
|
14574
14068
|
const node = this.startNode();
|
|
14575
|
-
|
|
14576
14069
|
const keyName = this.state.value;
|
|
14577
14070
|
if (attrNames.has(keyName)) {
|
|
14578
14071
|
this.raise(Errors.ModuleAttributesWithDuplicateKeys, {
|
|
@@ -14597,7 +14090,6 @@ class StatementParser extends ExpressionParser {
|
|
|
14597
14090
|
} while (this.eat(12));
|
|
14598
14091
|
return attrs;
|
|
14599
14092
|
}
|
|
14600
|
-
|
|
14601
14093
|
maybeParseModuleAttributes() {
|
|
14602
14094
|
if (this.match(76) && !this.hasPrecedingLineBreak()) {
|
|
14603
14095
|
this.expectPlugin("moduleAttributes");
|
|
@@ -14688,10 +14180,7 @@ class StatementParser extends ExpressionParser {
|
|
|
14688
14180
|
node.specifiers.push(importSpecifier);
|
|
14689
14181
|
}
|
|
14690
14182
|
}
|
|
14691
|
-
|
|
14692
|
-
parseImportSpecifier(specifier, importedIsString,
|
|
14693
|
-
isInTypeOnlyImport, isMaybeTypeOnly, bindingType
|
|
14694
|
-
) {
|
|
14183
|
+
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) {
|
|
14695
14184
|
if (this.eatContextual(93)) {
|
|
14696
14185
|
specifier.local = this.parseIdentifier();
|
|
14697
14186
|
} else {
|
|
@@ -14711,14 +14200,12 @@ class StatementParser extends ExpressionParser {
|
|
|
14711
14200
|
}
|
|
14712
14201
|
return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType);
|
|
14713
14202
|
}
|
|
14714
|
-
|
|
14715
14203
|
isThisParam(param) {
|
|
14716
14204
|
return param.type === "Identifier" && param.name === "this";
|
|
14717
14205
|
}
|
|
14718
14206
|
}
|
|
14719
14207
|
|
|
14720
14208
|
class Parser extends StatementParser {
|
|
14721
|
-
|
|
14722
14209
|
constructor(options, input) {
|
|
14723
14210
|
options = getOptions(options);
|
|
14724
14211
|
super(options, input);
|
|
@@ -14727,7 +14214,6 @@ class Parser extends StatementParser {
|
|
|
14727
14214
|
this.plugins = pluginsMap(this.options.plugins);
|
|
14728
14215
|
this.filename = options.sourceFilename;
|
|
14729
14216
|
}
|
|
14730
|
-
|
|
14731
14217
|
getScopeHandler() {
|
|
14732
14218
|
return ScopeHandler;
|
|
14733
14219
|
}
|
|
@@ -14806,7 +14292,6 @@ function getParser(options, input) {
|
|
|
14806
14292
|
return new cls(options, input);
|
|
14807
14293
|
}
|
|
14808
14294
|
const parserClassCache = {};
|
|
14809
|
-
|
|
14810
14295
|
function getParserClass(pluginsFromOptions) {
|
|
14811
14296
|
const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name));
|
|
14812
14297
|
const key = pluginList.join("/");
|