Changeset e29cc2e for trip-planner-front/node_modules/acorn/dist/acorn.mjs
- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/node_modules/acorn/dist/acorn.mjs
r59329aa re29cc2e 13 13 var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; 14 14 15 var keywords = {15 var keywords$1 = { 16 16 5: ecma5AndLessKeywords, 17 17 "5module": ecma5AndLessKeywords + " export import", … … 132 132 // Map keyword names to token types. 133 133 134 var keywords $1= {};134 var keywords = {}; 135 135 136 136 // Succinct definitions of keyword token types … … 139 139 140 140 options.keyword = name; 141 return keywords $1[name] = new TokenType(name, options)141 return keywords[name] = new TokenType(name, options) 142 142 } 143 143 144 var types = {144 var types$1 = { 145 145 num: new TokenType("num", startsExpr), 146 146 regexp: new TokenType("regexp", startsExpr), … … 484 484 this.options = options = getOptions(options); 485 485 this.sourceFile = options.sourceFile; 486 this.keywords = wordsRegexp(keywords [options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);486 this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); 487 487 var reserved = ""; 488 488 if (options.allowReserved !== true) { … … 515 515 // Properties of the current token: 516 516 // Its type 517 this.type = types .eof;517 this.type = types$1.eof; 518 518 // For tokens that include more information than their type, the value 519 519 this.value = null; … … 575 575 576 576 prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; 577 577 578 prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit }; 579 578 580 prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit }; 581 579 582 prototypeAccessors.canAwait.get = function () { 580 583 for (var i = this.scopeStack.length - 1; i >= 0; i--) { … … 585 588 return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction 586 589 }; 590 587 591 prototypeAccessors.allowSuper.get = function () { 588 592 var ref = this.currentThisScope(); … … 591 595 return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod 592 596 }; 597 593 598 prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; 599 594 600 prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; 601 595 602 prototypeAccessors.allowNewDotTarget.get = function () { 596 603 var ref = this.currentThisScope(); … … 599 606 return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit 600 607 }; 608 601 609 prototypeAccessors.inClassStaticBlock.get = function () { 602 610 return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0 … … 628 636 Object.defineProperties( Parser.prototype, prototypeAccessors ); 629 637 630 var pp = Parser.prototype;638 var pp$9 = Parser.prototype; 631 639 632 640 // ## Parser utilities 633 641 634 642 var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; 635 pp .strictDirective = function(start) {643 pp$9.strictDirective = function(start) { 636 644 for (;;) { 637 645 // Try to find string literal. … … 661 669 // type, and if yes, consumes it as a side effect. 662 670 663 pp .eat = function(type) {671 pp$9.eat = function(type) { 664 672 if (this.type === type) { 665 673 this.next(); … … 672 680 // Tests whether parsed token is a contextual keyword. 673 681 674 pp .isContextual = function(name) {675 return this.type === types .name && this.value === name && !this.containsEsc682 pp$9.isContextual = function(name) { 683 return this.type === types$1.name && this.value === name && !this.containsEsc 676 684 }; 677 685 678 686 // Consumes contextual keyword if possible. 679 687 680 pp .eatContextual = function(name) {688 pp$9.eatContextual = function(name) { 681 689 if (!this.isContextual(name)) { return false } 682 690 this.next(); … … 686 694 // Asserts that following token is given contextual keyword. 687 695 688 pp .expectContextual = function(name) {696 pp$9.expectContextual = function(name) { 689 697 if (!this.eatContextual(name)) { this.unexpected(); } 690 698 }; … … 692 700 // Test whether a semicolon can be inserted at the current position. 693 701 694 pp .canInsertSemicolon = function() {695 return this.type === types .eof ||696 this.type === types .braceR ||702 pp$9.canInsertSemicolon = function() { 703 return this.type === types$1.eof || 704 this.type === types$1.braceR || 697 705 lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) 698 706 }; 699 707 700 pp .insertSemicolon = function() {708 pp$9.insertSemicolon = function() { 701 709 if (this.canInsertSemicolon()) { 702 710 if (this.options.onInsertedSemicolon) … … 709 717 // pretend that there is a semicolon at this position. 710 718 711 pp .semicolon = function() {712 if (!this.eat(types .semi) && !this.insertSemicolon()) { this.unexpected(); }713 }; 714 715 pp .afterTrailingComma = function(tokType, notNext) {719 pp$9.semicolon = function() { 720 if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); } 721 }; 722 723 pp$9.afterTrailingComma = function(tokType, notNext) { 716 724 if (this.type === tokType) { 717 725 if (this.options.onTrailingComma) … … 726 734 // raise an unexpected token error. 727 735 728 pp .expect = function(type) {736 pp$9.expect = function(type) { 729 737 this.eat(type) || this.unexpected(); 730 738 }; … … 732 740 // Raise an unexpected token error. 733 741 734 pp .unexpected = function(pos) {742 pp$9.unexpected = function(pos) { 735 743 this.raise(pos != null ? pos : this.start, "Unexpected token"); 736 744 }; … … 745 753 } 746 754 747 pp .checkPatternErrors = function(refDestructuringErrors, isAssign) {755 pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { 748 756 if (!refDestructuringErrors) { return } 749 757 if (refDestructuringErrors.trailingComma > -1) … … 753 761 }; 754 762 755 pp .checkExpressionErrors = function(refDestructuringErrors, andThrow) {763 pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { 756 764 if (!refDestructuringErrors) { return false } 757 765 var shorthandAssign = refDestructuringErrors.shorthandAssign; … … 764 772 }; 765 773 766 pp .checkYieldAwaitInDefaultParams = function() {774 pp$9.checkYieldAwaitInDefaultParams = function() { 767 775 if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) 768 776 { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } … … 771 779 }; 772 780 773 pp .isSimpleAssignTarget = function(expr) {781 pp$9.isSimpleAssignTarget = function(expr) { 774 782 if (expr.type === "ParenthesizedExpression") 775 783 { return this.isSimpleAssignTarget(expr.expression) } … … 777 785 }; 778 786 779 var pp$ 1= Parser.prototype;787 var pp$8 = Parser.prototype; 780 788 781 789 // ### Statement parsing … … 786 794 // to its body instead of creating a new node. 787 795 788 pp$ 1.parseTopLevel = function(node) {796 pp$8.parseTopLevel = function(node) { 789 797 var exports = Object.create(null); 790 798 if (!node.body) { node.body = []; } 791 while (this.type !== types .eof) {799 while (this.type !== types$1.eof) { 792 800 var stmt = this.parseStatement(null, true, exports); 793 801 node.body.push(stmt); … … 808 816 var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; 809 817 810 pp$ 1.isLet = function(context) {818 pp$8.isLet = function(context) { 811 819 if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } 812 820 skipWhiteSpace.lastIndex = this.pos; … … 834 842 // - 'async /*foo*/ function' is OK. 835 843 // - 'async /*\n*/ function' is invalid. 836 pp$ 1.isAsyncFunction = function() {844 pp$8.isAsyncFunction = function() { 837 845 if (this.options.ecmaVersion < 8 || !this.isContextual("async")) 838 846 { return false } … … 854 862 // does not help. 855 863 856 pp$ 1.parseStatement = function(context, topLevel, exports) {864 pp$8.parseStatement = function(context, topLevel, exports) { 857 865 var starttype = this.type, node = this.startNode(), kind; 858 866 859 867 if (this.isLet(context)) { 860 starttype = types ._var;868 starttype = types$1._var; 861 869 kind = "let"; 862 870 } … … 867 875 868 876 switch (starttype) { 869 case types ._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword)870 case types ._debugger: return this.parseDebuggerStatement(node)871 case types ._do: return this.parseDoStatement(node)872 case types ._for: return this.parseForStatement(node)873 case types ._function:877 case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword) 878 case types$1._debugger: return this.parseDebuggerStatement(node) 879 case types$1._do: return this.parseDoStatement(node) 880 case types$1._for: return this.parseForStatement(node) 881 case types$1._function: 874 882 // Function as sole body of either an if statement or a labeled statement 875 883 // works, but not when it is part of a labeled statement that is the sole … … 877 885 if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } 878 886 return this.parseFunctionStatement(node, false, !context) 879 case types ._class:887 case types$1._class: 880 888 if (context) { this.unexpected(); } 881 889 return this.parseClass(node, true) 882 case types ._if: return this.parseIfStatement(node)883 case types ._return: return this.parseReturnStatement(node)884 case types ._switch: return this.parseSwitchStatement(node)885 case types ._throw: return this.parseThrowStatement(node)886 case types ._try: return this.parseTryStatement(node)887 case types ._const: case types._var:890 case types$1._if: return this.parseIfStatement(node) 891 case types$1._return: return this.parseReturnStatement(node) 892 case types$1._switch: return this.parseSwitchStatement(node) 893 case types$1._throw: return this.parseThrowStatement(node) 894 case types$1._try: return this.parseTryStatement(node) 895 case types$1._const: case types$1._var: 888 896 kind = kind || this.value; 889 897 if (context && kind !== "var") { this.unexpected(); } 890 898 return this.parseVarStatement(node, kind) 891 case types ._while: return this.parseWhileStatement(node)892 case types ._with: return this.parseWithStatement(node)893 case types .braceL: return this.parseBlock(true, node)894 case types .semi: return this.parseEmptyStatement(node)895 case types ._export:896 case types ._import:897 if (this.options.ecmaVersion > 10 && starttype === types ._import) {899 case types$1._while: return this.parseWhileStatement(node) 900 case types$1._with: return this.parseWithStatement(node) 901 case types$1.braceL: return this.parseBlock(true, node) 902 case types$1.semi: return this.parseEmptyStatement(node) 903 case types$1._export: 904 case types$1._import: 905 if (this.options.ecmaVersion > 10 && starttype === types$1._import) { 898 906 skipWhiteSpace.lastIndex = this.pos; 899 907 var skip = skipWhiteSpace.exec(this.input); … … 909 917 { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } 910 918 } 911 return starttype === types ._import ? this.parseImport(node) : this.parseExport(node, exports)919 return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports) 912 920 913 921 // If the statement does not start with a statement keyword or a … … 924 932 925 933 var maybeName = this.value, expr = this.parseExpression(); 926 if (starttype === types .name && expr.type === "Identifier" && this.eat(types.colon))934 if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) 927 935 { return this.parseLabeledStatement(node, maybeName, expr, context) } 928 936 else { return this.parseExpressionStatement(node, expr) } … … 930 938 }; 931 939 932 pp$ 1.parseBreakContinueStatement = function(node, keyword) {940 pp$8.parseBreakContinueStatement = function(node, keyword) { 933 941 var isBreak = keyword === "break"; 934 942 this.next(); 935 if (this.eat(types .semi) || this.insertSemicolon()) { node.label = null; }936 else if (this.type !== types .name) { this.unexpected(); }943 if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; } 944 else if (this.type !== types$1.name) { this.unexpected(); } 937 945 else { 938 946 node.label = this.parseIdent(); … … 954 962 }; 955 963 956 pp$ 1.parseDebuggerStatement = function(node) {964 pp$8.parseDebuggerStatement = function(node) { 957 965 this.next(); 958 966 this.semicolon(); … … 960 968 }; 961 969 962 pp$ 1.parseDoStatement = function(node) {970 pp$8.parseDoStatement = function(node) { 963 971 this.next(); 964 972 this.labels.push(loopLabel); 965 973 node.body = this.parseStatement("do"); 966 974 this.labels.pop(); 967 this.expect(types ._while);975 this.expect(types$1._while); 968 976 node.test = this.parseParenExpression(); 969 977 if (this.options.ecmaVersion >= 6) 970 { this.eat(types .semi); }978 { this.eat(types$1.semi); } 971 979 else 972 980 { this.semicolon(); } … … 982 990 // is a regular `for` loop. 983 991 984 pp$ 1.parseForStatement = function(node) {992 pp$8.parseForStatement = function(node) { 985 993 this.next(); 986 994 var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1; 987 995 this.labels.push(loopLabel); 988 996 this.enterScope(0); 989 this.expect(types .parenL);990 if (this.type === types .semi) {997 this.expect(types$1.parenL); 998 if (this.type === types$1.semi) { 991 999 if (awaitAt > -1) { this.unexpected(awaitAt); } 992 1000 return this.parseFor(node, null) 993 1001 } 994 1002 var isLet = this.isLet(); 995 if (this.type === types ._var || this.type === types._const || isLet) {1003 if (this.type === types$1._var || this.type === types$1._const || isLet) { 996 1004 var init$1 = this.startNode(), kind = isLet ? "let" : this.value; 997 1005 this.next(); 998 1006 this.parseVar(init$1, true, kind); 999 1007 this.finishNode(init$1, "VariableDeclaration"); 1000 if ((this.type === types ._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) {1008 if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { 1001 1009 if (this.options.ecmaVersion >= 9) { 1002 if (this.type === types ._in) {1010 if (this.type === types$1._in) { 1003 1011 if (awaitAt > -1) { this.unexpected(awaitAt); } 1004 1012 } else { node.await = awaitAt > -1; } … … 1012 1020 var refDestructuringErrors = new DestructuringErrors; 1013 1021 var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); 1014 if (this.type === types ._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {1022 if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { 1015 1023 if (this.options.ecmaVersion >= 9) { 1016 if (this.type === types ._in) {1024 if (this.type === types$1._in) { 1017 1025 if (awaitAt > -1) { this.unexpected(awaitAt); } 1018 1026 } else { node.await = awaitAt > -1; } … … 1029 1037 }; 1030 1038 1031 pp$ 1.parseFunctionStatement = function(node, isAsync, declarationPosition) {1039 pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { 1032 1040 this.next(); 1033 1041 return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) 1034 1042 }; 1035 1043 1036 pp$ 1.parseIfStatement = function(node) {1044 pp$8.parseIfStatement = function(node) { 1037 1045 this.next(); 1038 1046 node.test = this.parseParenExpression(); 1039 1047 // allow function declarations in branches, but only in non-strict mode 1040 1048 node.consequent = this.parseStatement("if"); 1041 node.alternate = this.eat(types ._else) ? this.parseStatement("if") : null;1049 node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; 1042 1050 return this.finishNode(node, "IfStatement") 1043 1051 }; 1044 1052 1045 pp$ 1.parseReturnStatement = function(node) {1053 pp$8.parseReturnStatement = function(node) { 1046 1054 if (!this.inFunction && !this.options.allowReturnOutsideFunction) 1047 1055 { this.raise(this.start, "'return' outside of function"); } … … 1052 1060 // possibility to insert one. 1053 1061 1054 if (this.eat(types .semi) || this.insertSemicolon()) { node.argument = null; }1062 if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; } 1055 1063 else { node.argument = this.parseExpression(); this.semicolon(); } 1056 1064 return this.finishNode(node, "ReturnStatement") 1057 1065 }; 1058 1066 1059 pp$ 1.parseSwitchStatement = function(node) {1067 pp$8.parseSwitchStatement = function(node) { 1060 1068 this.next(); 1061 1069 node.discriminant = this.parseParenExpression(); 1062 1070 node.cases = []; 1063 this.expect(types .braceL);1071 this.expect(types$1.braceL); 1064 1072 this.labels.push(switchLabel); 1065 1073 this.enterScope(0); … … 1070 1078 1071 1079 var cur; 1072 for (var sawDefault = false; this.type !== types .braceR;) {1073 if (this.type === types ._case || this.type === types._default) {1074 var isCase = this.type === types ._case;1080 for (var sawDefault = false; this.type !== types$1.braceR;) { 1081 if (this.type === types$1._case || this.type === types$1._default) { 1082 var isCase = this.type === types$1._case; 1075 1083 if (cur) { this.finishNode(cur, "SwitchCase"); } 1076 1084 node.cases.push(cur = this.startNode()); … … 1084 1092 cur.test = null; 1085 1093 } 1086 this.expect(types .colon);1094 this.expect(types$1.colon); 1087 1095 } else { 1088 1096 if (!cur) { this.unexpected(); } … … 1097 1105 }; 1098 1106 1099 pp$ 1.parseThrowStatement = function(node) {1107 pp$8.parseThrowStatement = function(node) { 1100 1108 this.next(); 1101 1109 if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) … … 1108 1116 // Reused empty array added for node fields that are always empty. 1109 1117 1110 var empty = [];1111 1112 pp$ 1.parseTryStatement = function(node) {1118 var empty$1 = []; 1119 1120 pp$8.parseTryStatement = function(node) { 1113 1121 this.next(); 1114 1122 node.block = this.parseBlock(); 1115 1123 node.handler = null; 1116 if (this.type === types ._catch) {1124 if (this.type === types$1._catch) { 1117 1125 var clause = this.startNode(); 1118 1126 this.next(); 1119 if (this.eat(types .parenL)) {1127 if (this.eat(types$1.parenL)) { 1120 1128 clause.param = this.parseBindingAtom(); 1121 1129 var simple = clause.param.type === "Identifier"; 1122 1130 this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); 1123 1131 this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); 1124 this.expect(types .parenR);1132 this.expect(types$1.parenR); 1125 1133 } else { 1126 1134 if (this.options.ecmaVersion < 10) { this.unexpected(); } … … 1132 1140 node.handler = this.finishNode(clause, "CatchClause"); 1133 1141 } 1134 node.finalizer = this.eat(types ._finally) ? this.parseBlock() : null;1142 node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; 1135 1143 if (!node.handler && !node.finalizer) 1136 1144 { this.raise(node.start, "Missing catch or finally clause"); } … … 1138 1146 }; 1139 1147 1140 pp$ 1.parseVarStatement = function(node, kind) {1148 pp$8.parseVarStatement = function(node, kind) { 1141 1149 this.next(); 1142 1150 this.parseVar(node, false, kind); … … 1145 1153 }; 1146 1154 1147 pp$ 1.parseWhileStatement = function(node) {1155 pp$8.parseWhileStatement = function(node) { 1148 1156 this.next(); 1149 1157 node.test = this.parseParenExpression(); … … 1154 1162 }; 1155 1163 1156 pp$ 1.parseWithStatement = function(node) {1164 pp$8.parseWithStatement = function(node) { 1157 1165 if (this.strict) { this.raise(this.start, "'with' in strict mode"); } 1158 1166 this.next(); … … 1162 1170 }; 1163 1171 1164 pp$ 1.parseEmptyStatement = function(node) {1172 pp$8.parseEmptyStatement = function(node) { 1165 1173 this.next(); 1166 1174 return this.finishNode(node, "EmptyStatement") 1167 1175 }; 1168 1176 1169 pp$ 1.parseLabeledStatement = function(node, maybeName, expr, context) {1177 pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { 1170 1178 for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) 1171 1179 { … … 1175 1183 { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); 1176 1184 } } 1177 var kind = this.type.isLoop ? "loop" : this.type === types ._switch ? "switch" : null;1185 var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; 1178 1186 for (var i = this.labels.length - 1; i >= 0; i--) { 1179 1187 var label$1 = this.labels[i]; … … 1191 1199 }; 1192 1200 1193 pp$ 1.parseExpressionStatement = function(node, expr) {1201 pp$8.parseExpressionStatement = function(node, expr) { 1194 1202 node.expression = expr; 1195 1203 this.semicolon(); … … 1201 1209 // function bodies). 1202 1210 1203 pp$ 1.parseBlock = function(createNewLexicalScope, node, exitStrict) {1211 pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { 1204 1212 if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; 1205 1213 if ( node === void 0 ) node = this.startNode(); 1206 1214 1207 1215 node.body = []; 1208 this.expect(types .braceL);1216 this.expect(types$1.braceL); 1209 1217 if (createNewLexicalScope) { this.enterScope(0); } 1210 while (this.type !== types .braceR) {1218 while (this.type !== types$1.braceR) { 1211 1219 var stmt = this.parseStatement(null); 1212 1220 node.body.push(stmt); … … 1222 1230 // expression. 1223 1231 1224 pp$ 1.parseFor = function(node, init) {1232 pp$8.parseFor = function(node, init) { 1225 1233 node.init = init; 1226 this.expect(types .semi);1227 node.test = this.type === types .semi ? null : this.parseExpression();1228 this.expect(types .semi);1229 node.update = this.type === types .parenR ? null : this.parseExpression();1230 this.expect(types .parenR);1234 this.expect(types$1.semi); 1235 node.test = this.type === types$1.semi ? null : this.parseExpression(); 1236 this.expect(types$1.semi); 1237 node.update = this.type === types$1.parenR ? null : this.parseExpression(); 1238 this.expect(types$1.parenR); 1231 1239 node.body = this.parseStatement("for"); 1232 1240 this.exitScope(); … … 1238 1246 // same from parser's perspective. 1239 1247 1240 pp$ 1.parseForIn = function(node, init) {1241 var isForIn = this.type === types ._in;1248 pp$8.parseForIn = function(node, init) { 1249 var isForIn = this.type === types$1._in; 1242 1250 this.next(); 1243 1251 … … 1260 1268 node.left = init; 1261 1269 node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); 1262 this.expect(types .parenR);1270 this.expect(types$1.parenR); 1263 1271 node.body = this.parseStatement("for"); 1264 1272 this.exitScope(); … … 1269 1277 // Parse a list of variable declarations. 1270 1278 1271 pp$ 1.parseVar = function(node, isFor, kind) {1279 pp$8.parseVar = function(node, isFor, kind) { 1272 1280 node.declarations = []; 1273 1281 node.kind = kind; … … 1275 1283 var decl = this.startNode(); 1276 1284 this.parseVarId(decl, kind); 1277 if (this.eat(types .eq)) {1285 if (this.eat(types$1.eq)) { 1278 1286 decl.init = this.parseMaybeAssign(isFor); 1279 } else if (kind === "const" && !(this.type === types ._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {1287 } else if (kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { 1280 1288 this.unexpected(); 1281 } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types ._in || this.isContextual("of")))) {1289 } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { 1282 1290 this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); 1283 1291 } else { … … 1285 1293 } 1286 1294 node.declarations.push(this.finishNode(decl, "VariableDeclarator")); 1287 if (!this.eat(types .comma)) { break }1295 if (!this.eat(types$1.comma)) { break } 1288 1296 } 1289 1297 return node 1290 1298 }; 1291 1299 1292 pp$ 1.parseVarId = function(decl, kind) {1300 pp$8.parseVarId = function(decl, kind) { 1293 1301 decl.id = this.parseBindingAtom(); 1294 1302 this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); … … 1301 1309 1302 1310 // Remove `allowExpressionBody` for 7.0.0, as it is only called with false 1303 pp$ 1.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {1311 pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { 1304 1312 this.initFunction(node); 1305 1313 if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { 1306 if (this.type === types .star && (statement & FUNC_HANGING_STATEMENT))1314 if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) 1307 1315 { this.unexpected(); } 1308 node.generator = this.eat(types .star);1316 node.generator = this.eat(types$1.star); 1309 1317 } 1310 1318 if (this.options.ecmaVersion >= 8) … … 1312 1320 1313 1321 if (statement & FUNC_STATEMENT) { 1314 node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types .name ? null : this.parseIdent();1322 node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent(); 1315 1323 if (node.id && !(statement & FUNC_HANGING_STATEMENT)) 1316 1324 // If it is a regular function declaration in sloppy mode, then it is … … 1328 1336 1329 1337 if (!(statement & FUNC_STATEMENT)) 1330 { node.id = this.type === types .name ? this.parseIdent() : null; }1338 { node.id = this.type === types$1.name ? this.parseIdent() : null; } 1331 1339 1332 1340 this.parseFunctionParams(node); … … 1339 1347 }; 1340 1348 1341 pp$ 1.parseFunctionParams = function(node) {1342 this.expect(types .parenL);1343 node.params = this.parseBindingList(types .parenR, false, this.options.ecmaVersion >= 8);1349 pp$8.parseFunctionParams = function(node) { 1350 this.expect(types$1.parenL); 1351 node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); 1344 1352 this.checkYieldAwaitInDefaultParams(); 1345 1353 }; … … 1348 1356 // `isStatement` parameter). 1349 1357 1350 pp$ 1.parseClass = function(node, isStatement) {1358 pp$8.parseClass = function(node, isStatement) { 1351 1359 this.next(); 1352 1360 … … 1362 1370 var hadConstructor = false; 1363 1371 classBody.body = []; 1364 this.expect(types .braceL);1365 while (this.type !== types .braceR) {1372 this.expect(types$1.braceL); 1373 while (this.type !== types$1.braceR) { 1366 1374 var element = this.parseClassElement(node.superClass !== null); 1367 1375 if (element) { … … 1382 1390 }; 1383 1391 1384 pp$ 1.parseClassElement = function(constructorAllowsSuper) {1385 if (this.eat(types .semi)) { return null }1392 pp$8.parseClassElement = function(constructorAllowsSuper) { 1393 if (this.eat(types$1.semi)) { return null } 1386 1394 1387 1395 var ecmaVersion = this.options.ecmaVersion; … … 1395 1403 if (this.eatContextual("static")) { 1396 1404 // Parse static init block 1397 if (ecmaVersion >= 13 && this.eat(types .braceL)) {1405 if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { 1398 1406 this.parseClassStaticBlock(node); 1399 1407 return node 1400 1408 } 1401 if (this.isClassElementNameStart() || this.type === types .star) {1409 if (this.isClassElementNameStart() || this.type === types$1.star) { 1402 1410 isStatic = true; 1403 1411 } else { … … 1407 1415 node.static = isStatic; 1408 1416 if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { 1409 if ((this.isClassElementNameStart() || this.type === types .star) && !this.canInsertSemicolon()) {1417 if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { 1410 1418 isAsync = true; 1411 1419 } else { … … 1413 1421 } 1414 1422 } 1415 if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types .star)) {1423 if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { 1416 1424 isGenerator = true; 1417 1425 } … … 1440 1448 1441 1449 // Parse element value 1442 if (ecmaVersion < 13 || this.type === types .parenL || kind !== "method" || isGenerator || isAsync) {1450 if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { 1443 1451 var isConstructor = !node.static && checkKeyName(node, "constructor"); 1444 1452 var allowsDirectSuper = isConstructor && constructorAllowsSuper; … … 1454 1462 }; 1455 1463 1456 pp$ 1.isClassElementNameStart = function() {1464 pp$8.isClassElementNameStart = function() { 1457 1465 return ( 1458 this.type === types .name ||1459 this.type === types .privateId ||1460 this.type === types .num ||1461 this.type === types .string ||1462 this.type === types .bracketL ||1466 this.type === types$1.name || 1467 this.type === types$1.privateId || 1468 this.type === types$1.num || 1469 this.type === types$1.string || 1470 this.type === types$1.bracketL || 1463 1471 this.type.keyword 1464 1472 ) 1465 1473 }; 1466 1474 1467 pp$ 1.parseClassElementName = function(element) {1468 if (this.type === types .privateId) {1475 pp$8.parseClassElementName = function(element) { 1476 if (this.type === types$1.privateId) { 1469 1477 if (this.value === "constructor") { 1470 1478 this.raise(this.start, "Classes can't have an element named '#constructor'"); … … 1477 1485 }; 1478 1486 1479 pp$ 1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {1487 pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { 1480 1488 // Check key and flags 1481 1489 var key = method.key; … … 1501 1509 }; 1502 1510 1503 pp$ 1.parseClassField = function(field) {1511 pp$8.parseClassField = function(field) { 1504 1512 if (checkKeyName(field, "constructor")) { 1505 1513 this.raise(field.key.start, "Classes can't have a field named 'constructor'"); … … 1508 1516 } 1509 1517 1510 if (this.eat(types .eq)) {1518 if (this.eat(types$1.eq)) { 1511 1519 // To raise SyntaxError if 'arguments' exists in the initializer. 1512 1520 var scope = this.currentThisScope(); … … 1523 1531 }; 1524 1532 1525 pp$ 1.parseClassStaticBlock = function(node) {1533 pp$8.parseClassStaticBlock = function(node) { 1526 1534 node.body = []; 1527 1535 … … 1529 1537 this.labels = []; 1530 1538 this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); 1531 while (this.type !== types .braceR) {1539 while (this.type !== types$1.braceR) { 1532 1540 var stmt = this.parseStatement(null); 1533 1541 node.body.push(stmt); … … 1540 1548 }; 1541 1549 1542 pp$ 1.parseClassId = function(node, isStatement) {1543 if (this.type === types .name) {1550 pp$8.parseClassId = function(node, isStatement) { 1551 if (this.type === types$1.name) { 1544 1552 node.id = this.parseIdent(); 1545 1553 if (isStatement) … … 1552 1560 }; 1553 1561 1554 pp$ 1.parseClassSuper = function(node) {1555 node.superClass = this.eat(types ._extends) ? this.parseExprSubscripts(false) : null;1556 }; 1557 1558 pp$ 1.enterClassBody = function() {1562 pp$8.parseClassSuper = function(node) { 1563 node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; 1564 }; 1565 1566 pp$8.enterClassBody = function() { 1559 1567 var element = {declared: Object.create(null), used: []}; 1560 1568 this.privateNameStack.push(element); … … 1562 1570 }; 1563 1571 1564 pp$ 1.exitClassBody = function() {1572 pp$8.exitClassBody = function() { 1565 1573 var ref = this.privateNameStack.pop(); 1566 1574 var declared = ref.declared; … … 1617 1625 // Parses module export declaration. 1618 1626 1619 pp$ 1.parseExport = function(node, exports) {1627 pp$8.parseExport = function(node, exports) { 1620 1628 this.next(); 1621 1629 // export * from '...' 1622 if (this.eat(types .star)) {1630 if (this.eat(types$1.star)) { 1623 1631 if (this.options.ecmaVersion >= 11) { 1624 1632 if (this.eatContextual("as")) { … … 1630 1638 } 1631 1639 this.expectContextual("from"); 1632 if (this.type !== types .string) { this.unexpected(); }1640 if (this.type !== types$1.string) { this.unexpected(); } 1633 1641 node.source = this.parseExprAtom(); 1634 1642 this.semicolon(); 1635 1643 return this.finishNode(node, "ExportAllDeclaration") 1636 1644 } 1637 if (this.eat(types ._default)) { // export default ...1645 if (this.eat(types$1._default)) { // export default ... 1638 1646 this.checkExport(exports, "default", this.lastTokStart); 1639 1647 var isAsync; 1640 if (this.type === types ._function || (isAsync = this.isAsyncFunction())) {1648 if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { 1641 1649 var fNode = this.startNode(); 1642 1650 this.next(); 1643 1651 if (isAsync) { this.next(); } 1644 1652 node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); 1645 } else if (this.type === types ._class) {1653 } else if (this.type === types$1._class) { 1646 1654 var cNode = this.startNode(); 1647 1655 node.declaration = this.parseClass(cNode, "nullableID"); … … 1665 1673 node.specifiers = this.parseExportSpecifiers(exports); 1666 1674 if (this.eatContextual("from")) { 1667 if (this.type !== types .string) { this.unexpected(); }1675 if (this.type !== types$1.string) { this.unexpected(); } 1668 1676 node.source = this.parseExprAtom(); 1669 1677 } else { … … 1684 1692 }; 1685 1693 1686 pp$ 1.checkExport = function(exports, name, pos) {1694 pp$8.checkExport = function(exports, name, pos) { 1687 1695 if (!exports) { return } 1688 1696 if (has(exports, name)) … … 1691 1699 }; 1692 1700 1693 pp$ 1.checkPatternExport = function(exports, pat) {1701 pp$8.checkPatternExport = function(exports, pat) { 1694 1702 var type = pat.type; 1695 1703 if (type === "Identifier") … … 1718 1726 }; 1719 1727 1720 pp$ 1.checkVariableExport = function(exports, decls) {1728 pp$8.checkVariableExport = function(exports, decls) { 1721 1729 if (!exports) { return } 1722 1730 for (var i = 0, list = decls; i < list.length; i += 1) … … 1728 1736 }; 1729 1737 1730 pp$ 1.shouldParseExportStatement = function() {1738 pp$8.shouldParseExportStatement = function() { 1731 1739 return this.type.keyword === "var" || 1732 1740 this.type.keyword === "const" || … … 1739 1747 // Parses a comma-separated list of module exports. 1740 1748 1741 pp$ 1.parseExportSpecifiers = function(exports) {1749 pp$8.parseExportSpecifiers = function(exports) { 1742 1750 var nodes = [], first = true; 1743 1751 // export { x, y as z } [from '...'] 1744 this.expect(types .braceL);1745 while (!this.eat(types .braceR)) {1752 this.expect(types$1.braceL); 1753 while (!this.eat(types$1.braceR)) { 1746 1754 if (!first) { 1747 this.expect(types .comma);1748 if (this.afterTrailingComma(types .braceR)) { break }1755 this.expect(types$1.comma); 1756 if (this.afterTrailingComma(types$1.braceR)) { break } 1749 1757 } else { first = false; } 1750 1758 … … 1760 1768 // Parses import declaration. 1761 1769 1762 pp$ 1.parseImport = function(node) {1770 pp$8.parseImport = function(node) { 1763 1771 this.next(); 1764 1772 // import '...' 1765 if (this.type === types .string) {1766 node.specifiers = empty ;1773 if (this.type === types$1.string) { 1774 node.specifiers = empty$1; 1767 1775 node.source = this.parseExprAtom(); 1768 1776 } else { 1769 1777 node.specifiers = this.parseImportSpecifiers(); 1770 1778 this.expectContextual("from"); 1771 node.source = this.type === types .string ? this.parseExprAtom() : this.unexpected();1779 node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); 1772 1780 } 1773 1781 this.semicolon(); … … 1777 1785 // Parses a comma-separated list of module imports. 1778 1786 1779 pp$ 1.parseImportSpecifiers = function() {1787 pp$8.parseImportSpecifiers = function() { 1780 1788 var nodes = [], first = true; 1781 if (this.type === types .name) {1789 if (this.type === types$1.name) { 1782 1790 // import defaultObj, { x, y as z } from '...' 1783 1791 var node = this.startNode(); … … 1785 1793 this.checkLValSimple(node.local, BIND_LEXICAL); 1786 1794 nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); 1787 if (!this.eat(types .comma)) { return nodes }1788 } 1789 if (this.type === types .star) {1795 if (!this.eat(types$1.comma)) { return nodes } 1796 } 1797 if (this.type === types$1.star) { 1790 1798 var node$1 = this.startNode(); 1791 1799 this.next(); … … 1796 1804 return nodes 1797 1805 } 1798 this.expect(types .braceL);1799 while (!this.eat(types .braceR)) {1806 this.expect(types$1.braceL); 1807 while (!this.eat(types$1.braceR)) { 1800 1808 if (!first) { 1801 this.expect(types .comma);1802 if (this.afterTrailingComma(types .braceR)) { break }1809 this.expect(types$1.comma); 1810 if (this.afterTrailingComma(types$1.braceR)) { break } 1803 1811 } else { first = false; } 1804 1812 … … 1818 1826 1819 1827 // Set `ExpressionStatement#directive` property for directive prologues. 1820 pp$ 1.adaptDirectivePrologue = function(statements) {1828 pp$8.adaptDirectivePrologue = function(statements) { 1821 1829 for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { 1822 1830 statements[i].directive = statements[i].expression.raw.slice(1, -1); 1823 1831 } 1824 1832 }; 1825 pp$ 1.isDirectiveCandidate = function(statement) {1833 pp$8.isDirectiveCandidate = function(statement) { 1826 1834 return ( 1827 1835 statement.type === "ExpressionStatement" && … … 1833 1841 }; 1834 1842 1835 var pp$ 2= Parser.prototype;1843 var pp$7 = Parser.prototype; 1836 1844 1837 1845 // Convert existing expression atom to assignable pattern 1838 1846 // if possible. 1839 1847 1840 pp$ 2.toAssignable = function(node, isBinding, refDestructuringErrors) {1848 pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { 1841 1849 if (this.options.ecmaVersion >= 6 && node) { 1842 1850 switch (node.type) { … … 1919 1927 // Convert list of expression atoms to binding list. 1920 1928 1921 pp$ 2.toAssignableList = function(exprList, isBinding) {1929 pp$7.toAssignableList = function(exprList, isBinding) { 1922 1930 var end = exprList.length; 1923 1931 for (var i = 0; i < end; i++) { … … 1935 1943 // Parses spread element. 1936 1944 1937 pp$ 2.parseSpread = function(refDestructuringErrors) {1945 pp$7.parseSpread = function(refDestructuringErrors) { 1938 1946 var node = this.startNode(); 1939 1947 this.next(); … … 1942 1950 }; 1943 1951 1944 pp$ 2.parseRestBinding = function() {1952 pp$7.parseRestBinding = function() { 1945 1953 var node = this.startNode(); 1946 1954 this.next(); 1947 1955 1948 1956 // RestElement inside of a function parameter must be an identifier 1949 if (this.options.ecmaVersion === 6 && this.type !== types .name)1957 if (this.options.ecmaVersion === 6 && this.type !== types$1.name) 1950 1958 { this.unexpected(); } 1951 1959 … … 1957 1965 // Parses lvalue (assignable) atom. 1958 1966 1959 pp$ 2.parseBindingAtom = function() {1967 pp$7.parseBindingAtom = function() { 1960 1968 if (this.options.ecmaVersion >= 6) { 1961 1969 switch (this.type) { 1962 case types .bracketL:1970 case types$1.bracketL: 1963 1971 var node = this.startNode(); 1964 1972 this.next(); 1965 node.elements = this.parseBindingList(types .bracketR, true, true);1973 node.elements = this.parseBindingList(types$1.bracketR, true, true); 1966 1974 return this.finishNode(node, "ArrayPattern") 1967 1975 1968 case types .braceL:1976 case types$1.braceL: 1969 1977 return this.parseObj(true) 1970 1978 } … … 1973 1981 }; 1974 1982 1975 pp$ 2.parseBindingList = function(close, allowEmpty, allowTrailingComma) {1983 pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { 1976 1984 var elts = [], first = true; 1977 1985 while (!this.eat(close)) { 1978 1986 if (first) { first = false; } 1979 else { this.expect(types .comma); }1980 if (allowEmpty && this.type === types .comma) {1987 else { this.expect(types$1.comma); } 1988 if (allowEmpty && this.type === types$1.comma) { 1981 1989 elts.push(null); 1982 1990 } else if (allowTrailingComma && this.afterTrailingComma(close)) { 1983 1991 break 1984 } else if (this.type === types .ellipsis) {1992 } else if (this.type === types$1.ellipsis) { 1985 1993 var rest = this.parseRestBinding(); 1986 1994 this.parseBindingListItem(rest); 1987 1995 elts.push(rest); 1988 if (this.type === types .comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }1996 if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } 1989 1997 this.expect(close); 1990 1998 break … … 1998 2006 }; 1999 2007 2000 pp$ 2.parseBindingListItem = function(param) {2008 pp$7.parseBindingListItem = function(param) { 2001 2009 return param 2002 2010 }; … … 2004 2012 // Parses assignment pattern around given atom if possible. 2005 2013 2006 pp$ 2.parseMaybeDefault = function(startPos, startLoc, left) {2014 pp$7.parseMaybeDefault = function(startPos, startLoc, left) { 2007 2015 left = left || this.parseBindingAtom(); 2008 if (this.options.ecmaVersion < 6 || !this.eat(types .eq)) { return left }2016 if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left } 2009 2017 var node = this.startNodeAt(startPos, startLoc); 2010 2018 node.left = left; … … 2077 2085 // is an assignment (i.e., bindingType is BIND_NONE). 2078 2086 2079 pp$ 2.checkLValSimple = function(expr, bindingType, checkClashes) {2087 pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { 2080 2088 if ( bindingType === void 0 ) bindingType = BIND_NONE; 2081 2089 … … 2115 2123 }; 2116 2124 2117 pp$ 2.checkLValPattern = function(expr, bindingType, checkClashes) {2125 pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { 2118 2126 if ( bindingType === void 0 ) bindingType = BIND_NONE; 2119 2127 … … 2140 2148 }; 2141 2149 2142 pp$ 2.checkLValInnerPattern = function(expr, bindingType, checkClashes) {2150 pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { 2143 2151 if ( bindingType === void 0 ) bindingType = BIND_NONE; 2144 2152 … … 2172 2180 }; 2173 2181 2174 var types $1= {2182 var types = { 2175 2183 b_stat: new TokContext("{", false), 2176 2184 b_expr: new TokContext("{", true), … … 2185 2193 }; 2186 2194 2187 var pp$ 3= Parser.prototype;2188 2189 pp$ 3.initialContext = function() {2190 return [types $1.b_stat]2191 }; 2192 2193 pp$ 3.curContext = function() {2195 var pp$6 = Parser.prototype; 2196 2197 pp$6.initialContext = function() { 2198 return [types.b_stat] 2199 }; 2200 2201 pp$6.curContext = function() { 2194 2202 return this.context[this.context.length - 1] 2195 2203 }; 2196 2204 2197 pp$ 3.braceIsBlock = function(prevType) {2205 pp$6.braceIsBlock = function(prevType) { 2198 2206 var parent = this.curContext(); 2199 if (parent === types $1.f_expr || parent === types$1.f_stat)2207 if (parent === types.f_expr || parent === types.f_stat) 2200 2208 { return true } 2201 if (prevType === types .colon && (parent === types$1.b_stat || parent === types$1.b_expr))2209 if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) 2202 2210 { return !parent.isExpr } 2203 2211 … … 2205 2213 // after a `yield` or `of` construct. See the `updateContext` for 2206 2214 // `tt.name`. 2207 if (prevType === types ._return || prevType === types.name && this.exprAllowed)2215 if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) 2208 2216 { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } 2209 if (prevType === types ._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow)2217 if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) 2210 2218 { return true } 2211 if (prevType === types .braceL)2212 { return parent === types $1.b_stat }2213 if (prevType === types ._var || prevType === types._const || prevType === types.name)2219 if (prevType === types$1.braceL) 2220 { return parent === types.b_stat } 2221 if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) 2214 2222 { return false } 2215 2223 return !this.exprAllowed 2216 2224 }; 2217 2225 2218 pp$ 3.inGeneratorContext = function() {2226 pp$6.inGeneratorContext = function() { 2219 2227 for (var i = this.context.length - 1; i >= 1; i--) { 2220 2228 var context = this.context[i]; … … 2225 2233 }; 2226 2234 2227 pp$ 3.updateContext = function(prevType) {2235 pp$6.updateContext = function(prevType) { 2228 2236 var update, type = this.type; 2229 if (type.keyword && prevType === types .dot)2237 if (type.keyword && prevType === types$1.dot) 2230 2238 { this.exprAllowed = false; } 2231 2239 else if (update = type.updateContext) … … 2236 2244 2237 2245 // Used to handle egde case when token context could not be inferred correctly in tokenize phase 2238 pp$ 3.overrideContext = function(tokenCtx) {2246 pp$6.overrideContext = function(tokenCtx) { 2239 2247 if (this.curContext() !== tokenCtx) { 2240 2248 this.context[this.context.length - 1] = tokenCtx; … … 2244 2252 // Token-specific context update code 2245 2253 2246 types .parenR.updateContext = types.braceR.updateContext = function() {2254 types$1.parenR.updateContext = types$1.braceR.updateContext = function() { 2247 2255 if (this.context.length === 1) { 2248 2256 this.exprAllowed = true; … … 2250 2258 } 2251 2259 var out = this.context.pop(); 2252 if (out === types $1.b_stat && this.curContext().token === "function") {2260 if (out === types.b_stat && this.curContext().token === "function") { 2253 2261 out = this.context.pop(); 2254 2262 } … … 2256 2264 }; 2257 2265 2258 types .braceL.updateContext = function(prevType) {2259 this.context.push(this.braceIsBlock(prevType) ? types $1.b_stat : types$1.b_expr);2266 types$1.braceL.updateContext = function(prevType) { 2267 this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); 2260 2268 this.exprAllowed = true; 2261 2269 }; 2262 2270 2263 types .dollarBraceL.updateContext = function() {2264 this.context.push(types $1.b_tmpl);2271 types$1.dollarBraceL.updateContext = function() { 2272 this.context.push(types.b_tmpl); 2265 2273 this.exprAllowed = true; 2266 2274 }; 2267 2275 2268 types .parenL.updateContext = function(prevType) {2269 var statementParens = prevType === types ._if || prevType === types._for || prevType === types._with || prevType === types._while;2270 this.context.push(statementParens ? types $1.p_stat : types$1.p_expr);2276 types$1.parenL.updateContext = function(prevType) { 2277 var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; 2278 this.context.push(statementParens ? types.p_stat : types.p_expr); 2271 2279 this.exprAllowed = true; 2272 2280 }; 2273 2281 2274 types .incDec.updateContext = function() {2282 types$1.incDec.updateContext = function() { 2275 2283 // tokExprAllowed stays unchanged 2276 2284 }; 2277 2285 2278 types ._function.updateContext = types._class.updateContext = function(prevType) {2279 if (prevType.beforeExpr && prevType !== types ._else &&2280 !(prevType === types .semi && this.curContext() !== types$1.p_stat) &&2281 !(prevType === types ._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&2282 !((prevType === types .colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))2283 { this.context.push(types $1.f_expr); }2286 types$1._function.updateContext = types$1._class.updateContext = function(prevType) { 2287 if (prevType.beforeExpr && prevType !== types$1._else && 2288 !(prevType === types$1.semi && this.curContext() !== types.p_stat) && 2289 !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && 2290 !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) 2291 { this.context.push(types.f_expr); } 2284 2292 else 2285 { this.context.push(types $1.f_stat); }2293 { this.context.push(types.f_stat); } 2286 2294 this.exprAllowed = false; 2287 2295 }; 2288 2296 2289 types .backQuote.updateContext = function() {2290 if (this.curContext() === types $1.q_tmpl)2297 types$1.backQuote.updateContext = function() { 2298 if (this.curContext() === types.q_tmpl) 2291 2299 { this.context.pop(); } 2292 2300 else 2293 { this.context.push(types $1.q_tmpl); }2301 { this.context.push(types.q_tmpl); } 2294 2302 this.exprAllowed = false; 2295 2303 }; 2296 2304 2297 types .star.updateContext = function(prevType) {2298 if (prevType === types ._function) {2305 types$1.star.updateContext = function(prevType) { 2306 if (prevType === types$1._function) { 2299 2307 var index = this.context.length - 1; 2300 if (this.context[index] === types $1.f_expr)2301 { this.context[index] = types $1.f_expr_gen; }2308 if (this.context[index] === types.f_expr) 2309 { this.context[index] = types.f_expr_gen; } 2302 2310 else 2303 { this.context[index] = types $1.f_gen; }2311 { this.context[index] = types.f_gen; } 2304 2312 } 2305 2313 this.exprAllowed = true; 2306 2314 }; 2307 2315 2308 types .name.updateContext = function(prevType) {2316 types$1.name.updateContext = function(prevType) { 2309 2317 var allowed = false; 2310 if (this.options.ecmaVersion >= 6 && prevType !== types .dot) {2318 if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { 2311 2319 if (this.value === "of" && !this.exprAllowed || 2312 2320 this.value === "yield" && this.inGeneratorContext()) … … 2318 2326 // A recursive descent parser operates by defining functions for all 2319 2327 2320 var pp$ 4= Parser.prototype;2328 var pp$5 = Parser.prototype; 2321 2329 2322 2330 // Check if property name clashes with already added. … … 2325 2333 // strict mode, init properties are also not allowed to be repeated. 2326 2334 2327 pp$ 4.checkPropClash = function(prop, propHash, refDestructuringErrors) {2335 pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { 2328 2336 if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") 2329 2337 { return } … … 2342 2350 if (propHash.proto) { 2343 2351 if (refDestructuringErrors) { 2344 if (refDestructuringErrors.doubleProto < 0) 2345 { refDestructuringErrors.doubleProto = key.start; } 2346 // Backwards-compat kludge. Can be removed in version 6.0 2347 } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } 2352 if (refDestructuringErrors.doubleProto < 0) { 2353 refDestructuringErrors.doubleProto = key.start; 2354 } 2355 } else { 2356 this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); 2357 } 2348 2358 } 2349 2359 propHash.proto = true; … … 2387 2397 // delayed syntax error at correct position). 2388 2398 2389 pp$ 4.parseExpression = function(forInit, refDestructuringErrors) {2399 pp$5.parseExpression = function(forInit, refDestructuringErrors) { 2390 2400 var startPos = this.start, startLoc = this.startLoc; 2391 2401 var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); 2392 if (this.type === types .comma) {2402 if (this.type === types$1.comma) { 2393 2403 var node = this.startNodeAt(startPos, startLoc); 2394 2404 node.expressions = [expr]; 2395 while (this.eat(types .comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }2405 while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } 2396 2406 return this.finishNode(node, "SequenceExpression") 2397 2407 } … … 2402 2412 // operators like `+=`. 2403 2413 2404 pp$ 4.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {2414 pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { 2405 2415 if (this.isContextual("yield")) { 2406 2416 if (this.inGenerator) { return this.parseYield(forInit) } … … 2410 2420 } 2411 2421 2412 var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1 ;2422 var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; 2413 2423 if (refDestructuringErrors) { 2414 2424 oldParenAssign = refDestructuringErrors.parenthesizedAssign; 2415 2425 oldTrailingComma = refDestructuringErrors.trailingComma; 2426 oldDoubleProto = refDestructuringErrors.doubleProto; 2416 2427 refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; 2417 2428 } else { … … 2421 2432 2422 2433 var startPos = this.start, startLoc = this.startLoc; 2423 if (this.type === types .parenL || this.type === types.name) {2434 if (this.type === types$1.parenL || this.type === types$1.name) { 2424 2435 this.potentialArrowAt = this.start; 2425 2436 this.potentialArrowInForAwait = forInit === "await"; … … 2430 2441 var node = this.startNodeAt(startPos, startLoc); 2431 2442 node.operator = this.value; 2432 if (this.type === types .eq)2443 if (this.type === types$1.eq) 2433 2444 { left = this.toAssignable(left, false, refDestructuringErrors); } 2434 2445 if (!ownDestructuringErrors) { … … 2437 2448 if (refDestructuringErrors.shorthandAssign >= left.start) 2438 2449 { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly 2439 if (this.type === types .eq)2450 if (this.type === types$1.eq) 2440 2451 { this.checkLValPattern(left); } 2441 2452 else … … 2444 2455 this.next(); 2445 2456 node.right = this.parseMaybeAssign(forInit); 2457 if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; } 2446 2458 return this.finishNode(node, "AssignmentExpression") 2447 2459 } else { … … 2455 2467 // Parse a ternary conditional (`?:`) operator. 2456 2468 2457 pp$ 4.parseMaybeConditional = function(forInit, refDestructuringErrors) {2469 pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { 2458 2470 var startPos = this.start, startLoc = this.startLoc; 2459 2471 var expr = this.parseExprOps(forInit, refDestructuringErrors); 2460 2472 if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } 2461 if (this.eat(types .question)) {2473 if (this.eat(types$1.question)) { 2462 2474 var node = this.startNodeAt(startPos, startLoc); 2463 2475 node.test = expr; 2464 2476 node.consequent = this.parseMaybeAssign(); 2465 this.expect(types .colon);2477 this.expect(types$1.colon); 2466 2478 node.alternate = this.parseMaybeAssign(forInit); 2467 2479 return this.finishNode(node, "ConditionalExpression") … … 2472 2484 // Start the precedence parser. 2473 2485 2474 pp$ 4.parseExprOps = function(forInit, refDestructuringErrors) {2486 pp$5.parseExprOps = function(forInit, refDestructuringErrors) { 2475 2487 var startPos = this.start, startLoc = this.startLoc; 2476 2488 var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); … … 2485 2497 // operator that has a lower precedence than the set it is parsing. 2486 2498 2487 pp$ 4.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {2499 pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { 2488 2500 var prec = this.type.binop; 2489 if (prec != null && (!forInit || this.type !== types ._in)) {2501 if (prec != null && (!forInit || this.type !== types$1._in)) { 2490 2502 if (prec > minPrec) { 2491 var logical = this.type === types .logicalOR || this.type === types.logicalAND;2492 var coalesce = this.type === types .coalesce;2503 var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; 2504 var coalesce = this.type === types$1.coalesce; 2493 2505 if (coalesce) { 2494 2506 // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. 2495 2507 // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. 2496 prec = types .logicalAND.binop;2508 prec = types$1.logicalAND.binop; 2497 2509 } 2498 2510 var op = this.value; … … 2501 2513 var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); 2502 2514 var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); 2503 if ((logical && this.type === types .coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) {2515 if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) { 2504 2516 this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); 2505 2517 } … … 2510 2522 }; 2511 2523 2512 pp$4.buildBinary = function(startPos, startLoc, left, right, op, logical) { 2524 pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { 2525 if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); } 2513 2526 var node = this.startNodeAt(startPos, startLoc); 2514 2527 node.left = left; … … 2520 2533 // Parse unary operators, both prefix and postfix. 2521 2534 2522 pp$ 4.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {2535 pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { 2523 2536 var startPos = this.start, startLoc = this.startLoc, expr; 2524 2537 if (this.isContextual("await") && this.canAwait) { … … 2526 2539 sawUnary = true; 2527 2540 } else if (this.type.prefix) { 2528 var node = this.startNode(), update = this.type === types .incDec;2541 var node = this.startNode(), update = this.type === types$1.incDec; 2529 2542 node.operator = this.value; 2530 2543 node.prefix = true; … … 2540 2553 else { sawUnary = true; } 2541 2554 expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); 2555 } else if (!sawUnary && this.type === types$1.privateId) { 2556 if (forInit || this.privateNameStack.length === 0) { this.unexpected(); } 2557 expr = this.parsePrivateIdent(); 2558 // only could be private fields in 'in', such as #x in obj 2559 if (this.type !== types$1._in) { this.unexpected(); } 2542 2560 } else { 2543 2561 expr = this.parseExprSubscripts(refDestructuringErrors, forInit); … … 2554 2572 } 2555 2573 2556 if (!incDec && this.eat(types .starstar)) {2574 if (!incDec && this.eat(types$1.starstar)) { 2557 2575 if (sawUnary) 2558 2576 { this.unexpected(this.lastTokStart); } … … 2573 2591 // Parse call, dot, and `[]`-subscript expressions. 2574 2592 2575 pp$ 4.parseExprSubscripts = function(refDestructuringErrors, forInit) {2593 pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { 2576 2594 var startPos = this.start, startLoc = this.startLoc; 2577 2595 var expr = this.parseExprAtom(refDestructuringErrors, forInit); … … 2587 2605 }; 2588 2606 2589 pp$ 4.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {2607 pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { 2590 2608 var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && 2591 2609 this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && … … 2610 2628 }; 2611 2629 2612 pp$ 4.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {2630 pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { 2613 2631 var optionalSupported = this.options.ecmaVersion >= 11; 2614 var optional = optionalSupported && this.eat(types .questionDot);2632 var optional = optionalSupported && this.eat(types$1.questionDot); 2615 2633 if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } 2616 2634 2617 var computed = this.eat(types .bracketL);2618 if (computed || (optional && this.type !== types .parenL && this.type !== types.backQuote) || this.eat(types.dot)) {2635 var computed = this.eat(types$1.bracketL); 2636 if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) { 2619 2637 var node = this.startNodeAt(startPos, startLoc); 2620 2638 node.object = base; 2621 2639 if (computed) { 2622 2640 node.property = this.parseExpression(); 2623 this.expect(types .bracketR);2624 } else if (this.type === types .privateId && base.type !== "Super") {2641 this.expect(types$1.bracketR); 2642 } else if (this.type === types$1.privateId && base.type !== "Super") { 2625 2643 node.property = this.parsePrivateIdent(); 2626 2644 } else { … … 2632 2650 } 2633 2651 base = this.finishNode(node, "MemberExpression"); 2634 } else if (!noCalls && this.eat(types .parenL)) {2652 } else if (!noCalls && this.eat(types$1.parenL)) { 2635 2653 var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; 2636 2654 this.yieldPos = 0; 2637 2655 this.awaitPos = 0; 2638 2656 this.awaitIdentPos = 0; 2639 var exprList = this.parseExprList(types .parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);2640 if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types .arrow)) {2657 var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); 2658 if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { 2641 2659 this.checkPatternErrors(refDestructuringErrors, false); 2642 2660 this.checkYieldAwaitInDefaultParams(); … … 2659 2677 } 2660 2678 base = this.finishNode(node$1, "CallExpression"); 2661 } else if (this.type === types .backQuote) {2679 } else if (this.type === types$1.backQuote) { 2662 2680 if (optional || optionalChained) { 2663 2681 this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); … … 2676 2694 // or `{}`. 2677 2695 2678 pp$ 4.parseExprAtom = function(refDestructuringErrors, forInit) {2696 pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { 2679 2697 // If a division operator appears in an expression position, the 2680 2698 // tokenizer got confused, and we force it to read a regexp instead. 2681 if (this.type === types .slash) { this.readRegexp(); }2699 if (this.type === types$1.slash) { this.readRegexp(); } 2682 2700 2683 2701 var node, canBeArrow = this.potentialArrowAt === this.start; 2684 2702 switch (this.type) { 2685 case types ._super:2703 case types$1._super: 2686 2704 if (!this.allowSuper) 2687 2705 { this.raise(this.start, "'super' keyword outside a method"); } 2688 2706 node = this.startNode(); 2689 2707 this.next(); 2690 if (this.type === types .parenL && !this.allowDirectSuper)2708 if (this.type === types$1.parenL && !this.allowDirectSuper) 2691 2709 { this.raise(node.start, "super() call outside constructor of a subclass"); } 2692 2710 // The `super` keyword can appear at below: … … 2696 2714 // SuperCall: 2697 2715 // super ( Arguments ) 2698 if (this.type !== types .dot && this.type !== types.bracketL && this.type !== types.parenL)2716 if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) 2699 2717 { this.unexpected(); } 2700 2718 return this.finishNode(node, "Super") 2701 2719 2702 case types ._this:2720 case types$1._this: 2703 2721 node = this.startNode(); 2704 2722 this.next(); 2705 2723 return this.finishNode(node, "ThisExpression") 2706 2724 2707 case types .name:2725 case types$1.name: 2708 2726 var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; 2709 2727 var id = this.parseIdent(false); 2710 if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types ._function)) {2711 this.overrideContext(types $1.f_expr);2728 if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { 2729 this.overrideContext(types.f_expr); 2712 2730 return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit) 2713 2731 } 2714 2732 if (canBeArrow && !this.canInsertSemicolon()) { 2715 if (this.eat(types .arrow))2733 if (this.eat(types$1.arrow)) 2716 2734 { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) } 2717 if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types .name && !containsEsc &&2735 if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && 2718 2736 (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { 2719 2737 id = this.parseIdent(false); 2720 if (this.canInsertSemicolon() || !this.eat(types .arrow))2738 if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) 2721 2739 { this.unexpected(); } 2722 2740 return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit) … … 2725 2743 return id 2726 2744 2727 case types .regexp:2745 case types$1.regexp: 2728 2746 var value = this.value; 2729 2747 node = this.parseLiteral(value.value); … … 2731 2749 return node 2732 2750 2733 case types .num: case types.string:2751 case types$1.num: case types$1.string: 2734 2752 return this.parseLiteral(this.value) 2735 2753 2736 case types ._null: case types._true: case types._false:2754 case types$1._null: case types$1._true: case types$1._false: 2737 2755 node = this.startNode(); 2738 node.value = this.type === types ._null ? null : this.type === types._true;2756 node.value = this.type === types$1._null ? null : this.type === types$1._true; 2739 2757 node.raw = this.type.keyword; 2740 2758 this.next(); 2741 2759 return this.finishNode(node, "Literal") 2742 2760 2743 case types .parenL:2761 case types$1.parenL: 2744 2762 var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); 2745 2763 if (refDestructuringErrors) { … … 2751 2769 return expr 2752 2770 2753 case types .bracketL:2771 case types$1.bracketL: 2754 2772 node = this.startNode(); 2755 2773 this.next(); 2756 node.elements = this.parseExprList(types .bracketR, true, true, refDestructuringErrors);2774 node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); 2757 2775 return this.finishNode(node, "ArrayExpression") 2758 2776 2759 case types .braceL:2760 this.overrideContext(types $1.b_expr);2777 case types$1.braceL: 2778 this.overrideContext(types.b_expr); 2761 2779 return this.parseObj(false, refDestructuringErrors) 2762 2780 2763 case types ._function:2781 case types$1._function: 2764 2782 node = this.startNode(); 2765 2783 this.next(); 2766 2784 return this.parseFunction(node, 0) 2767 2785 2768 case types ._class:2786 case types$1._class: 2769 2787 return this.parseClass(this.startNode(), false) 2770 2788 2771 case types ._new:2789 case types$1._new: 2772 2790 return this.parseNew() 2773 2791 2774 case types .backQuote:2792 case types$1.backQuote: 2775 2793 return this.parseTemplate() 2776 2794 2777 case types ._import:2795 case types$1._import: 2778 2796 if (this.options.ecmaVersion >= 11) { 2779 2797 return this.parseExprImport() … … 2787 2805 }; 2788 2806 2789 pp$ 4.parseExprImport = function() {2807 pp$5.parseExprImport = function() { 2790 2808 var node = this.startNode(); 2791 2809 … … 2796 2814 2797 2815 switch (this.type) { 2798 case types .parenL:2816 case types$1.parenL: 2799 2817 return this.parseDynamicImport(node) 2800 case types .dot:2818 case types$1.dot: 2801 2819 node.meta = meta; 2802 2820 return this.parseImportMeta(node) … … 2806 2824 }; 2807 2825 2808 pp$ 4.parseDynamicImport = function(node) {2826 pp$5.parseDynamicImport = function(node) { 2809 2827 this.next(); // skip `(` 2810 2828 … … 2813 2831 2814 2832 // Verify ending. 2815 if (!this.eat(types .parenR)) {2833 if (!this.eat(types$1.parenR)) { 2816 2834 var errorPos = this.start; 2817 if (this.eat(types .comma) && this.eat(types.parenR)) {2835 if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { 2818 2836 this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); 2819 2837 } else { … … 2825 2843 }; 2826 2844 2827 pp$ 4.parseImportMeta = function(node) {2845 pp$5.parseImportMeta = function(node) { 2828 2846 this.next(); // skip `.` 2829 2847 … … 2841 2859 }; 2842 2860 2843 pp$ 4.parseLiteral = function(value) {2861 pp$5.parseLiteral = function(value) { 2844 2862 var node = this.startNode(); 2845 2863 node.value = value; … … 2850 2868 }; 2851 2869 2852 pp$ 4.parseParenExpression = function() {2853 this.expect(types .parenL);2870 pp$5.parseParenExpression = function() { 2871 this.expect(types$1.parenL); 2854 2872 var val = this.parseExpression(); 2855 this.expect(types .parenR);2873 this.expect(types$1.parenR); 2856 2874 return val 2857 2875 }; 2858 2876 2859 pp$ 4.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {2877 pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { 2860 2878 var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; 2861 2879 if (this.options.ecmaVersion >= 6) { … … 2868 2886 this.awaitPos = 0; 2869 2887 // Do not save awaitIdentPos to allow checking awaits nested in parameters 2870 while (this.type !== types .parenR) {2871 first ? first = false : this.expect(types .comma);2872 if (allowTrailingComma && this.afterTrailingComma(types .parenR, true)) {2888 while (this.type !== types$1.parenR) { 2889 first ? first = false : this.expect(types$1.comma); 2890 if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { 2873 2891 lastIsComma = true; 2874 2892 break 2875 } else if (this.type === types .ellipsis) {2893 } else if (this.type === types$1.ellipsis) { 2876 2894 spreadStart = this.start; 2877 2895 exprList.push(this.parseParenItem(this.parseRestBinding())); 2878 if (this.type === types .comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }2896 if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } 2879 2897 break 2880 2898 } else { … … 2883 2901 } 2884 2902 var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; 2885 this.expect(types .parenR);2886 2887 if (canBeArrow && !this.canInsertSemicolon() && this.eat(types .arrow)) {2903 this.expect(types$1.parenR); 2904 2905 if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { 2888 2906 this.checkPatternErrors(refDestructuringErrors, false); 2889 2907 this.checkYieldAwaitInDefaultParams(); … … 2919 2937 }; 2920 2938 2921 pp$ 4.parseParenItem = function(item) {2939 pp$5.parseParenItem = function(item) { 2922 2940 return item 2923 2941 }; 2924 2942 2925 pp$ 4.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {2926 return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, f orInit)2943 pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { 2944 return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit) 2927 2945 }; 2928 2946 … … 2933 2951 // argument list. 2934 2952 2935 var empty $1= [];2936 2937 pp$ 4.parseNew = function() {2953 var empty = []; 2954 2955 pp$5.parseNew = function() { 2938 2956 if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } 2939 2957 var node = this.startNode(); 2940 2958 var meta = this.parseIdent(true); 2941 if (this.options.ecmaVersion >= 6 && this.eat(types .dot)) {2959 if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { 2942 2960 node.meta = meta; 2943 2961 var containsEsc = this.containsEsc; … … 2951 2969 return this.finishNode(node, "MetaProperty") 2952 2970 } 2953 var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types ._import;2971 var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; 2954 2972 node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); 2955 2973 if (isImport && node.callee.type === "ImportExpression") { 2956 2974 this.raise(startPos, "Cannot use new with import()"); 2957 2975 } 2958 if (this.eat(types .parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); }2959 else { node.arguments = empty $1; }2976 if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); } 2977 else { node.arguments = empty; } 2960 2978 return this.finishNode(node, "NewExpression") 2961 2979 }; … … 2963 2981 // Parse template expression. 2964 2982 2965 pp$ 4.parseTemplateElement = function(ref) {2983 pp$5.parseTemplateElement = function(ref) { 2966 2984 var isTagged = ref.isTagged; 2967 2985 2968 2986 var elem = this.startNode(); 2969 if (this.type === types .invalidTemplate) {2987 if (this.type === types$1.invalidTemplate) { 2970 2988 if (!isTagged) { 2971 2989 this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); … … 2982 3000 } 2983 3001 this.next(); 2984 elem.tail = this.type === types .backQuote;3002 elem.tail = this.type === types$1.backQuote; 2985 3003 return this.finishNode(elem, "TemplateElement") 2986 3004 }; 2987 3005 2988 pp$ 4.parseTemplate = function(ref) {3006 pp$5.parseTemplate = function(ref) { 2989 3007 if ( ref === void 0 ) ref = {}; 2990 3008 var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; … … 2996 3014 node.quasis = [curElt]; 2997 3015 while (!curElt.tail) { 2998 if (this.type === types .eof) { this.raise(this.pos, "Unterminated template literal"); }2999 this.expect(types .dollarBraceL);3016 if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); } 3017 this.expect(types$1.dollarBraceL); 3000 3018 node.expressions.push(this.parseExpression()); 3001 this.expect(types .braceR);3019 this.expect(types$1.braceR); 3002 3020 node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); 3003 3021 } … … 3006 3024 }; 3007 3025 3008 pp$ 4.isAsyncProp = function(prop) {3026 pp$5.isAsyncProp = function(prop) { 3009 3027 return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && 3010 (this.type === types .name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) &&3028 (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) && 3011 3029 !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) 3012 3030 }; … … 3014 3032 // Parse an object literal or binding pattern. 3015 3033 3016 pp$ 4.parseObj = function(isPattern, refDestructuringErrors) {3034 pp$5.parseObj = function(isPattern, refDestructuringErrors) { 3017 3035 var node = this.startNode(), first = true, propHash = {}; 3018 3036 node.properties = []; 3019 3037 this.next(); 3020 while (!this.eat(types .braceR)) {3038 while (!this.eat(types$1.braceR)) { 3021 3039 if (!first) { 3022 this.expect(types .comma);3023 if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types .braceR)) { break }3040 this.expect(types$1.comma); 3041 if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break } 3024 3042 } else { first = false; } 3025 3043 … … 3031 3049 }; 3032 3050 3033 pp$ 4.parseProperty = function(isPattern, refDestructuringErrors) {3051 pp$5.parseProperty = function(isPattern, refDestructuringErrors) { 3034 3052 var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; 3035 if (this.options.ecmaVersion >= 9 && this.eat(types .ellipsis)) {3053 if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { 3036 3054 if (isPattern) { 3037 3055 prop.argument = this.parseIdent(false); 3038 if (this.type === types .comma) {3056 if (this.type === types$1.comma) { 3039 3057 this.raise(this.start, "Comma is not permitted after the rest element"); 3040 3058 } … … 3042 3060 } 3043 3061 // To disallow parenthesized identifier via `this.toAssignable()`. 3044 if (this.type === types .parenL && refDestructuringErrors) {3062 if (this.type === types$1.parenL && refDestructuringErrors) { 3045 3063 if (refDestructuringErrors.parenthesizedAssign < 0) { 3046 3064 refDestructuringErrors.parenthesizedAssign = this.start; … … 3053 3071 prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); 3054 3072 // To disallow trailing comma via `this.toAssignable()`. 3055 if (this.type === types .comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {3073 if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { 3056 3074 refDestructuringErrors.trailingComma = this.start; 3057 3075 } … … 3067 3085 } 3068 3086 if (!isPattern) 3069 { isGenerator = this.eat(types .star); }3087 { isGenerator = this.eat(types$1.star); } 3070 3088 } 3071 3089 var containsEsc = this.containsEsc; … … 3073 3091 if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { 3074 3092 isAsync = true; 3075 isGenerator = this.options.ecmaVersion >= 9 && this.eat(types .star);3093 isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); 3076 3094 this.parsePropertyName(prop, refDestructuringErrors); 3077 3095 } else { … … 3082 3100 }; 3083 3101 3084 pp$ 4.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {3085 if ((isGenerator || isAsync) && this.type === types .colon)3102 pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { 3103 if ((isGenerator || isAsync) && this.type === types$1.colon) 3086 3104 { this.unexpected(); } 3087 3105 3088 if (this.eat(types .colon)) {3106 if (this.eat(types$1.colon)) { 3089 3107 prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); 3090 3108 prop.kind = "init"; 3091 } else if (this.options.ecmaVersion >= 6 && this.type === types .parenL) {3109 } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { 3092 3110 if (isPattern) { this.unexpected(); } 3093 3111 prop.kind = "init"; … … 3097 3115 this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && 3098 3116 (prop.key.name === "get" || prop.key.name === "set") && 3099 (this.type !== types .comma && this.type !== types.braceR && this.type !== types.eq)) {3117 (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { 3100 3118 if (isGenerator || isAsync) { this.unexpected(); } 3101 3119 prop.kind = prop.key.name; … … 3121 3139 if (isPattern) { 3122 3140 prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); 3123 } else if (this.type === types .eq && refDestructuringErrors) {3141 } else if (this.type === types$1.eq && refDestructuringErrors) { 3124 3142 if (refDestructuringErrors.shorthandAssign < 0) 3125 3143 { refDestructuringErrors.shorthandAssign = this.start; } … … 3132 3150 }; 3133 3151 3134 pp$ 4.parsePropertyName = function(prop) {3152 pp$5.parsePropertyName = function(prop) { 3135 3153 if (this.options.ecmaVersion >= 6) { 3136 if (this.eat(types .bracketL)) {3154 if (this.eat(types$1.bracketL)) { 3137 3155 prop.computed = true; 3138 3156 prop.key = this.parseMaybeAssign(); 3139 this.expect(types .bracketR);3157 this.expect(types$1.bracketR); 3140 3158 return prop.key 3141 3159 } else { … … 3143 3161 } 3144 3162 } 3145 return prop.key = this.type === types .num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")3163 return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") 3146 3164 }; 3147 3165 3148 3166 // Initialize empty function node. 3149 3167 3150 pp$ 4.initFunction = function(node) {3168 pp$5.initFunction = function(node) { 3151 3169 node.id = null; 3152 3170 if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } … … 3156 3174 // Parse object or class method. 3157 3175 3158 pp$ 4.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {3176 pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { 3159 3177 var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; 3160 3178 … … 3170 3188 this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); 3171 3189 3172 this.expect(types .parenL);3173 node.params = this.parseBindingList(types .parenR, false, this.options.ecmaVersion >= 8);3190 this.expect(types$1.parenL); 3191 node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); 3174 3192 this.checkYieldAwaitInDefaultParams(); 3175 3193 this.parseFunctionBody(node, false, true, false); … … 3183 3201 // Parse arrow function expression with given parameters. 3184 3202 3185 pp$ 4.parseArrowExpression = function(node, params, isAsync, forInit) {3203 pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { 3186 3204 var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; 3187 3205 … … 3205 3223 // Parse function body and check parameters. 3206 3224 3207 pp$ 4.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {3208 var isExpression = isArrowFunction && this.type !== types .braceL;3225 pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { 3226 var isExpression = isArrowFunction && this.type !== types$1.braceL; 3209 3227 var oldStrict = this.strict, useStrict = false; 3210 3228 … … 3242 3260 }; 3243 3261 3244 pp$ 4.isSimpleParamList = function(params) {3262 pp$5.isSimpleParamList = function(params) { 3245 3263 for (var i = 0, list = params; i < list.length; i += 1) 3246 3264 { … … 3255 3273 // or "arguments" and duplicate parameters. 3256 3274 3257 pp$ 4.checkParams = function(node, allowDuplicates) {3275 pp$5.checkParams = function(node, allowDuplicates) { 3258 3276 var nameHash = Object.create(null); 3259 3277 for (var i = 0, list = node.params; i < list.length; i += 1) … … 3271 3289 // for array literals). 3272 3290 3273 pp$ 4.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {3291 pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { 3274 3292 var elts = [], first = true; 3275 3293 while (!this.eat(close)) { 3276 3294 if (!first) { 3277 this.expect(types .comma);3295 this.expect(types$1.comma); 3278 3296 if (allowTrailingComma && this.afterTrailingComma(close)) { break } 3279 3297 } else { first = false; } 3280 3298 3281 3299 var elt = (void 0); 3282 if (allowEmpty && this.type === types .comma)3300 if (allowEmpty && this.type === types$1.comma) 3283 3301 { elt = null; } 3284 else if (this.type === types .ellipsis) {3302 else if (this.type === types$1.ellipsis) { 3285 3303 elt = this.parseSpread(refDestructuringErrors); 3286 if (refDestructuringErrors && this.type === types .comma && refDestructuringErrors.trailingComma < 0)3304 if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) 3287 3305 { refDestructuringErrors.trailingComma = this.start; } 3288 3306 } else { … … 3294 3312 }; 3295 3313 3296 pp$ 4.checkUnreserved = function(ref) {3314 pp$5.checkUnreserved = function(ref) { 3297 3315 var start = ref.start; 3298 3316 var end = ref.end; … … 3323 3341 // identifiers. 3324 3342 3325 pp$ 4.parseIdent = function(liberal, isBinding) {3343 pp$5.parseIdent = function(liberal, isBinding) { 3326 3344 var node = this.startNode(); 3327 if (this.type === types .name) {3345 if (this.type === types$1.name) { 3328 3346 node.name = this.value; 3329 3347 } else if (this.type.keyword) { … … 3351 3369 }; 3352 3370 3353 pp$ 4.parsePrivateIdent = function() {3371 pp$5.parsePrivateIdent = function() { 3354 3372 var node = this.startNode(); 3355 if (this.type === types .privateId) {3373 if (this.type === types$1.privateId) { 3356 3374 node.name = this.value; 3357 3375 } else { … … 3373 3391 // Parses yield expression inside generator. 3374 3392 3375 pp$ 4.parseYield = function(forInit) {3393 pp$5.parseYield = function(forInit) { 3376 3394 if (!this.yieldPos) { this.yieldPos = this.start; } 3377 3395 3378 3396 var node = this.startNode(); 3379 3397 this.next(); 3380 if (this.type === types .semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) {3398 if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) { 3381 3399 node.delegate = false; 3382 3400 node.argument = null; 3383 3401 } else { 3384 node.delegate = this.eat(types .star);3402 node.delegate = this.eat(types$1.star); 3385 3403 node.argument = this.parseMaybeAssign(forInit); 3386 3404 } … … 3388 3406 }; 3389 3407 3390 pp$ 4.parseAwait = function(forInit) {3408 pp$5.parseAwait = function(forInit) { 3391 3409 if (!this.awaitPos) { this.awaitPos = this.start; } 3392 3410 … … 3397 3415 }; 3398 3416 3399 var pp$ 5= Parser.prototype;3417 var pp$4 = Parser.prototype; 3400 3418 3401 3419 // This function is used to raise exceptions on parse errors. It … … 3405 3423 // message. 3406 3424 3407 pp$ 5.raise = function(pos, message) {3425 pp$4.raise = function(pos, message) { 3408 3426 var loc = getLineInfo(this.input, pos); 3409 3427 message += " (" + loc.line + ":" + loc.column + ")"; … … 3413 3431 }; 3414 3432 3415 pp$ 5.raiseRecoverable = pp$5.raise;3416 3417 pp$ 5.curPosition = function() {3433 pp$4.raiseRecoverable = pp$4.raise; 3434 3435 pp$4.curPosition = function() { 3418 3436 if (this.options.locations) { 3419 3437 return new Position(this.curLine, this.pos - this.lineStart) … … 3421 3439 }; 3422 3440 3423 var pp$ 6= Parser.prototype;3441 var pp$3 = Parser.prototype; 3424 3442 3425 3443 var Scope = function Scope(flags) { … … 3437 3455 // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. 3438 3456 3439 pp$ 6.enterScope = function(flags) {3457 pp$3.enterScope = function(flags) { 3440 3458 this.scopeStack.push(new Scope(flags)); 3441 3459 }; 3442 3460 3443 pp$ 6.exitScope = function() {3461 pp$3.exitScope = function() { 3444 3462 this.scopeStack.pop(); 3445 3463 }; … … 3448 3466 // > At the top level of a function, or script, function declarations are 3449 3467 // > treated like var declarations rather than like lexical declarations. 3450 pp$ 6.treatFunctionsAsVarInScope = function(scope) {3468 pp$3.treatFunctionsAsVarInScope = function(scope) { 3451 3469 return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) 3452 3470 }; 3453 3471 3454 pp$ 6.declareName = function(name, bindingType, pos) {3472 pp$3.declareName = function(name, bindingType, pos) { 3455 3473 var redeclared = false; 3456 3474 if (bindingType === BIND_LEXICAL) { … … 3487 3505 }; 3488 3506 3489 pp$ 6.checkLocalExport = function(id) {3507 pp$3.checkLocalExport = function(id) { 3490 3508 // scope.functions must be empty as Module code is always strict. 3491 3509 if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && … … 3495 3513 }; 3496 3514 3497 pp$ 6.currentScope = function() {3515 pp$3.currentScope = function() { 3498 3516 return this.scopeStack[this.scopeStack.length - 1] 3499 3517 }; 3500 3518 3501 pp$ 6.currentVarScope = function() {3519 pp$3.currentVarScope = function() { 3502 3520 for (var i = this.scopeStack.length - 1;; i--) { 3503 3521 var scope = this.scopeStack[i]; … … 3507 3525 3508 3526 // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. 3509 pp$ 6.currentThisScope = function() {3527 pp$3.currentThisScope = function() { 3510 3528 for (var i = this.scopeStack.length - 1;; i--) { 3511 3529 var scope = this.scopeStack[i]; … … 3528 3546 // Start an AST node, attaching a start offset. 3529 3547 3530 var pp$ 7= Parser.prototype;3531 3532 pp$ 7.startNode = function() {3548 var pp$2 = Parser.prototype; 3549 3550 pp$2.startNode = function() { 3533 3551 return new Node(this, this.start, this.startLoc) 3534 3552 }; 3535 3553 3536 pp$ 7.startNodeAt = function(pos, loc) {3554 pp$2.startNodeAt = function(pos, loc) { 3537 3555 return new Node(this, pos, loc) 3538 3556 }; … … 3550 3568 } 3551 3569 3552 pp$ 7.finishNode = function(node, type) {3570 pp$2.finishNode = function(node, type) { 3553 3571 return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) 3554 3572 }; … … 3556 3574 // Finish node at given position 3557 3575 3558 pp$ 7.finishNodeAt = function(node, type, pos, loc) {3576 pp$2.finishNodeAt = function(node, type, pos, loc) { 3559 3577 return finishNodeAt.call(this, node, type, pos, loc) 3560 3578 }; 3561 3579 3562 pp$ 7.copyNode = function(node) {3580 pp$2.copyNode = function(node) { 3563 3581 var newNode = new Node(this, node.start, this.startLoc); 3564 3582 for (var prop in node) { newNode[prop] = node[prop]; } … … 3617 3635 buildUnicodeData(12); 3618 3636 3619 var pp$ 8= Parser.prototype;3637 var pp$1 = Parser.prototype; 3620 3638 3621 3639 var RegExpValidationState = function RegExpValidationState(parser) { … … 3713 3731 }; 3714 3732 3715 function codePointToString (ch) {3733 function codePointToString$1(ch) { 3716 3734 if (ch <= 0xFFFF) { return String.fromCharCode(ch) } 3717 3735 ch -= 0x10000; … … 3725 3743 * @returns {void} 3726 3744 */ 3727 pp$ 8.validateRegExpFlags = function(state) {3745 pp$1.validateRegExpFlags = function(state) { 3728 3746 var validFlags = state.validFlags; 3729 3747 var flags = state.flags; … … 3746 3764 * @returns {void} 3747 3765 */ 3748 pp$ 8.validateRegExpPattern = function(state) {3766 pp$1.validateRegExpPattern = function(state) { 3749 3767 this.regexp_pattern(state); 3750 3768 … … 3761 3779 3762 3780 // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern 3763 pp$ 8.regexp_pattern = function(state) {3781 pp$1.regexp_pattern = function(state) { 3764 3782 state.pos = 0; 3765 3783 state.lastIntValue = 0; … … 3795 3813 3796 3814 // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction 3797 pp$ 8.regexp_disjunction = function(state) {3815 pp$1.regexp_disjunction = function(state) { 3798 3816 this.regexp_alternative(state); 3799 3817 while (state.eat(0x7C /* | */)) { … … 3811 3829 3812 3830 // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative 3813 pp$ 8.regexp_alternative = function(state) {3831 pp$1.regexp_alternative = function(state) { 3814 3832 while (state.pos < state.source.length && this.regexp_eatTerm(state)) 3815 3833 { } … … 3817 3835 3818 3836 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term 3819 pp$ 8.regexp_eatTerm = function(state) {3837 pp$1.regexp_eatTerm = function(state) { 3820 3838 if (this.regexp_eatAssertion(state)) { 3821 3839 // Handle `QuantifiableAssertion Quantifier` alternative. … … 3840 3858 3841 3859 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion 3842 pp$ 8.regexp_eatAssertion = function(state) {3860 pp$1.regexp_eatAssertion = function(state) { 3843 3861 var start = state.pos; 3844 3862 state.lastAssertionIsQuantifiable = false; … … 3878 3896 3879 3897 // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier 3880 pp$ 8.regexp_eatQuantifier = function(state, noError) {3898 pp$1.regexp_eatQuantifier = function(state, noError) { 3881 3899 if ( noError === void 0 ) noError = false; 3882 3900 … … 3889 3907 3890 3908 // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix 3891 pp$ 8.regexp_eatQuantifierPrefix = function(state, noError) {3909 pp$1.regexp_eatQuantifierPrefix = function(state, noError) { 3892 3910 return ( 3893 3911 state.eat(0x2A /* * */) || … … 3897 3915 ) 3898 3916 }; 3899 pp$ 8.regexp_eatBracedQuantifier = function(state, noError) {3917 pp$1.regexp_eatBracedQuantifier = function(state, noError) { 3900 3918 var start = state.pos; 3901 3919 if (state.eat(0x7B /* { */)) { … … 3923 3941 3924 3942 // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom 3925 pp$ 8.regexp_eatAtom = function(state) {3943 pp$1.regexp_eatAtom = function(state) { 3926 3944 return ( 3927 3945 this.regexp_eatPatternCharacters(state) || … … 3933 3951 ) 3934 3952 }; 3935 pp$ 8.regexp_eatReverseSolidusAtomEscape = function(state) {3953 pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { 3936 3954 var start = state.pos; 3937 3955 if (state.eat(0x5C /* \ */)) { … … 3943 3961 return false 3944 3962 }; 3945 pp$ 8.regexp_eatUncapturingGroup = function(state) {3963 pp$1.regexp_eatUncapturingGroup = function(state) { 3946 3964 var start = state.pos; 3947 3965 if (state.eat(0x28 /* ( */)) { … … 3957 3975 return false 3958 3976 }; 3959 pp$ 8.regexp_eatCapturingGroup = function(state) {3977 pp$1.regexp_eatCapturingGroup = function(state) { 3960 3978 if (state.eat(0x28 /* ( */)) { 3961 3979 if (this.options.ecmaVersion >= 9) { … … 3975 3993 3976 3994 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom 3977 pp$ 8.regexp_eatExtendedAtom = function(state) {3995 pp$1.regexp_eatExtendedAtom = function(state) { 3978 3996 return ( 3979 3997 state.eat(0x2E /* . */) || … … 3988 4006 3989 4007 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier 3990 pp$ 8.regexp_eatInvalidBracedQuantifier = function(state) {4008 pp$1.regexp_eatInvalidBracedQuantifier = function(state) { 3991 4009 if (this.regexp_eatBracedQuantifier(state, true)) { 3992 4010 state.raise("Nothing to repeat"); … … 3996 4014 3997 4015 // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter 3998 pp$ 8.regexp_eatSyntaxCharacter = function(state) {4016 pp$1.regexp_eatSyntaxCharacter = function(state) { 3999 4017 var ch = state.current(); 4000 4018 if (isSyntaxCharacter(ch)) { … … 4018 4036 // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter 4019 4037 // But eat eager. 4020 pp$ 8.regexp_eatPatternCharacters = function(state) {4038 pp$1.regexp_eatPatternCharacters = function(state) { 4021 4039 var start = state.pos; 4022 4040 var ch = 0; … … 4028 4046 4029 4047 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter 4030 pp$ 8.regexp_eatExtendedPatternCharacter = function(state) {4048 pp$1.regexp_eatExtendedPatternCharacter = function(state) { 4031 4049 var ch = state.current(); 4032 4050 if ( … … 4049 4067 // [empty] 4050 4068 // `?` GroupName 4051 pp$ 8.regexp_groupSpecifier = function(state) {4069 pp$1.regexp_groupSpecifier = function(state) { 4052 4070 if (state.eat(0x3F /* ? */)) { 4053 4071 if (this.regexp_eatGroupName(state)) { … … 4065 4083 // `<` RegExpIdentifierName `>` 4066 4084 // Note: this updates `state.lastStringValue` property with the eaten name. 4067 pp$ 8.regexp_eatGroupName = function(state) {4085 pp$1.regexp_eatGroupName = function(state) { 4068 4086 state.lastStringValue = ""; 4069 4087 if (state.eat(0x3C /* < */)) { … … 4080 4098 // RegExpIdentifierName RegExpIdentifierPart 4081 4099 // Note: this updates `state.lastStringValue` property with the eaten name. 4082 pp$ 8.regexp_eatRegExpIdentifierName = function(state) {4100 pp$1.regexp_eatRegExpIdentifierName = function(state) { 4083 4101 state.lastStringValue = ""; 4084 4102 if (this.regexp_eatRegExpIdentifierStart(state)) { 4085 state.lastStringValue += codePointToString (state.lastIntValue);4103 state.lastStringValue += codePointToString$1(state.lastIntValue); 4086 4104 while (this.regexp_eatRegExpIdentifierPart(state)) { 4087 state.lastStringValue += codePointToString (state.lastIntValue);4105 state.lastStringValue += codePointToString$1(state.lastIntValue); 4088 4106 } 4089 4107 return true … … 4097 4115 // `_` 4098 4116 // `\` RegExpUnicodeEscapeSequence[+U] 4099 pp$ 8.regexp_eatRegExpIdentifierStart = function(state) {4117 pp$1.regexp_eatRegExpIdentifierStart = function(state) { 4100 4118 var start = state.pos; 4101 4119 var forceU = this.options.ecmaVersion >= 11; … … 4125 4143 // <ZWNJ> 4126 4144 // <ZWJ> 4127 pp$ 8.regexp_eatRegExpIdentifierPart = function(state) {4145 pp$1.regexp_eatRegExpIdentifierPart = function(state) { 4128 4146 var start = state.pos; 4129 4147 var forceU = this.options.ecmaVersion >= 11; … … 4147 4165 4148 4166 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape 4149 pp$ 8.regexp_eatAtomEscape = function(state) {4167 pp$1.regexp_eatAtomEscape = function(state) { 4150 4168 if ( 4151 4169 this.regexp_eatBackReference(state) || … … 4165 4183 return false 4166 4184 }; 4167 pp$ 8.regexp_eatBackReference = function(state) {4185 pp$1.regexp_eatBackReference = function(state) { 4168 4186 var start = state.pos; 4169 4187 if (this.regexp_eatDecimalEscape(state)) { … … 4183 4201 return false 4184 4202 }; 4185 pp$ 8.regexp_eatKGroupName = function(state) {4203 pp$1.regexp_eatKGroupName = function(state) { 4186 4204 if (state.eat(0x6B /* k */)) { 4187 4205 if (this.regexp_eatGroupName(state)) { … … 4195 4213 4196 4214 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape 4197 pp$ 8.regexp_eatCharacterEscape = function(state) {4215 pp$1.regexp_eatCharacterEscape = function(state) { 4198 4216 return ( 4199 4217 this.regexp_eatControlEscape(state) || … … 4206 4224 ) 4207 4225 }; 4208 pp$ 8.regexp_eatCControlLetter = function(state) {4226 pp$1.regexp_eatCControlLetter = function(state) { 4209 4227 var start = state.pos; 4210 4228 if (state.eat(0x63 /* c */)) { … … 4216 4234 return false 4217 4235 }; 4218 pp$ 8.regexp_eatZero = function(state) {4236 pp$1.regexp_eatZero = function(state) { 4219 4237 if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { 4220 4238 state.lastIntValue = 0; … … 4226 4244 4227 4245 // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape 4228 pp$ 8.regexp_eatControlEscape = function(state) {4246 pp$1.regexp_eatControlEscape = function(state) { 4229 4247 var ch = state.current(); 4230 4248 if (ch === 0x74 /* t */) { … … 4257 4275 4258 4276 // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter 4259 pp$ 8.regexp_eatControlLetter = function(state) {4277 pp$1.regexp_eatControlLetter = function(state) { 4260 4278 var ch = state.current(); 4261 4279 if (isControlLetter(ch)) { … … 4274 4292 4275 4293 // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence 4276 pp$ 8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {4294 pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { 4277 4295 if ( forceU === void 0 ) forceU = false; 4278 4296 … … 4319 4337 4320 4338 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape 4321 pp$ 8.regexp_eatIdentityEscape = function(state) {4339 pp$1.regexp_eatIdentityEscape = function(state) { 4322 4340 if (state.switchU) { 4323 4341 if (this.regexp_eatSyntaxCharacter(state)) { … … 4342 4360 4343 4361 // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape 4344 pp$ 8.regexp_eatDecimalEscape = function(state) {4362 pp$1.regexp_eatDecimalEscape = function(state) { 4345 4363 state.lastIntValue = 0; 4346 4364 var ch = state.current(); … … 4356 4374 4357 4375 // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape 4358 pp$ 8.regexp_eatCharacterClassEscape = function(state) {4376 pp$1.regexp_eatCharacterClassEscape = function(state) { 4359 4377 var ch = state.current(); 4360 4378 … … 4398 4416 // UnicodePropertyName `=` UnicodePropertyValue 4399 4417 // LoneUnicodePropertyNameOrValue 4400 pp$ 8.regexp_eatUnicodePropertyValueExpression = function(state) {4418 pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { 4401 4419 var start = state.pos; 4402 4420 … … 4420 4438 return false 4421 4439 }; 4422 pp$ 8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {4440 pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { 4423 4441 if (!has(state.unicodeProperties.nonBinary, name)) 4424 4442 { state.raise("Invalid property name"); } … … 4426 4444 { state.raise("Invalid property value"); } 4427 4445 }; 4428 pp$ 8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {4446 pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { 4429 4447 if (!state.unicodeProperties.binary.test(nameOrValue)) 4430 4448 { state.raise("Invalid property name"); } … … 4433 4451 // UnicodePropertyName :: 4434 4452 // UnicodePropertyNameCharacters 4435 pp$ 8.regexp_eatUnicodePropertyName = function(state) {4453 pp$1.regexp_eatUnicodePropertyName = function(state) { 4436 4454 var ch = 0; 4437 4455 state.lastStringValue = ""; 4438 4456 while (isUnicodePropertyNameCharacter(ch = state.current())) { 4439 state.lastStringValue += codePointToString (ch);4457 state.lastStringValue += codePointToString$1(ch); 4440 4458 state.advance(); 4441 4459 } … … 4448 4466 // UnicodePropertyValue :: 4449 4467 // UnicodePropertyValueCharacters 4450 pp$ 8.regexp_eatUnicodePropertyValue = function(state) {4468 pp$1.regexp_eatUnicodePropertyValue = function(state) { 4451 4469 var ch = 0; 4452 4470 state.lastStringValue = ""; 4453 4471 while (isUnicodePropertyValueCharacter(ch = state.current())) { 4454 state.lastStringValue += codePointToString (ch);4472 state.lastStringValue += codePointToString$1(ch); 4455 4473 state.advance(); 4456 4474 } … … 4463 4481 // LoneUnicodePropertyNameOrValue :: 4464 4482 // UnicodePropertyValueCharacters 4465 pp$ 8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {4483 pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { 4466 4484 return this.regexp_eatUnicodePropertyValue(state) 4467 4485 }; 4468 4486 4469 4487 // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass 4470 pp$ 8.regexp_eatCharacterClass = function(state) {4488 pp$1.regexp_eatCharacterClass = function(state) { 4471 4489 if (state.eat(0x5B /* [ */)) { 4472 4490 state.eat(0x5E /* ^ */); … … 4484 4502 // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges 4485 4503 // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash 4486 pp$ 8.regexp_classRanges = function(state) {4504 pp$1.regexp_classRanges = function(state) { 4487 4505 while (this.regexp_eatClassAtom(state)) { 4488 4506 var left = state.lastIntValue; … … 4501 4519 // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom 4502 4520 // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash 4503 pp$ 8.regexp_eatClassAtom = function(state) {4521 pp$1.regexp_eatClassAtom = function(state) { 4504 4522 var start = state.pos; 4505 4523 … … 4530 4548 4531 4549 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape 4532 pp$ 8.regexp_eatClassEscape = function(state) {4550 pp$1.regexp_eatClassEscape = function(state) { 4533 4551 var start = state.pos; 4534 4552 … … 4557 4575 4558 4576 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter 4559 pp$ 8.regexp_eatClassControlLetter = function(state) {4577 pp$1.regexp_eatClassControlLetter = function(state) { 4560 4578 var ch = state.current(); 4561 4579 if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { … … 4568 4586 4569 4587 // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence 4570 pp$ 8.regexp_eatHexEscapeSequence = function(state) {4588 pp$1.regexp_eatHexEscapeSequence = function(state) { 4571 4589 var start = state.pos; 4572 4590 if (state.eat(0x78 /* x */)) { … … 4583 4601 4584 4602 // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits 4585 pp$ 8.regexp_eatDecimalDigits = function(state) {4603 pp$1.regexp_eatDecimalDigits = function(state) { 4586 4604 var start = state.pos; 4587 4605 var ch = 0; … … 4598 4616 4599 4617 // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits 4600 pp$ 8.regexp_eatHexDigits = function(state) {4618 pp$1.regexp_eatHexDigits = function(state) { 4601 4619 var start = state.pos; 4602 4620 var ch = 0; … … 4627 4645 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence 4628 4646 // Allows only 0-377(octal) i.e. 0-255(decimal). 4629 pp$ 8.regexp_eatLegacyOctalEscapeSequence = function(state) {4647 pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { 4630 4648 if (this.regexp_eatOctalDigit(state)) { 4631 4649 var n1 = state.lastIntValue; … … 4646 4664 4647 4665 // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit 4648 pp$ 8.regexp_eatOctalDigit = function(state) {4666 pp$1.regexp_eatOctalDigit = function(state) { 4649 4667 var ch = state.current(); 4650 4668 if (isOctalDigit(ch)) { … … 4663 4681 // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit 4664 4682 // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence 4665 pp$ 8.regexp_eatFixedHexDigits = function(state, length) {4683 pp$1.regexp_eatFixedHexDigits = function(state, length) { 4666 4684 var start = state.pos; 4667 4685 state.lastIntValue = 0; … … 4695 4713 // ## Tokenizer 4696 4714 4697 var pp $9= Parser.prototype;4715 var pp = Parser.prototype; 4698 4716 4699 4717 // Move to the next token 4700 4718 4701 pp $9.next = function(ignoreEscapeSequenceInKeyword) {4719 pp.next = function(ignoreEscapeSequenceInKeyword) { 4702 4720 if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) 4703 4721 { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } … … 4712 4730 }; 4713 4731 4714 pp $9.getToken = function() {4732 pp.getToken = function() { 4715 4733 this.next(); 4716 4734 return new Token(this) … … 4719 4737 // If we're in an ES6 environment, make parsers iterable 4720 4738 if (typeof Symbol !== "undefined") 4721 { pp $9[Symbol.iterator] = function() {4722 var this$1 = this;4739 { pp[Symbol.iterator] = function() { 4740 var this$1$1 = this; 4723 4741 4724 4742 return { 4725 4743 next: function () { 4726 var token = this$1 .getToken();4744 var token = this$1$1.getToken(); 4727 4745 return { 4728 done: token.type === types .eof,4746 done: token.type === types$1.eof, 4729 4747 value: token 4730 4748 } … … 4739 4757 // properties. 4740 4758 4741 pp $9.nextToken = function() {4759 pp.nextToken = function() { 4742 4760 var curContext = this.curContext(); 4743 4761 if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } … … 4745 4763 this.start = this.pos; 4746 4764 if (this.options.locations) { this.startLoc = this.curPosition(); } 4747 if (this.pos >= this.input.length) { return this.finishToken(types .eof) }4765 if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) } 4748 4766 4749 4767 if (curContext.override) { return curContext.override(this) } … … 4751 4769 }; 4752 4770 4753 pp $9.readToken = function(code) {4771 pp.readToken = function(code) { 4754 4772 // Identifier or keyword. '\uXXXX' sequences are allowed in 4755 4773 // identifiers, so '\' also dispatches to that. … … 4760 4778 }; 4761 4779 4762 pp $9.fullCharCodeAtPos = function() {4780 pp.fullCharCodeAtPos = function() { 4763 4781 var code = this.input.charCodeAt(this.pos); 4764 4782 if (code <= 0xd7ff || code >= 0xdc00) { return code } … … 4767 4785 }; 4768 4786 4769 pp $9.skipBlockComment = function() {4787 pp.skipBlockComment = function() { 4770 4788 var startLoc = this.options.onComment && this.curPosition(); 4771 4789 var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); … … 4785 4803 }; 4786 4804 4787 pp $9.skipLineComment = function(startSkip) {4805 pp.skipLineComment = function(startSkip) { 4788 4806 var start = this.pos; 4789 4807 var startLoc = this.options.onComment && this.curPosition(); … … 4800 4818 // whitespace and comments, and. 4801 4819 4802 pp $9.skipSpace = function() {4820 pp.skipSpace = function() { 4803 4821 loop: while (this.pos < this.input.length) { 4804 4822 var ch = this.input.charCodeAt(this.pos); … … 4845 4863 // right position. 4846 4864 4847 pp $9.finishToken = function(type, val) {4865 pp.finishToken = function(type, val) { 4848 4866 this.end = this.pos; 4849 4867 if (this.options.locations) { this.endLoc = this.curPosition(); } … … 4864 4882 // All in the name of speed. 4865 4883 // 4866 pp $9.readToken_dot = function() {4884 pp.readToken_dot = function() { 4867 4885 var next = this.input.charCodeAt(this.pos + 1); 4868 4886 if (next >= 48 && next <= 57) { return this.readNumber(true) } … … 4870 4888 if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' 4871 4889 this.pos += 3; 4872 return this.finishToken(types .ellipsis)4890 return this.finishToken(types$1.ellipsis) 4873 4891 } else { 4874 4892 ++this.pos; 4875 return this.finishToken(types .dot)4876 } 4877 }; 4878 4879 pp $9.readToken_slash = function() { // '/'4893 return this.finishToken(types$1.dot) 4894 } 4895 }; 4896 4897 pp.readToken_slash = function() { // '/' 4880 4898 var next = this.input.charCodeAt(this.pos + 1); 4881 4899 if (this.exprAllowed) { ++this.pos; return this.readRegexp() } 4882 if (next === 61) { return this.finishOp(types .assign, 2) }4883 return this.finishOp(types .slash, 1)4884 }; 4885 4886 pp $9.readToken_mult_modulo_exp = function(code) { // '%*'4900 if (next === 61) { return this.finishOp(types$1.assign, 2) } 4901 return this.finishOp(types$1.slash, 1) 4902 }; 4903 4904 pp.readToken_mult_modulo_exp = function(code) { // '%*' 4887 4905 var next = this.input.charCodeAt(this.pos + 1); 4888 4906 var size = 1; 4889 var tokentype = code === 42 ? types .star : types.modulo;4907 var tokentype = code === 42 ? types$1.star : types$1.modulo; 4890 4908 4891 4909 // exponentiation operator ** and **= 4892 4910 if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { 4893 4911 ++size; 4894 tokentype = types .starstar;4912 tokentype = types$1.starstar; 4895 4913 next = this.input.charCodeAt(this.pos + 2); 4896 4914 } 4897 4915 4898 if (next === 61) { return this.finishOp(types .assign, size + 1) }4916 if (next === 61) { return this.finishOp(types$1.assign, size + 1) } 4899 4917 return this.finishOp(tokentype, size) 4900 4918 }; 4901 4919 4902 pp $9.readToken_pipe_amp = function(code) { // '|&'4920 pp.readToken_pipe_amp = function(code) { // '|&' 4903 4921 var next = this.input.charCodeAt(this.pos + 1); 4904 4922 if (next === code) { 4905 4923 if (this.options.ecmaVersion >= 12) { 4906 4924 var next2 = this.input.charCodeAt(this.pos + 2); 4907 if (next2 === 61) { return this.finishOp(types .assign, 3) }4908 } 4909 return this.finishOp(code === 124 ? types .logicalOR : types.logicalAND, 2)4910 } 4911 if (next === 61) { return this.finishOp(types .assign, 2) }4912 return this.finishOp(code === 124 ? types .bitwiseOR : types.bitwiseAND, 1)4913 }; 4914 4915 pp $9.readToken_caret = function() { // '^'4925 if (next2 === 61) { return this.finishOp(types$1.assign, 3) } 4926 } 4927 return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2) 4928 } 4929 if (next === 61) { return this.finishOp(types$1.assign, 2) } 4930 return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1) 4931 }; 4932 4933 pp.readToken_caret = function() { // '^' 4916 4934 var next = this.input.charCodeAt(this.pos + 1); 4917 if (next === 61) { return this.finishOp(types .assign, 2) }4918 return this.finishOp(types .bitwiseXOR, 1)4919 }; 4920 4921 pp $9.readToken_plus_min = function(code) { // '+-'4935 if (next === 61) { return this.finishOp(types$1.assign, 2) } 4936 return this.finishOp(types$1.bitwiseXOR, 1) 4937 }; 4938 4939 pp.readToken_plus_min = function(code) { // '+-' 4922 4940 var next = this.input.charCodeAt(this.pos + 1); 4923 4941 if (next === code) { … … 4929 4947 return this.nextToken() 4930 4948 } 4931 return this.finishOp(types .incDec, 2)4932 } 4933 if (next === 61) { return this.finishOp(types .assign, 2) }4934 return this.finishOp(types .plusMin, 1)4935 }; 4936 4937 pp $9.readToken_lt_gt = function(code) { // '<>'4949 return this.finishOp(types$1.incDec, 2) 4950 } 4951 if (next === 61) { return this.finishOp(types$1.assign, 2) } 4952 return this.finishOp(types$1.plusMin, 1) 4953 }; 4954 4955 pp.readToken_lt_gt = function(code) { // '<>' 4938 4956 var next = this.input.charCodeAt(this.pos + 1); 4939 4957 var size = 1; 4940 4958 if (next === code) { 4941 4959 size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; 4942 if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types .assign, size + 1) }4943 return this.finishOp(types .bitShift, size)4960 if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } 4961 return this.finishOp(types$1.bitShift, size) 4944 4962 } 4945 4963 if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && … … 4951 4969 } 4952 4970 if (next === 61) { size = 2; } 4953 return this.finishOp(types .relational, size)4954 }; 4955 4956 pp $9.readToken_eq_excl = function(code) { // '=!'4971 return this.finishOp(types$1.relational, size) 4972 }; 4973 4974 pp.readToken_eq_excl = function(code) { // '=!' 4957 4975 var next = this.input.charCodeAt(this.pos + 1); 4958 if (next === 61) { return this.finishOp(types .equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }4976 if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } 4959 4977 if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>' 4960 4978 this.pos += 2; 4961 return this.finishToken(types .arrow)4962 } 4963 return this.finishOp(code === 61 ? types .eq : types.prefix, 1)4964 }; 4965 4966 pp $9.readToken_question = function() { // '?'4979 return this.finishToken(types$1.arrow) 4980 } 4981 return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1) 4982 }; 4983 4984 pp.readToken_question = function() { // '?' 4967 4985 var ecmaVersion = this.options.ecmaVersion; 4968 4986 if (ecmaVersion >= 11) { … … 4970 4988 if (next === 46) { 4971 4989 var next2 = this.input.charCodeAt(this.pos + 2); 4972 if (next2 < 48 || next2 > 57) { return this.finishOp(types .questionDot, 2) }4990 if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) } 4973 4991 } 4974 4992 if (next === 63) { 4975 4993 if (ecmaVersion >= 12) { 4976 4994 var next2$1 = this.input.charCodeAt(this.pos + 2); 4977 if (next2$1 === 61) { return this.finishOp(types .assign, 3) }4995 if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) } 4978 4996 } 4979 return this.finishOp(types .coalesce, 2)4980 } 4981 } 4982 return this.finishOp(types .question, 1)4983 }; 4984 4985 pp $9.readToken_numberSign = function() { // '#'4997 return this.finishOp(types$1.coalesce, 2) 4998 } 4999 } 5000 return this.finishOp(types$1.question, 1) 5001 }; 5002 5003 pp.readToken_numberSign = function() { // '#' 4986 5004 var ecmaVersion = this.options.ecmaVersion; 4987 5005 var code = 35; // '#' … … 4990 5008 code = this.fullCharCodeAtPos(); 4991 5009 if (isIdentifierStart(code, true) || code === 92 /* '\' */) { 4992 return this.finishToken(types .privateId, this.readWord1())4993 } 4994 } 4995 4996 this.raise(this.pos, "Unexpected character '" + codePointToString $1(code) + "'");4997 }; 4998 4999 pp $9.getTokenFromCode = function(code) {5010 return this.finishToken(types$1.privateId, this.readWord1()) 5011 } 5012 } 5013 5014 this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); 5015 }; 5016 5017 pp.getTokenFromCode = function(code) { 5000 5018 switch (code) { 5001 5019 // The interpretation of a dot depends on whether it is followed … … 5005 5023 5006 5024 // Punctuation tokens. 5007 case 40: ++this.pos; return this.finishToken(types .parenL)5008 case 41: ++this.pos; return this.finishToken(types .parenR)5009 case 59: ++this.pos; return this.finishToken(types .semi)5010 case 44: ++this.pos; return this.finishToken(types .comma)5011 case 91: ++this.pos; return this.finishToken(types .bracketL)5012 case 93: ++this.pos; return this.finishToken(types .bracketR)5013 case 123: ++this.pos; return this.finishToken(types .braceL)5014 case 125: ++this.pos; return this.finishToken(types .braceR)5015 case 58: ++this.pos; return this.finishToken(types .colon)5025 case 40: ++this.pos; return this.finishToken(types$1.parenL) 5026 case 41: ++this.pos; return this.finishToken(types$1.parenR) 5027 case 59: ++this.pos; return this.finishToken(types$1.semi) 5028 case 44: ++this.pos; return this.finishToken(types$1.comma) 5029 case 91: ++this.pos; return this.finishToken(types$1.bracketL) 5030 case 93: ++this.pos; return this.finishToken(types$1.bracketR) 5031 case 123: ++this.pos; return this.finishToken(types$1.braceL) 5032 case 125: ++this.pos; return this.finishToken(types$1.braceR) 5033 case 58: ++this.pos; return this.finishToken(types$1.colon) 5016 5034 5017 5035 case 96: // '`' 5018 5036 if (this.options.ecmaVersion < 6) { break } 5019 5037 ++this.pos; 5020 return this.finishToken(types .backQuote)5038 return this.finishToken(types$1.backQuote) 5021 5039 5022 5040 case 48: // '0' … … 5041 5059 // characters it is given as second argument, and returns a token 5042 5060 // of the type given by its first argument. 5043 5044 5061 case 47: // '/' 5045 5062 return this.readToken_slash() … … 5067 5084 5068 5085 case 126: // '~' 5069 return this.finishOp(types .prefix, 1)5086 return this.finishOp(types$1.prefix, 1) 5070 5087 5071 5088 case 35: // '#' … … 5073 5090 } 5074 5091 5075 this.raise(this.pos, "Unexpected character '" + codePointToString $1(code) + "'");5076 }; 5077 5078 pp $9.finishOp = function(type, size) {5092 this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); 5093 }; 5094 5095 pp.finishOp = function(type, size) { 5079 5096 var str = this.input.slice(this.pos, this.pos + size); 5080 5097 this.pos += size; … … 5082 5099 }; 5083 5100 5084 pp $9.readRegexp = function() {5101 pp.readRegexp = function() { 5085 5102 var escaped, inClass, start = this.pos; 5086 5103 for (;;) { … … 5117 5134 } 5118 5135 5119 return this.finishToken(types .regexp, {pattern: pattern, flags: flags, value: value})5136 return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value}) 5120 5137 }; 5121 5138 … … 5124 5141 // will return `null` unless the integer has exactly `len` digits. 5125 5142 5126 pp $9.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {5143 pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { 5127 5144 // `len` is used for character escape sequences. In that case, disallow separators. 5128 5145 var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined; … … 5178 5195 } 5179 5196 5180 pp $9.readRadixNumber = function(radix) {5197 pp.readRadixNumber = function(radix) { 5181 5198 var start = this.pos; 5182 5199 this.pos += 2; // 0x … … 5187 5204 ++this.pos; 5188 5205 } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } 5189 return this.finishToken(types .num, val)5206 return this.finishToken(types$1.num, val) 5190 5207 }; 5191 5208 5192 5209 // Read an integer, octal integer, or floating-point number. 5193 5210 5194 pp $9.readNumber = function(startsWithDot) {5211 pp.readNumber = function(startsWithDot) { 5195 5212 var start = this.pos; 5196 5213 if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); } … … 5202 5219 ++this.pos; 5203 5220 if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } 5204 return this.finishToken(types .num, val$1)5221 return this.finishToken(types$1.num, val$1) 5205 5222 } 5206 5223 if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; } … … 5218 5235 5219 5236 var val = stringToNumber(this.input.slice(start, this.pos), octal); 5220 return this.finishToken(types .num, val)5237 return this.finishToken(types$1.num, val) 5221 5238 }; 5222 5239 5223 5240 // Read a string value, interpreting backslash-escapes. 5224 5241 5225 pp $9.readCodePoint = function() {5242 pp.readCodePoint = function() { 5226 5243 var ch = this.input.charCodeAt(this.pos), code; 5227 5244 … … 5238 5255 }; 5239 5256 5240 function codePointToString $1(code) {5257 function codePointToString(code) { 5241 5258 // UTF-16 Decoding 5242 5259 if (code <= 0xFFFF) { return String.fromCharCode(code) } … … 5245 5262 } 5246 5263 5247 pp $9.readString = function(quote) {5264 pp.readString = function(quote) { 5248 5265 var out = "", chunkStart = ++this.pos; 5249 5266 for (;;) { … … 5268 5285 } 5269 5286 out += this.input.slice(chunkStart, this.pos++); 5270 return this.finishToken(types .string, out)5287 return this.finishToken(types$1.string, out) 5271 5288 }; 5272 5289 … … 5275 5292 var INVALID_TEMPLATE_ESCAPE_ERROR = {}; 5276 5293 5277 pp $9.tryReadTemplateToken = function() {5294 pp.tryReadTemplateToken = function() { 5278 5295 this.inTemplateElement = true; 5279 5296 try { … … 5290 5307 }; 5291 5308 5292 pp $9.invalidStringToken = function(position, message) {5309 pp.invalidStringToken = function(position, message) { 5293 5310 if (this.inTemplateElement && this.options.ecmaVersion >= 9) { 5294 5311 throw INVALID_TEMPLATE_ESCAPE_ERROR … … 5298 5315 }; 5299 5316 5300 pp $9.readTmplToken = function() {5317 pp.readTmplToken = function() { 5301 5318 var out = "", chunkStart = this.pos; 5302 5319 for (;;) { … … 5304 5321 var ch = this.input.charCodeAt(this.pos); 5305 5322 if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${' 5306 if (this.pos === this.start && (this.type === types .template || this.type === types.invalidTemplate)) {5323 if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { 5307 5324 if (ch === 36) { 5308 5325 this.pos += 2; 5309 return this.finishToken(types .dollarBraceL)5326 return this.finishToken(types$1.dollarBraceL) 5310 5327 } else { 5311 5328 ++this.pos; 5312 return this.finishToken(types .backQuote)5329 return this.finishToken(types$1.backQuote) 5313 5330 } 5314 5331 } 5315 5332 out += this.input.slice(chunkStart, this.pos); 5316 return this.finishToken(types .template, out)5333 return this.finishToken(types$1.template, out) 5317 5334 } 5318 5335 if (ch === 92) { // '\' … … 5345 5362 5346 5363 // Reads a template token to search for the end, without validating any escape sequences 5347 pp $9.readInvalidTemplateToken = function() {5364 pp.readInvalidTemplateToken = function() { 5348 5365 for (; this.pos < this.input.length; this.pos++) { 5349 5366 switch (this.input[this.pos]) { … … 5356 5373 break 5357 5374 } 5375 5358 5376 // falls through 5359 5360 5377 case "`": 5361 return this.finishToken(types .invalidTemplate, this.input.slice(this.start, this.pos))5378 return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)) 5362 5379 5363 5380 // no default … … 5369 5386 // Used to read escaped characters 5370 5387 5371 pp $9.readEscapedChar = function(inTemplate) {5388 pp.readEscapedChar = function(inTemplate) { 5372 5389 var ch = this.input.charCodeAt(++this.pos); 5373 5390 ++this.pos; … … 5376 5393 case 114: return "\r" // 'r' -> '\r' 5377 5394 case 120: return String.fromCharCode(this.readHexChar(2)) // 'x' 5378 case 117: return codePointToString $1(this.readCodePoint()) // 'u'5395 case 117: return codePointToString(this.readCodePoint()) // 'u' 5379 5396 case 116: return "\t" // 't' -> '\t' 5380 5397 case 98: return "\b" // 'b' -> '\b' … … 5434 5451 // Used to read character escape sequences ('\x', '\u', '\U'). 5435 5452 5436 pp $9.readHexChar = function(len) {5453 pp.readHexChar = function(len) { 5437 5454 var codePos = this.pos; 5438 5455 var n = this.readInt(16, len); … … 5447 5464 // as a micro-optimization. 5448 5465 5449 pp $9.readWord1 = function() {5466 pp.readWord1 = function() { 5450 5467 this.containsEsc = false; 5451 5468 var word = "", first = true, chunkStart = this.pos; … … 5465 5482 if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) 5466 5483 { this.invalidStringToken(escStart, "Invalid Unicode escape"); } 5467 word += codePointToString $1(esc);5484 word += codePointToString(esc); 5468 5485 chunkStart = this.pos; 5469 5486 } else { … … 5478 5495 // words when necessary. 5479 5496 5480 pp $9.readWord = function() {5497 pp.readWord = function() { 5481 5498 var word = this.readWord1(); 5482 var type = types .name;5499 var type = types$1.name; 5483 5500 if (this.keywords.test(word)) { 5484 type = keywords $1[word];5501 type = keywords[word]; 5485 5502 } 5486 5503 return this.finishToken(type, word) … … 5489 5506 // Acorn is a tiny, fast JavaScript parser written in JavaScript. 5490 5507 5491 var version = "8. 5.0";5508 var version = "8.6.0"; 5492 5509 5493 5510 Parser.acorn = { … … 5500 5517 Node: Node, 5501 5518 TokenType: TokenType, 5502 tokTypes: types ,5503 keywordTypes: keywords $1,5519 tokTypes: types$1, 5520 keywordTypes: keywords, 5504 5521 TokContext: TokContext, 5505 tokContexts: types $1,5522 tokContexts: types, 5506 5523 isIdentifierChar: isIdentifierChar, 5507 5524 isIdentifierStart: isIdentifierStart, … … 5539 5556 } 5540 5557 5541 export { Node, Parser, Position, SourceLocation, TokContext, Token, TokenType, defaultOptions, getLineInfo, isIdentifierChar, isIdentifierStart, isNewLine, keywords $1 as keywordTypes, lineBreak, lineBreakG, nonASCIIwhitespace, parse, parseExpressionAt, types$1 as tokContexts, typesas tokTypes, tokenizer, version };5558 export { Node, Parser, Position, SourceLocation, TokContext, Token, TokenType, defaultOptions, getLineInfo, isIdentifierChar, isIdentifierStart, isNewLine, keywords as keywordTypes, lineBreak, lineBreakG, nonASCIIwhitespace, parse, parseExpressionAt, types as tokContexts, types$1 as tokTypes, tokenizer, version };
Note:
See TracChangeset
for help on using the changeset viewer.