Changeset e29cc2e for trip-planner-front/node_modules/acorn/dist
- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- Location:
- trip-planner-front/node_modules/acorn/dist
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/node_modules/acorn/dist/acorn.js
r59329aa re29cc2e 2 2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 3 3 typeof define === 'function' && define.amd ? define(['exports'], factory) : 4 (global = global || self, factory(global.acorn = {}));5 } (this, (function (exports) { 'use strict';4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.acorn = {})); 5 })(this, (function (exports) { 'use strict'; 6 6 7 7 // Reserved word lists for various dialects of the language … … 19 19 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"; 20 20 21 var keywords = {21 var keywords$1 = { 22 22 5: ecma5AndLessKeywords, 23 23 "5module": ecma5AndLessKeywords + " export import", … … 138 138 // Map keyword names to token types. 139 139 140 var keywords $1= {};140 var keywords = {}; 141 141 142 142 // Succinct definitions of keyword token types … … 145 145 146 146 options.keyword = name; 147 return keywords $1[name] = new TokenType(name, options)147 return keywords[name] = new TokenType(name, options) 148 148 } 149 149 150 var types = {150 var types$1 = { 151 151 num: new TokenType("num", startsExpr), 152 152 regexp: new TokenType("regexp", startsExpr), … … 490 490 this.options = options = getOptions(options); 491 491 this.sourceFile = options.sourceFile; 492 this.keywords = wordsRegexp(keywords [options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);492 this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]); 493 493 var reserved = ""; 494 494 if (options.allowReserved !== true) { … … 521 521 // Properties of the current token: 522 522 // Its type 523 this.type = types .eof;523 this.type = types$1.eof; 524 524 // For tokens that include more information than their type, the value 525 525 this.value = null; … … 581 581 582 582 prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 }; 583 583 584 prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit }; 585 584 586 prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit }; 587 585 588 prototypeAccessors.canAwait.get = function () { 586 589 for (var i = this.scopeStack.length - 1; i >= 0; i--) { … … 591 594 return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction 592 595 }; 596 593 597 prototypeAccessors.allowSuper.get = function () { 594 598 var ref = this.currentThisScope(); … … 597 601 return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod 598 602 }; 603 599 604 prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 }; 605 600 606 prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) }; 607 601 608 prototypeAccessors.allowNewDotTarget.get = function () { 602 609 var ref = this.currentThisScope(); … … 605 612 return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit 606 613 }; 614 607 615 prototypeAccessors.inClassStaticBlock.get = function () { 608 616 return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0 … … 634 642 Object.defineProperties( Parser.prototype, prototypeAccessors ); 635 643 636 var pp = Parser.prototype;644 var pp$9 = Parser.prototype; 637 645 638 646 // ## Parser utilities 639 647 640 648 var literal = /^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/; 641 pp .strictDirective = function(start) {649 pp$9.strictDirective = function(start) { 642 650 for (;;) { 643 651 // Try to find string literal. … … 667 675 // type, and if yes, consumes it as a side effect. 668 676 669 pp .eat = function(type) {677 pp$9.eat = function(type) { 670 678 if (this.type === type) { 671 679 this.next(); … … 678 686 // Tests whether parsed token is a contextual keyword. 679 687 680 pp .isContextual = function(name) {681 return this.type === types .name && this.value === name && !this.containsEsc688 pp$9.isContextual = function(name) { 689 return this.type === types$1.name && this.value === name && !this.containsEsc 682 690 }; 683 691 684 692 // Consumes contextual keyword if possible. 685 693 686 pp .eatContextual = function(name) {694 pp$9.eatContextual = function(name) { 687 695 if (!this.isContextual(name)) { return false } 688 696 this.next(); … … 692 700 // Asserts that following token is given contextual keyword. 693 701 694 pp .expectContextual = function(name) {702 pp$9.expectContextual = function(name) { 695 703 if (!this.eatContextual(name)) { this.unexpected(); } 696 704 }; … … 698 706 // Test whether a semicolon can be inserted at the current position. 699 707 700 pp .canInsertSemicolon = function() {701 return this.type === types .eof ||702 this.type === types .braceR ||708 pp$9.canInsertSemicolon = function() { 709 return this.type === types$1.eof || 710 this.type === types$1.braceR || 703 711 lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) 704 712 }; 705 713 706 pp .insertSemicolon = function() {714 pp$9.insertSemicolon = function() { 707 715 if (this.canInsertSemicolon()) { 708 716 if (this.options.onInsertedSemicolon) … … 715 723 // pretend that there is a semicolon at this position. 716 724 717 pp .semicolon = function() {718 if (!this.eat(types .semi) && !this.insertSemicolon()) { this.unexpected(); }719 }; 720 721 pp .afterTrailingComma = function(tokType, notNext) {725 pp$9.semicolon = function() { 726 if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); } 727 }; 728 729 pp$9.afterTrailingComma = function(tokType, notNext) { 722 730 if (this.type === tokType) { 723 731 if (this.options.onTrailingComma) … … 732 740 // raise an unexpected token error. 733 741 734 pp .expect = function(type) {742 pp$9.expect = function(type) { 735 743 this.eat(type) || this.unexpected(); 736 744 }; … … 738 746 // Raise an unexpected token error. 739 747 740 pp .unexpected = function(pos) {748 pp$9.unexpected = function(pos) { 741 749 this.raise(pos != null ? pos : this.start, "Unexpected token"); 742 750 }; … … 751 759 } 752 760 753 pp .checkPatternErrors = function(refDestructuringErrors, isAssign) {761 pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) { 754 762 if (!refDestructuringErrors) { return } 755 763 if (refDestructuringErrors.trailingComma > -1) … … 759 767 }; 760 768 761 pp .checkExpressionErrors = function(refDestructuringErrors, andThrow) {769 pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) { 762 770 if (!refDestructuringErrors) { return false } 763 771 var shorthandAssign = refDestructuringErrors.shorthandAssign; … … 770 778 }; 771 779 772 pp .checkYieldAwaitInDefaultParams = function() {780 pp$9.checkYieldAwaitInDefaultParams = function() { 773 781 if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) 774 782 { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } … … 777 785 }; 778 786 779 pp .isSimpleAssignTarget = function(expr) {787 pp$9.isSimpleAssignTarget = function(expr) { 780 788 if (expr.type === "ParenthesizedExpression") 781 789 { return this.isSimpleAssignTarget(expr.expression) } … … 783 791 }; 784 792 785 var pp$ 1= Parser.prototype;793 var pp$8 = Parser.prototype; 786 794 787 795 // ### Statement parsing … … 792 800 // to its body instead of creating a new node. 793 801 794 pp$ 1.parseTopLevel = function(node) {802 pp$8.parseTopLevel = function(node) { 795 803 var exports = Object.create(null); 796 804 if (!node.body) { node.body = []; } 797 while (this.type !== types .eof) {805 while (this.type !== types$1.eof) { 798 806 var stmt = this.parseStatement(null, true, exports); 799 807 node.body.push(stmt); … … 814 822 var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"}; 815 823 816 pp$ 1.isLet = function(context) {824 pp$8.isLet = function(context) { 817 825 if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } 818 826 skipWhiteSpace.lastIndex = this.pos; … … 840 848 // - 'async /*foo*/ function' is OK. 841 849 // - 'async /*\n*/ function' is invalid. 842 pp$ 1.isAsyncFunction = function() {850 pp$8.isAsyncFunction = function() { 843 851 if (this.options.ecmaVersion < 8 || !this.isContextual("async")) 844 852 { return false } … … 860 868 // does not help. 861 869 862 pp$ 1.parseStatement = function(context, topLevel, exports) {870 pp$8.parseStatement = function(context, topLevel, exports) { 863 871 var starttype = this.type, node = this.startNode(), kind; 864 872 865 873 if (this.isLet(context)) { 866 starttype = types ._var;874 starttype = types$1._var; 867 875 kind = "let"; 868 876 } … … 873 881 874 882 switch (starttype) { 875 case types ._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword)876 case types ._debugger: return this.parseDebuggerStatement(node)877 case types ._do: return this.parseDoStatement(node)878 case types ._for: return this.parseForStatement(node)879 case types ._function:883 case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword) 884 case types$1._debugger: return this.parseDebuggerStatement(node) 885 case types$1._do: return this.parseDoStatement(node) 886 case types$1._for: return this.parseForStatement(node) 887 case types$1._function: 880 888 // Function as sole body of either an if statement or a labeled statement 881 889 // works, but not when it is part of a labeled statement that is the sole … … 883 891 if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); } 884 892 return this.parseFunctionStatement(node, false, !context) 885 case types ._class:893 case types$1._class: 886 894 if (context) { this.unexpected(); } 887 895 return this.parseClass(node, true) 888 case types ._if: return this.parseIfStatement(node)889 case types ._return: return this.parseReturnStatement(node)890 case types ._switch: return this.parseSwitchStatement(node)891 case types ._throw: return this.parseThrowStatement(node)892 case types ._try: return this.parseTryStatement(node)893 case types ._const: case types._var:896 case types$1._if: return this.parseIfStatement(node) 897 case types$1._return: return this.parseReturnStatement(node) 898 case types$1._switch: return this.parseSwitchStatement(node) 899 case types$1._throw: return this.parseThrowStatement(node) 900 case types$1._try: return this.parseTryStatement(node) 901 case types$1._const: case types$1._var: 894 902 kind = kind || this.value; 895 903 if (context && kind !== "var") { this.unexpected(); } 896 904 return this.parseVarStatement(node, kind) 897 case types ._while: return this.parseWhileStatement(node)898 case types ._with: return this.parseWithStatement(node)899 case types .braceL: return this.parseBlock(true, node)900 case types .semi: return this.parseEmptyStatement(node)901 case types ._export:902 case types ._import:903 if (this.options.ecmaVersion > 10 && starttype === types ._import) {905 case types$1._while: return this.parseWhileStatement(node) 906 case types$1._with: return this.parseWithStatement(node) 907 case types$1.braceL: return this.parseBlock(true, node) 908 case types$1.semi: return this.parseEmptyStatement(node) 909 case types$1._export: 910 case types$1._import: 911 if (this.options.ecmaVersion > 10 && starttype === types$1._import) { 904 912 skipWhiteSpace.lastIndex = this.pos; 905 913 var skip = skipWhiteSpace.exec(this.input); … … 915 923 { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } 916 924 } 917 return starttype === types ._import ? this.parseImport(node) : this.parseExport(node, exports)925 return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports) 918 926 919 927 // If the statement does not start with a statement keyword or a … … 930 938 931 939 var maybeName = this.value, expr = this.parseExpression(); 932 if (starttype === types .name && expr.type === "Identifier" && this.eat(types.colon))940 if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) 933 941 { return this.parseLabeledStatement(node, maybeName, expr, context) } 934 942 else { return this.parseExpressionStatement(node, expr) } … … 936 944 }; 937 945 938 pp$ 1.parseBreakContinueStatement = function(node, keyword) {946 pp$8.parseBreakContinueStatement = function(node, keyword) { 939 947 var isBreak = keyword === "break"; 940 948 this.next(); 941 if (this.eat(types .semi) || this.insertSemicolon()) { node.label = null; }942 else if (this.type !== types .name) { this.unexpected(); }949 if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; } 950 else if (this.type !== types$1.name) { this.unexpected(); } 943 951 else { 944 952 node.label = this.parseIdent(); … … 960 968 }; 961 969 962 pp$ 1.parseDebuggerStatement = function(node) {970 pp$8.parseDebuggerStatement = function(node) { 963 971 this.next(); 964 972 this.semicolon(); … … 966 974 }; 967 975 968 pp$ 1.parseDoStatement = function(node) {976 pp$8.parseDoStatement = function(node) { 969 977 this.next(); 970 978 this.labels.push(loopLabel); 971 979 node.body = this.parseStatement("do"); 972 980 this.labels.pop(); 973 this.expect(types ._while);981 this.expect(types$1._while); 974 982 node.test = this.parseParenExpression(); 975 983 if (this.options.ecmaVersion >= 6) 976 { this.eat(types .semi); }984 { this.eat(types$1.semi); } 977 985 else 978 986 { this.semicolon(); } … … 988 996 // is a regular `for` loop. 989 997 990 pp$ 1.parseForStatement = function(node) {998 pp$8.parseForStatement = function(node) { 991 999 this.next(); 992 1000 var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1; 993 1001 this.labels.push(loopLabel); 994 1002 this.enterScope(0); 995 this.expect(types .parenL);996 if (this.type === types .semi) {1003 this.expect(types$1.parenL); 1004 if (this.type === types$1.semi) { 997 1005 if (awaitAt > -1) { this.unexpected(awaitAt); } 998 1006 return this.parseFor(node, null) 999 1007 } 1000 1008 var isLet = this.isLet(); 1001 if (this.type === types ._var || this.type === types._const || isLet) {1009 if (this.type === types$1._var || this.type === types$1._const || isLet) { 1002 1010 var init$1 = this.startNode(), kind = isLet ? "let" : this.value; 1003 1011 this.next(); 1004 1012 this.parseVar(init$1, true, kind); 1005 1013 this.finishNode(init$1, "VariableDeclaration"); 1006 if ((this.type === types ._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) {1014 if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1) { 1007 1015 if (this.options.ecmaVersion >= 9) { 1008 if (this.type === types ._in) {1016 if (this.type === types$1._in) { 1009 1017 if (awaitAt > -1) { this.unexpected(awaitAt); } 1010 1018 } else { node.await = awaitAt > -1; } … … 1018 1026 var refDestructuringErrors = new DestructuringErrors; 1019 1027 var init = this.parseExpression(awaitAt > -1 ? "await" : true, refDestructuringErrors); 1020 if (this.type === types ._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {1028 if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) { 1021 1029 if (this.options.ecmaVersion >= 9) { 1022 if (this.type === types ._in) {1030 if (this.type === types$1._in) { 1023 1031 if (awaitAt > -1) { this.unexpected(awaitAt); } 1024 1032 } else { node.await = awaitAt > -1; } … … 1035 1043 }; 1036 1044 1037 pp$ 1.parseFunctionStatement = function(node, isAsync, declarationPosition) {1045 pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) { 1038 1046 this.next(); 1039 1047 return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync) 1040 1048 }; 1041 1049 1042 pp$ 1.parseIfStatement = function(node) {1050 pp$8.parseIfStatement = function(node) { 1043 1051 this.next(); 1044 1052 node.test = this.parseParenExpression(); 1045 1053 // allow function declarations in branches, but only in non-strict mode 1046 1054 node.consequent = this.parseStatement("if"); 1047 node.alternate = this.eat(types ._else) ? this.parseStatement("if") : null;1055 node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null; 1048 1056 return this.finishNode(node, "IfStatement") 1049 1057 }; 1050 1058 1051 pp$ 1.parseReturnStatement = function(node) {1059 pp$8.parseReturnStatement = function(node) { 1052 1060 if (!this.inFunction && !this.options.allowReturnOutsideFunction) 1053 1061 { this.raise(this.start, "'return' outside of function"); } … … 1058 1066 // possibility to insert one. 1059 1067 1060 if (this.eat(types .semi) || this.insertSemicolon()) { node.argument = null; }1068 if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; } 1061 1069 else { node.argument = this.parseExpression(); this.semicolon(); } 1062 1070 return this.finishNode(node, "ReturnStatement") 1063 1071 }; 1064 1072 1065 pp$ 1.parseSwitchStatement = function(node) {1073 pp$8.parseSwitchStatement = function(node) { 1066 1074 this.next(); 1067 1075 node.discriminant = this.parseParenExpression(); 1068 1076 node.cases = []; 1069 this.expect(types .braceL);1077 this.expect(types$1.braceL); 1070 1078 this.labels.push(switchLabel); 1071 1079 this.enterScope(0); … … 1076 1084 1077 1085 var cur; 1078 for (var sawDefault = false; this.type !== types .braceR;) {1079 if (this.type === types ._case || this.type === types._default) {1080 var isCase = this.type === types ._case;1086 for (var sawDefault = false; this.type !== types$1.braceR;) { 1087 if (this.type === types$1._case || this.type === types$1._default) { 1088 var isCase = this.type === types$1._case; 1081 1089 if (cur) { this.finishNode(cur, "SwitchCase"); } 1082 1090 node.cases.push(cur = this.startNode()); … … 1090 1098 cur.test = null; 1091 1099 } 1092 this.expect(types .colon);1100 this.expect(types$1.colon); 1093 1101 } else { 1094 1102 if (!cur) { this.unexpected(); } … … 1103 1111 }; 1104 1112 1105 pp$ 1.parseThrowStatement = function(node) {1113 pp$8.parseThrowStatement = function(node) { 1106 1114 this.next(); 1107 1115 if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) … … 1114 1122 // Reused empty array added for node fields that are always empty. 1115 1123 1116 var empty = [];1117 1118 pp$ 1.parseTryStatement = function(node) {1124 var empty$1 = []; 1125 1126 pp$8.parseTryStatement = function(node) { 1119 1127 this.next(); 1120 1128 node.block = this.parseBlock(); 1121 1129 node.handler = null; 1122 if (this.type === types ._catch) {1130 if (this.type === types$1._catch) { 1123 1131 var clause = this.startNode(); 1124 1132 this.next(); 1125 if (this.eat(types .parenL)) {1133 if (this.eat(types$1.parenL)) { 1126 1134 clause.param = this.parseBindingAtom(); 1127 1135 var simple = clause.param.type === "Identifier"; 1128 1136 this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0); 1129 1137 this.checkLValPattern(clause.param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL); 1130 this.expect(types .parenR);1138 this.expect(types$1.parenR); 1131 1139 } else { 1132 1140 if (this.options.ecmaVersion < 10) { this.unexpected(); } … … 1138 1146 node.handler = this.finishNode(clause, "CatchClause"); 1139 1147 } 1140 node.finalizer = this.eat(types ._finally) ? this.parseBlock() : null;1148 node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null; 1141 1149 if (!node.handler && !node.finalizer) 1142 1150 { this.raise(node.start, "Missing catch or finally clause"); } … … 1144 1152 }; 1145 1153 1146 pp$ 1.parseVarStatement = function(node, kind) {1154 pp$8.parseVarStatement = function(node, kind) { 1147 1155 this.next(); 1148 1156 this.parseVar(node, false, kind); … … 1151 1159 }; 1152 1160 1153 pp$ 1.parseWhileStatement = function(node) {1161 pp$8.parseWhileStatement = function(node) { 1154 1162 this.next(); 1155 1163 node.test = this.parseParenExpression(); … … 1160 1168 }; 1161 1169 1162 pp$ 1.parseWithStatement = function(node) {1170 pp$8.parseWithStatement = function(node) { 1163 1171 if (this.strict) { this.raise(this.start, "'with' in strict mode"); } 1164 1172 this.next(); … … 1168 1176 }; 1169 1177 1170 pp$ 1.parseEmptyStatement = function(node) {1178 pp$8.parseEmptyStatement = function(node) { 1171 1179 this.next(); 1172 1180 return this.finishNode(node, "EmptyStatement") 1173 1181 }; 1174 1182 1175 pp$ 1.parseLabeledStatement = function(node, maybeName, expr, context) {1183 pp$8.parseLabeledStatement = function(node, maybeName, expr, context) { 1176 1184 for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1) 1177 1185 { … … 1181 1189 { this.raise(expr.start, "Label '" + maybeName + "' is already declared"); 1182 1190 } } 1183 var kind = this.type.isLoop ? "loop" : this.type === types ._switch ? "switch" : null;1191 var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null; 1184 1192 for (var i = this.labels.length - 1; i >= 0; i--) { 1185 1193 var label$1 = this.labels[i]; … … 1197 1205 }; 1198 1206 1199 pp$ 1.parseExpressionStatement = function(node, expr) {1207 pp$8.parseExpressionStatement = function(node, expr) { 1200 1208 node.expression = expr; 1201 1209 this.semicolon(); … … 1207 1215 // function bodies). 1208 1216 1209 pp$ 1.parseBlock = function(createNewLexicalScope, node, exitStrict) {1217 pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) { 1210 1218 if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; 1211 1219 if ( node === void 0 ) node = this.startNode(); 1212 1220 1213 1221 node.body = []; 1214 this.expect(types .braceL);1222 this.expect(types$1.braceL); 1215 1223 if (createNewLexicalScope) { this.enterScope(0); } 1216 while (this.type !== types .braceR) {1224 while (this.type !== types$1.braceR) { 1217 1225 var stmt = this.parseStatement(null); 1218 1226 node.body.push(stmt); … … 1228 1236 // expression. 1229 1237 1230 pp$ 1.parseFor = function(node, init) {1238 pp$8.parseFor = function(node, init) { 1231 1239 node.init = init; 1232 this.expect(types .semi);1233 node.test = this.type === types .semi ? null : this.parseExpression();1234 this.expect(types .semi);1235 node.update = this.type === types .parenR ? null : this.parseExpression();1236 this.expect(types .parenR);1240 this.expect(types$1.semi); 1241 node.test = this.type === types$1.semi ? null : this.parseExpression(); 1242 this.expect(types$1.semi); 1243 node.update = this.type === types$1.parenR ? null : this.parseExpression(); 1244 this.expect(types$1.parenR); 1237 1245 node.body = this.parseStatement("for"); 1238 1246 this.exitScope(); … … 1244 1252 // same from parser's perspective. 1245 1253 1246 pp$ 1.parseForIn = function(node, init) {1247 var isForIn = this.type === types ._in;1254 pp$8.parseForIn = function(node, init) { 1255 var isForIn = this.type === types$1._in; 1248 1256 this.next(); 1249 1257 … … 1266 1274 node.left = init; 1267 1275 node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign(); 1268 this.expect(types .parenR);1276 this.expect(types$1.parenR); 1269 1277 node.body = this.parseStatement("for"); 1270 1278 this.exitScope(); … … 1275 1283 // Parse a list of variable declarations. 1276 1284 1277 pp$ 1.parseVar = function(node, isFor, kind) {1285 pp$8.parseVar = function(node, isFor, kind) { 1278 1286 node.declarations = []; 1279 1287 node.kind = kind; … … 1281 1289 var decl = this.startNode(); 1282 1290 this.parseVarId(decl, kind); 1283 if (this.eat(types .eq)) {1291 if (this.eat(types$1.eq)) { 1284 1292 decl.init = this.parseMaybeAssign(isFor); 1285 } else if (kind === "const" && !(this.type === types ._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {1293 } else if (kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) { 1286 1294 this.unexpected(); 1287 } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types ._in || this.isContextual("of")))) {1295 } else if (decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) { 1288 1296 this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); 1289 1297 } else { … … 1291 1299 } 1292 1300 node.declarations.push(this.finishNode(decl, "VariableDeclarator")); 1293 if (!this.eat(types .comma)) { break }1301 if (!this.eat(types$1.comma)) { break } 1294 1302 } 1295 1303 return node 1296 1304 }; 1297 1305 1298 pp$ 1.parseVarId = function(decl, kind) {1306 pp$8.parseVarId = function(decl, kind) { 1299 1307 decl.id = this.parseBindingAtom(); 1300 1308 this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false); … … 1307 1315 1308 1316 // Remove `allowExpressionBody` for 7.0.0, as it is only called with false 1309 pp$ 1.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {1317 pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) { 1310 1318 this.initFunction(node); 1311 1319 if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) { 1312 if (this.type === types .star && (statement & FUNC_HANGING_STATEMENT))1320 if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT)) 1313 1321 { this.unexpected(); } 1314 node.generator = this.eat(types .star);1322 node.generator = this.eat(types$1.star); 1315 1323 } 1316 1324 if (this.options.ecmaVersion >= 8) … … 1318 1326 1319 1327 if (statement & FUNC_STATEMENT) { 1320 node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types .name ? null : this.parseIdent();1328 node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent(); 1321 1329 if (node.id && !(statement & FUNC_HANGING_STATEMENT)) 1322 1330 // If it is a regular function declaration in sloppy mode, then it is … … 1334 1342 1335 1343 if (!(statement & FUNC_STATEMENT)) 1336 { node.id = this.type === types .name ? this.parseIdent() : null; }1344 { node.id = this.type === types$1.name ? this.parseIdent() : null; } 1337 1345 1338 1346 this.parseFunctionParams(node); … … 1345 1353 }; 1346 1354 1347 pp$ 1.parseFunctionParams = function(node) {1348 this.expect(types .parenL);1349 node.params = this.parseBindingList(types .parenR, false, this.options.ecmaVersion >= 8);1355 pp$8.parseFunctionParams = function(node) { 1356 this.expect(types$1.parenL); 1357 node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); 1350 1358 this.checkYieldAwaitInDefaultParams(); 1351 1359 }; … … 1354 1362 // `isStatement` parameter). 1355 1363 1356 pp$ 1.parseClass = function(node, isStatement) {1364 pp$8.parseClass = function(node, isStatement) { 1357 1365 this.next(); 1358 1366 … … 1368 1376 var hadConstructor = false; 1369 1377 classBody.body = []; 1370 this.expect(types .braceL);1371 while (this.type !== types .braceR) {1378 this.expect(types$1.braceL); 1379 while (this.type !== types$1.braceR) { 1372 1380 var element = this.parseClassElement(node.superClass !== null); 1373 1381 if (element) { … … 1388 1396 }; 1389 1397 1390 pp$ 1.parseClassElement = function(constructorAllowsSuper) {1391 if (this.eat(types .semi)) { return null }1398 pp$8.parseClassElement = function(constructorAllowsSuper) { 1399 if (this.eat(types$1.semi)) { return null } 1392 1400 1393 1401 var ecmaVersion = this.options.ecmaVersion; … … 1401 1409 if (this.eatContextual("static")) { 1402 1410 // Parse static init block 1403 if (ecmaVersion >= 13 && this.eat(types .braceL)) {1411 if (ecmaVersion >= 13 && this.eat(types$1.braceL)) { 1404 1412 this.parseClassStaticBlock(node); 1405 1413 return node 1406 1414 } 1407 if (this.isClassElementNameStart() || this.type === types .star) {1415 if (this.isClassElementNameStart() || this.type === types$1.star) { 1408 1416 isStatic = true; 1409 1417 } else { … … 1413 1421 node.static = isStatic; 1414 1422 if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) { 1415 if ((this.isClassElementNameStart() || this.type === types .star) && !this.canInsertSemicolon()) {1423 if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) { 1416 1424 isAsync = true; 1417 1425 } else { … … 1419 1427 } 1420 1428 } 1421 if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types .star)) {1429 if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) { 1422 1430 isGenerator = true; 1423 1431 } … … 1446 1454 1447 1455 // Parse element value 1448 if (ecmaVersion < 13 || this.type === types .parenL || kind !== "method" || isGenerator || isAsync) {1456 if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) { 1449 1457 var isConstructor = !node.static && checkKeyName(node, "constructor"); 1450 1458 var allowsDirectSuper = isConstructor && constructorAllowsSuper; … … 1460 1468 }; 1461 1469 1462 pp$ 1.isClassElementNameStart = function() {1470 pp$8.isClassElementNameStart = function() { 1463 1471 return ( 1464 this.type === types .name ||1465 this.type === types .privateId ||1466 this.type === types .num ||1467 this.type === types .string ||1468 this.type === types .bracketL ||1472 this.type === types$1.name || 1473 this.type === types$1.privateId || 1474 this.type === types$1.num || 1475 this.type === types$1.string || 1476 this.type === types$1.bracketL || 1469 1477 this.type.keyword 1470 1478 ) 1471 1479 }; 1472 1480 1473 pp$ 1.parseClassElementName = function(element) {1474 if (this.type === types .privateId) {1481 pp$8.parseClassElementName = function(element) { 1482 if (this.type === types$1.privateId) { 1475 1483 if (this.value === "constructor") { 1476 1484 this.raise(this.start, "Classes can't have an element named '#constructor'"); … … 1483 1491 }; 1484 1492 1485 pp$ 1.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {1493 pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) { 1486 1494 // Check key and flags 1487 1495 var key = method.key; … … 1507 1515 }; 1508 1516 1509 pp$ 1.parseClassField = function(field) {1517 pp$8.parseClassField = function(field) { 1510 1518 if (checkKeyName(field, "constructor")) { 1511 1519 this.raise(field.key.start, "Classes can't have a field named 'constructor'"); … … 1514 1522 } 1515 1523 1516 if (this.eat(types .eq)) {1524 if (this.eat(types$1.eq)) { 1517 1525 // To raise SyntaxError if 'arguments' exists in the initializer. 1518 1526 var scope = this.currentThisScope(); … … 1529 1537 }; 1530 1538 1531 pp$ 1.parseClassStaticBlock = function(node) {1539 pp$8.parseClassStaticBlock = function(node) { 1532 1540 node.body = []; 1533 1541 … … 1535 1543 this.labels = []; 1536 1544 this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER); 1537 while (this.type !== types .braceR) {1545 while (this.type !== types$1.braceR) { 1538 1546 var stmt = this.parseStatement(null); 1539 1547 node.body.push(stmt); … … 1546 1554 }; 1547 1555 1548 pp$ 1.parseClassId = function(node, isStatement) {1549 if (this.type === types .name) {1556 pp$8.parseClassId = function(node, isStatement) { 1557 if (this.type === types$1.name) { 1550 1558 node.id = this.parseIdent(); 1551 1559 if (isStatement) … … 1558 1566 }; 1559 1567 1560 pp$ 1.parseClassSuper = function(node) {1561 node.superClass = this.eat(types ._extends) ? this.parseExprSubscripts(false) : null;1562 }; 1563 1564 pp$ 1.enterClassBody = function() {1568 pp$8.parseClassSuper = function(node) { 1569 node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(false) : null; 1570 }; 1571 1572 pp$8.enterClassBody = function() { 1565 1573 var element = {declared: Object.create(null), used: []}; 1566 1574 this.privateNameStack.push(element); … … 1568 1576 }; 1569 1577 1570 pp$ 1.exitClassBody = function() {1578 pp$8.exitClassBody = function() { 1571 1579 var ref = this.privateNameStack.pop(); 1572 1580 var declared = ref.declared; … … 1623 1631 // Parses module export declaration. 1624 1632 1625 pp$ 1.parseExport = function(node, exports) {1633 pp$8.parseExport = function(node, exports) { 1626 1634 this.next(); 1627 1635 // export * from '...' 1628 if (this.eat(types .star)) {1636 if (this.eat(types$1.star)) { 1629 1637 if (this.options.ecmaVersion >= 11) { 1630 1638 if (this.eatContextual("as")) { … … 1636 1644 } 1637 1645 this.expectContextual("from"); 1638 if (this.type !== types .string) { this.unexpected(); }1646 if (this.type !== types$1.string) { this.unexpected(); } 1639 1647 node.source = this.parseExprAtom(); 1640 1648 this.semicolon(); 1641 1649 return this.finishNode(node, "ExportAllDeclaration") 1642 1650 } 1643 if (this.eat(types ._default)) { // export default ...1651 if (this.eat(types$1._default)) { // export default ... 1644 1652 this.checkExport(exports, "default", this.lastTokStart); 1645 1653 var isAsync; 1646 if (this.type === types ._function || (isAsync = this.isAsyncFunction())) {1654 if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) { 1647 1655 var fNode = this.startNode(); 1648 1656 this.next(); 1649 1657 if (isAsync) { this.next(); } 1650 1658 node.declaration = this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync); 1651 } else if (this.type === types ._class) {1659 } else if (this.type === types$1._class) { 1652 1660 var cNode = this.startNode(); 1653 1661 node.declaration = this.parseClass(cNode, "nullableID"); … … 1671 1679 node.specifiers = this.parseExportSpecifiers(exports); 1672 1680 if (this.eatContextual("from")) { 1673 if (this.type !== types .string) { this.unexpected(); }1681 if (this.type !== types$1.string) { this.unexpected(); } 1674 1682 node.source = this.parseExprAtom(); 1675 1683 } else { … … 1690 1698 }; 1691 1699 1692 pp$ 1.checkExport = function(exports, name, pos) {1700 pp$8.checkExport = function(exports, name, pos) { 1693 1701 if (!exports) { return } 1694 1702 if (has(exports, name)) … … 1697 1705 }; 1698 1706 1699 pp$ 1.checkPatternExport = function(exports, pat) {1707 pp$8.checkPatternExport = function(exports, pat) { 1700 1708 var type = pat.type; 1701 1709 if (type === "Identifier") … … 1724 1732 }; 1725 1733 1726 pp$ 1.checkVariableExport = function(exports, decls) {1734 pp$8.checkVariableExport = function(exports, decls) { 1727 1735 if (!exports) { return } 1728 1736 for (var i = 0, list = decls; i < list.length; i += 1) … … 1734 1742 }; 1735 1743 1736 pp$ 1.shouldParseExportStatement = function() {1744 pp$8.shouldParseExportStatement = function() { 1737 1745 return this.type.keyword === "var" || 1738 1746 this.type.keyword === "const" || … … 1745 1753 // Parses a comma-separated list of module exports. 1746 1754 1747 pp$ 1.parseExportSpecifiers = function(exports) {1755 pp$8.parseExportSpecifiers = function(exports) { 1748 1756 var nodes = [], first = true; 1749 1757 // export { x, y as z } [from '...'] 1750 this.expect(types .braceL);1751 while (!this.eat(types .braceR)) {1758 this.expect(types$1.braceL); 1759 while (!this.eat(types$1.braceR)) { 1752 1760 if (!first) { 1753 this.expect(types .comma);1754 if (this.afterTrailingComma(types .braceR)) { break }1761 this.expect(types$1.comma); 1762 if (this.afterTrailingComma(types$1.braceR)) { break } 1755 1763 } else { first = false; } 1756 1764 … … 1766 1774 // Parses import declaration. 1767 1775 1768 pp$ 1.parseImport = function(node) {1776 pp$8.parseImport = function(node) { 1769 1777 this.next(); 1770 1778 // import '...' 1771 if (this.type === types .string) {1772 node.specifiers = empty ;1779 if (this.type === types$1.string) { 1780 node.specifiers = empty$1; 1773 1781 node.source = this.parseExprAtom(); 1774 1782 } else { 1775 1783 node.specifiers = this.parseImportSpecifiers(); 1776 1784 this.expectContextual("from"); 1777 node.source = this.type === types .string ? this.parseExprAtom() : this.unexpected();1785 node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected(); 1778 1786 } 1779 1787 this.semicolon(); … … 1783 1791 // Parses a comma-separated list of module imports. 1784 1792 1785 pp$ 1.parseImportSpecifiers = function() {1793 pp$8.parseImportSpecifiers = function() { 1786 1794 var nodes = [], first = true; 1787 if (this.type === types .name) {1795 if (this.type === types$1.name) { 1788 1796 // import defaultObj, { x, y as z } from '...' 1789 1797 var node = this.startNode(); … … 1791 1799 this.checkLValSimple(node.local, BIND_LEXICAL); 1792 1800 nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); 1793 if (!this.eat(types .comma)) { return nodes }1794 } 1795 if (this.type === types .star) {1801 if (!this.eat(types$1.comma)) { return nodes } 1802 } 1803 if (this.type === types$1.star) { 1796 1804 var node$1 = this.startNode(); 1797 1805 this.next(); … … 1802 1810 return nodes 1803 1811 } 1804 this.expect(types .braceL);1805 while (!this.eat(types .braceR)) {1812 this.expect(types$1.braceL); 1813 while (!this.eat(types$1.braceR)) { 1806 1814 if (!first) { 1807 this.expect(types .comma);1808 if (this.afterTrailingComma(types .braceR)) { break }1815 this.expect(types$1.comma); 1816 if (this.afterTrailingComma(types$1.braceR)) { break } 1809 1817 } else { first = false; } 1810 1818 … … 1824 1832 1825 1833 // Set `ExpressionStatement#directive` property for directive prologues. 1826 pp$ 1.adaptDirectivePrologue = function(statements) {1834 pp$8.adaptDirectivePrologue = function(statements) { 1827 1835 for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { 1828 1836 statements[i].directive = statements[i].expression.raw.slice(1, -1); 1829 1837 } 1830 1838 }; 1831 pp$ 1.isDirectiveCandidate = function(statement) {1839 pp$8.isDirectiveCandidate = function(statement) { 1832 1840 return ( 1833 1841 statement.type === "ExpressionStatement" && … … 1839 1847 }; 1840 1848 1841 var pp$ 2= Parser.prototype;1849 var pp$7 = Parser.prototype; 1842 1850 1843 1851 // Convert existing expression atom to assignable pattern 1844 1852 // if possible. 1845 1853 1846 pp$ 2.toAssignable = function(node, isBinding, refDestructuringErrors) {1854 pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) { 1847 1855 if (this.options.ecmaVersion >= 6 && node) { 1848 1856 switch (node.type) { … … 1925 1933 // Convert list of expression atoms to binding list. 1926 1934 1927 pp$ 2.toAssignableList = function(exprList, isBinding) {1935 pp$7.toAssignableList = function(exprList, isBinding) { 1928 1936 var end = exprList.length; 1929 1937 for (var i = 0; i < end; i++) { … … 1941 1949 // Parses spread element. 1942 1950 1943 pp$ 2.parseSpread = function(refDestructuringErrors) {1951 pp$7.parseSpread = function(refDestructuringErrors) { 1944 1952 var node = this.startNode(); 1945 1953 this.next(); … … 1948 1956 }; 1949 1957 1950 pp$ 2.parseRestBinding = function() {1958 pp$7.parseRestBinding = function() { 1951 1959 var node = this.startNode(); 1952 1960 this.next(); 1953 1961 1954 1962 // RestElement inside of a function parameter must be an identifier 1955 if (this.options.ecmaVersion === 6 && this.type !== types .name)1963 if (this.options.ecmaVersion === 6 && this.type !== types$1.name) 1956 1964 { this.unexpected(); } 1957 1965 … … 1963 1971 // Parses lvalue (assignable) atom. 1964 1972 1965 pp$ 2.parseBindingAtom = function() {1973 pp$7.parseBindingAtom = function() { 1966 1974 if (this.options.ecmaVersion >= 6) { 1967 1975 switch (this.type) { 1968 case types .bracketL:1976 case types$1.bracketL: 1969 1977 var node = this.startNode(); 1970 1978 this.next(); 1971 node.elements = this.parseBindingList(types .bracketR, true, true);1979 node.elements = this.parseBindingList(types$1.bracketR, true, true); 1972 1980 return this.finishNode(node, "ArrayPattern") 1973 1981 1974 case types .braceL:1982 case types$1.braceL: 1975 1983 return this.parseObj(true) 1976 1984 } … … 1979 1987 }; 1980 1988 1981 pp$ 2.parseBindingList = function(close, allowEmpty, allowTrailingComma) {1989 pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma) { 1982 1990 var elts = [], first = true; 1983 1991 while (!this.eat(close)) { 1984 1992 if (first) { first = false; } 1985 else { this.expect(types .comma); }1986 if (allowEmpty && this.type === types .comma) {1993 else { this.expect(types$1.comma); } 1994 if (allowEmpty && this.type === types$1.comma) { 1987 1995 elts.push(null); 1988 1996 } else if (allowTrailingComma && this.afterTrailingComma(close)) { 1989 1997 break 1990 } else if (this.type === types .ellipsis) {1998 } else if (this.type === types$1.ellipsis) { 1991 1999 var rest = this.parseRestBinding(); 1992 2000 this.parseBindingListItem(rest); 1993 2001 elts.push(rest); 1994 if (this.type === types .comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }2002 if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } 1995 2003 this.expect(close); 1996 2004 break … … 2004 2012 }; 2005 2013 2006 pp$ 2.parseBindingListItem = function(param) {2014 pp$7.parseBindingListItem = function(param) { 2007 2015 return param 2008 2016 }; … … 2010 2018 // Parses assignment pattern around given atom if possible. 2011 2019 2012 pp$ 2.parseMaybeDefault = function(startPos, startLoc, left) {2020 pp$7.parseMaybeDefault = function(startPos, startLoc, left) { 2013 2021 left = left || this.parseBindingAtom(); 2014 if (this.options.ecmaVersion < 6 || !this.eat(types .eq)) { return left }2022 if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left } 2015 2023 var node = this.startNodeAt(startPos, startLoc); 2016 2024 node.left = left; … … 2083 2091 // is an assignment (i.e., bindingType is BIND_NONE). 2084 2092 2085 pp$ 2.checkLValSimple = function(expr, bindingType, checkClashes) {2093 pp$7.checkLValSimple = function(expr, bindingType, checkClashes) { 2086 2094 if ( bindingType === void 0 ) bindingType = BIND_NONE; 2087 2095 … … 2121 2129 }; 2122 2130 2123 pp$ 2.checkLValPattern = function(expr, bindingType, checkClashes) {2131 pp$7.checkLValPattern = function(expr, bindingType, checkClashes) { 2124 2132 if ( bindingType === void 0 ) bindingType = BIND_NONE; 2125 2133 … … 2146 2154 }; 2147 2155 2148 pp$ 2.checkLValInnerPattern = function(expr, bindingType, checkClashes) {2156 pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) { 2149 2157 if ( bindingType === void 0 ) bindingType = BIND_NONE; 2150 2158 … … 2178 2186 }; 2179 2187 2180 var types $1= {2188 var types = { 2181 2189 b_stat: new TokContext("{", false), 2182 2190 b_expr: new TokContext("{", true), … … 2191 2199 }; 2192 2200 2193 var pp$ 3= Parser.prototype;2194 2195 pp$ 3.initialContext = function() {2196 return [types $1.b_stat]2197 }; 2198 2199 pp$ 3.curContext = function() {2201 var pp$6 = Parser.prototype; 2202 2203 pp$6.initialContext = function() { 2204 return [types.b_stat] 2205 }; 2206 2207 pp$6.curContext = function() { 2200 2208 return this.context[this.context.length - 1] 2201 2209 }; 2202 2210 2203 pp$ 3.braceIsBlock = function(prevType) {2211 pp$6.braceIsBlock = function(prevType) { 2204 2212 var parent = this.curContext(); 2205 if (parent === types $1.f_expr || parent === types$1.f_stat)2213 if (parent === types.f_expr || parent === types.f_stat) 2206 2214 { return true } 2207 if (prevType === types .colon && (parent === types$1.b_stat || parent === types$1.b_expr))2215 if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr)) 2208 2216 { return !parent.isExpr } 2209 2217 … … 2211 2219 // after a `yield` or `of` construct. See the `updateContext` for 2212 2220 // `tt.name`. 2213 if (prevType === types ._return || prevType === types.name && this.exprAllowed)2221 if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed) 2214 2222 { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } 2215 if (prevType === types ._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow)2223 if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow) 2216 2224 { return true } 2217 if (prevType === types .braceL)2218 { return parent === types $1.b_stat }2219 if (prevType === types ._var || prevType === types._const || prevType === types.name)2225 if (prevType === types$1.braceL) 2226 { return parent === types.b_stat } 2227 if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name) 2220 2228 { return false } 2221 2229 return !this.exprAllowed 2222 2230 }; 2223 2231 2224 pp$ 3.inGeneratorContext = function() {2232 pp$6.inGeneratorContext = function() { 2225 2233 for (var i = this.context.length - 1; i >= 1; i--) { 2226 2234 var context = this.context[i]; … … 2231 2239 }; 2232 2240 2233 pp$ 3.updateContext = function(prevType) {2241 pp$6.updateContext = function(prevType) { 2234 2242 var update, type = this.type; 2235 if (type.keyword && prevType === types .dot)2243 if (type.keyword && prevType === types$1.dot) 2236 2244 { this.exprAllowed = false; } 2237 2245 else if (update = type.updateContext) … … 2242 2250 2243 2251 // Used to handle egde case when token context could not be inferred correctly in tokenize phase 2244 pp$ 3.overrideContext = function(tokenCtx) {2252 pp$6.overrideContext = function(tokenCtx) { 2245 2253 if (this.curContext() !== tokenCtx) { 2246 2254 this.context[this.context.length - 1] = tokenCtx; … … 2250 2258 // Token-specific context update code 2251 2259 2252 types .parenR.updateContext = types.braceR.updateContext = function() {2260 types$1.parenR.updateContext = types$1.braceR.updateContext = function() { 2253 2261 if (this.context.length === 1) { 2254 2262 this.exprAllowed = true; … … 2256 2264 } 2257 2265 var out = this.context.pop(); 2258 if (out === types $1.b_stat && this.curContext().token === "function") {2266 if (out === types.b_stat && this.curContext().token === "function") { 2259 2267 out = this.context.pop(); 2260 2268 } … … 2262 2270 }; 2263 2271 2264 types .braceL.updateContext = function(prevType) {2265 this.context.push(this.braceIsBlock(prevType) ? types $1.b_stat : types$1.b_expr);2272 types$1.braceL.updateContext = function(prevType) { 2273 this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); 2266 2274 this.exprAllowed = true; 2267 2275 }; 2268 2276 2269 types .dollarBraceL.updateContext = function() {2270 this.context.push(types $1.b_tmpl);2277 types$1.dollarBraceL.updateContext = function() { 2278 this.context.push(types.b_tmpl); 2271 2279 this.exprAllowed = true; 2272 2280 }; 2273 2281 2274 types .parenL.updateContext = function(prevType) {2275 var statementParens = prevType === types ._if || prevType === types._for || prevType === types._with || prevType === types._while;2276 this.context.push(statementParens ? types $1.p_stat : types$1.p_expr);2282 types$1.parenL.updateContext = function(prevType) { 2283 var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while; 2284 this.context.push(statementParens ? types.p_stat : types.p_expr); 2277 2285 this.exprAllowed = true; 2278 2286 }; 2279 2287 2280 types .incDec.updateContext = function() {2288 types$1.incDec.updateContext = function() { 2281 2289 // tokExprAllowed stays unchanged 2282 2290 }; 2283 2291 2284 types ._function.updateContext = types._class.updateContext = function(prevType) {2285 if (prevType.beforeExpr && prevType !== types ._else &&2286 !(prevType === types .semi && this.curContext() !== types$1.p_stat) &&2287 !(prevType === types ._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&2288 !((prevType === types .colon || prevType === types.braceL) && this.curContext() === types$1.b_stat))2289 { this.context.push(types $1.f_expr); }2292 types$1._function.updateContext = types$1._class.updateContext = function(prevType) { 2293 if (prevType.beforeExpr && prevType !== types$1._else && 2294 !(prevType === types$1.semi && this.curContext() !== types.p_stat) && 2295 !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) && 2296 !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat)) 2297 { this.context.push(types.f_expr); } 2290 2298 else 2291 { this.context.push(types $1.f_stat); }2299 { this.context.push(types.f_stat); } 2292 2300 this.exprAllowed = false; 2293 2301 }; 2294 2302 2295 types .backQuote.updateContext = function() {2296 if (this.curContext() === types $1.q_tmpl)2303 types$1.backQuote.updateContext = function() { 2304 if (this.curContext() === types.q_tmpl) 2297 2305 { this.context.pop(); } 2298 2306 else 2299 { this.context.push(types $1.q_tmpl); }2307 { this.context.push(types.q_tmpl); } 2300 2308 this.exprAllowed = false; 2301 2309 }; 2302 2310 2303 types .star.updateContext = function(prevType) {2304 if (prevType === types ._function) {2311 types$1.star.updateContext = function(prevType) { 2312 if (prevType === types$1._function) { 2305 2313 var index = this.context.length - 1; 2306 if (this.context[index] === types $1.f_expr)2307 { this.context[index] = types $1.f_expr_gen; }2314 if (this.context[index] === types.f_expr) 2315 { this.context[index] = types.f_expr_gen; } 2308 2316 else 2309 { this.context[index] = types $1.f_gen; }2317 { this.context[index] = types.f_gen; } 2310 2318 } 2311 2319 this.exprAllowed = true; 2312 2320 }; 2313 2321 2314 types .name.updateContext = function(prevType) {2322 types$1.name.updateContext = function(prevType) { 2315 2323 var allowed = false; 2316 if (this.options.ecmaVersion >= 6 && prevType !== types .dot) {2324 if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) { 2317 2325 if (this.value === "of" && !this.exprAllowed || 2318 2326 this.value === "yield" && this.inGeneratorContext()) … … 2324 2332 // A recursive descent parser operates by defining functions for all 2325 2333 2326 var pp$ 4= Parser.prototype;2334 var pp$5 = Parser.prototype; 2327 2335 2328 2336 // Check if property name clashes with already added. … … 2331 2339 // strict mode, init properties are also not allowed to be repeated. 2332 2340 2333 pp$ 4.checkPropClash = function(prop, propHash, refDestructuringErrors) {2341 pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) { 2334 2342 if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") 2335 2343 { return } … … 2348 2356 if (propHash.proto) { 2349 2357 if (refDestructuringErrors) { 2350 if (refDestructuringErrors.doubleProto < 0) 2351 { refDestructuringErrors.doubleProto = key.start; } 2352 // Backwards-compat kludge. Can be removed in version 6.0 2353 } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } 2358 if (refDestructuringErrors.doubleProto < 0) { 2359 refDestructuringErrors.doubleProto = key.start; 2360 } 2361 } else { 2362 this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); 2363 } 2354 2364 } 2355 2365 propHash.proto = true; … … 2393 2403 // delayed syntax error at correct position). 2394 2404 2395 pp$ 4.parseExpression = function(forInit, refDestructuringErrors) {2405 pp$5.parseExpression = function(forInit, refDestructuringErrors) { 2396 2406 var startPos = this.start, startLoc = this.startLoc; 2397 2407 var expr = this.parseMaybeAssign(forInit, refDestructuringErrors); 2398 if (this.type === types .comma) {2408 if (this.type === types$1.comma) { 2399 2409 var node = this.startNodeAt(startPos, startLoc); 2400 2410 node.expressions = [expr]; 2401 while (this.eat(types .comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); }2411 while (this.eat(types$1.comma)) { node.expressions.push(this.parseMaybeAssign(forInit, refDestructuringErrors)); } 2402 2412 return this.finishNode(node, "SequenceExpression") 2403 2413 } … … 2408 2418 // operators like `+=`. 2409 2419 2410 pp$ 4.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {2420 pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) { 2411 2421 if (this.isContextual("yield")) { 2412 2422 if (this.inGenerator) { return this.parseYield(forInit) } … … 2416 2426 } 2417 2427 2418 var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1 ;2428 var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1; 2419 2429 if (refDestructuringErrors) { 2420 2430 oldParenAssign = refDestructuringErrors.parenthesizedAssign; 2421 2431 oldTrailingComma = refDestructuringErrors.trailingComma; 2432 oldDoubleProto = refDestructuringErrors.doubleProto; 2422 2433 refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; 2423 2434 } else { … … 2427 2438 2428 2439 var startPos = this.start, startLoc = this.startLoc; 2429 if (this.type === types .parenL || this.type === types.name) {2440 if (this.type === types$1.parenL || this.type === types$1.name) { 2430 2441 this.potentialArrowAt = this.start; 2431 2442 this.potentialArrowInForAwait = forInit === "await"; … … 2436 2447 var node = this.startNodeAt(startPos, startLoc); 2437 2448 node.operator = this.value; 2438 if (this.type === types .eq)2449 if (this.type === types$1.eq) 2439 2450 { left = this.toAssignable(left, false, refDestructuringErrors); } 2440 2451 if (!ownDestructuringErrors) { … … 2443 2454 if (refDestructuringErrors.shorthandAssign >= left.start) 2444 2455 { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly 2445 if (this.type === types .eq)2456 if (this.type === types$1.eq) 2446 2457 { this.checkLValPattern(left); } 2447 2458 else … … 2450 2461 this.next(); 2451 2462 node.right = this.parseMaybeAssign(forInit); 2463 if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; } 2452 2464 return this.finishNode(node, "AssignmentExpression") 2453 2465 } else { … … 2461 2473 // Parse a ternary conditional (`?:`) operator. 2462 2474 2463 pp$ 4.parseMaybeConditional = function(forInit, refDestructuringErrors) {2475 pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) { 2464 2476 var startPos = this.start, startLoc = this.startLoc; 2465 2477 var expr = this.parseExprOps(forInit, refDestructuringErrors); 2466 2478 if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } 2467 if (this.eat(types .question)) {2479 if (this.eat(types$1.question)) { 2468 2480 var node = this.startNodeAt(startPos, startLoc); 2469 2481 node.test = expr; 2470 2482 node.consequent = this.parseMaybeAssign(); 2471 this.expect(types .colon);2483 this.expect(types$1.colon); 2472 2484 node.alternate = this.parseMaybeAssign(forInit); 2473 2485 return this.finishNode(node, "ConditionalExpression") … … 2478 2490 // Start the precedence parser. 2479 2491 2480 pp$ 4.parseExprOps = function(forInit, refDestructuringErrors) {2492 pp$5.parseExprOps = function(forInit, refDestructuringErrors) { 2481 2493 var startPos = this.start, startLoc = this.startLoc; 2482 2494 var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit); … … 2491 2503 // operator that has a lower precedence than the set it is parsing. 2492 2504 2493 pp$ 4.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {2505 pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) { 2494 2506 var prec = this.type.binop; 2495 if (prec != null && (!forInit || this.type !== types ._in)) {2507 if (prec != null && (!forInit || this.type !== types$1._in)) { 2496 2508 if (prec > minPrec) { 2497 var logical = this.type === types .logicalOR || this.type === types.logicalAND;2498 var coalesce = this.type === types .coalesce;2509 var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND; 2510 var coalesce = this.type === types$1.coalesce; 2499 2511 if (coalesce) { 2500 2512 // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions. 2501 2513 // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error. 2502 prec = types .logicalAND.binop;2514 prec = types$1.logicalAND.binop; 2503 2515 } 2504 2516 var op = this.value; … … 2507 2519 var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit); 2508 2520 var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce); 2509 if ((logical && this.type === types .coalesce) || (coalesce && (this.type === types.logicalOR || this.type === types.logicalAND))) {2521 if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) { 2510 2522 this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"); 2511 2523 } … … 2516 2528 }; 2517 2529 2518 pp$4.buildBinary = function(startPos, startLoc, left, right, op, logical) { 2530 pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) { 2531 if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); } 2519 2532 var node = this.startNodeAt(startPos, startLoc); 2520 2533 node.left = left; … … 2526 2539 // Parse unary operators, both prefix and postfix. 2527 2540 2528 pp$ 4.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {2541 pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) { 2529 2542 var startPos = this.start, startLoc = this.startLoc, expr; 2530 2543 if (this.isContextual("await") && this.canAwait) { … … 2532 2545 sawUnary = true; 2533 2546 } else if (this.type.prefix) { 2534 var node = this.startNode(), update = this.type === types .incDec;2547 var node = this.startNode(), update = this.type === types$1.incDec; 2535 2548 node.operator = this.value; 2536 2549 node.prefix = true; … … 2546 2559 else { sawUnary = true; } 2547 2560 expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); 2561 } else if (!sawUnary && this.type === types$1.privateId) { 2562 if (forInit || this.privateNameStack.length === 0) { this.unexpected(); } 2563 expr = this.parsePrivateIdent(); 2564 // only could be private fields in 'in', such as #x in obj 2565 if (this.type !== types$1._in) { this.unexpected(); } 2548 2566 } else { 2549 2567 expr = this.parseExprSubscripts(refDestructuringErrors, forInit); … … 2560 2578 } 2561 2579 2562 if (!incDec && this.eat(types .starstar)) {2580 if (!incDec && this.eat(types$1.starstar)) { 2563 2581 if (sawUnary) 2564 2582 { this.unexpected(this.lastTokStart); } … … 2579 2597 // Parse call, dot, and `[]`-subscript expressions. 2580 2598 2581 pp$ 4.parseExprSubscripts = function(refDestructuringErrors, forInit) {2599 pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) { 2582 2600 var startPos = this.start, startLoc = this.startLoc; 2583 2601 var expr = this.parseExprAtom(refDestructuringErrors, forInit); … … 2593 2611 }; 2594 2612 2595 pp$ 4.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {2613 pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) { 2596 2614 var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && 2597 2615 this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && … … 2616 2634 }; 2617 2635 2618 pp$ 4.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {2636 pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) { 2619 2637 var optionalSupported = this.options.ecmaVersion >= 11; 2620 var optional = optionalSupported && this.eat(types .questionDot);2638 var optional = optionalSupported && this.eat(types$1.questionDot); 2621 2639 if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); } 2622 2640 2623 var computed = this.eat(types .bracketL);2624 if (computed || (optional && this.type !== types .parenL && this.type !== types.backQuote) || this.eat(types.dot)) {2641 var computed = this.eat(types$1.bracketL); 2642 if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) { 2625 2643 var node = this.startNodeAt(startPos, startLoc); 2626 2644 node.object = base; 2627 2645 if (computed) { 2628 2646 node.property = this.parseExpression(); 2629 this.expect(types .bracketR);2630 } else if (this.type === types .privateId && base.type !== "Super") {2647 this.expect(types$1.bracketR); 2648 } else if (this.type === types$1.privateId && base.type !== "Super") { 2631 2649 node.property = this.parsePrivateIdent(); 2632 2650 } else { … … 2638 2656 } 2639 2657 base = this.finishNode(node, "MemberExpression"); 2640 } else if (!noCalls && this.eat(types .parenL)) {2658 } else if (!noCalls && this.eat(types$1.parenL)) { 2641 2659 var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; 2642 2660 this.yieldPos = 0; 2643 2661 this.awaitPos = 0; 2644 2662 this.awaitIdentPos = 0; 2645 var exprList = this.parseExprList(types .parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);2646 if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types .arrow)) {2663 var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors); 2664 if (maybeAsyncArrow && !optional && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { 2647 2665 this.checkPatternErrors(refDestructuringErrors, false); 2648 2666 this.checkYieldAwaitInDefaultParams(); … … 2665 2683 } 2666 2684 base = this.finishNode(node$1, "CallExpression"); 2667 } else if (this.type === types .backQuote) {2685 } else if (this.type === types$1.backQuote) { 2668 2686 if (optional || optionalChained) { 2669 2687 this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions"); … … 2682 2700 // or `{}`. 2683 2701 2684 pp$ 4.parseExprAtom = function(refDestructuringErrors, forInit) {2702 pp$5.parseExprAtom = function(refDestructuringErrors, forInit) { 2685 2703 // If a division operator appears in an expression position, the 2686 2704 // tokenizer got confused, and we force it to read a regexp instead. 2687 if (this.type === types .slash) { this.readRegexp(); }2705 if (this.type === types$1.slash) { this.readRegexp(); } 2688 2706 2689 2707 var node, canBeArrow = this.potentialArrowAt === this.start; 2690 2708 switch (this.type) { 2691 case types ._super:2709 case types$1._super: 2692 2710 if (!this.allowSuper) 2693 2711 { this.raise(this.start, "'super' keyword outside a method"); } 2694 2712 node = this.startNode(); 2695 2713 this.next(); 2696 if (this.type === types .parenL && !this.allowDirectSuper)2714 if (this.type === types$1.parenL && !this.allowDirectSuper) 2697 2715 { this.raise(node.start, "super() call outside constructor of a subclass"); } 2698 2716 // The `super` keyword can appear at below: … … 2702 2720 // SuperCall: 2703 2721 // super ( Arguments ) 2704 if (this.type !== types .dot && this.type !== types.bracketL && this.type !== types.parenL)2722 if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL) 2705 2723 { this.unexpected(); } 2706 2724 return this.finishNode(node, "Super") 2707 2725 2708 case types ._this:2726 case types$1._this: 2709 2727 node = this.startNode(); 2710 2728 this.next(); 2711 2729 return this.finishNode(node, "ThisExpression") 2712 2730 2713 case types .name:2731 case types$1.name: 2714 2732 var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; 2715 2733 var id = this.parseIdent(false); 2716 if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types ._function)) {2717 this.overrideContext(types $1.f_expr);2734 if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) { 2735 this.overrideContext(types.f_expr); 2718 2736 return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit) 2719 2737 } 2720 2738 if (canBeArrow && !this.canInsertSemicolon()) { 2721 if (this.eat(types .arrow))2739 if (this.eat(types$1.arrow)) 2722 2740 { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) } 2723 if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types .name && !containsEsc &&2741 if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc && 2724 2742 (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) { 2725 2743 id = this.parseIdent(false); 2726 if (this.canInsertSemicolon() || !this.eat(types .arrow))2744 if (this.canInsertSemicolon() || !this.eat(types$1.arrow)) 2727 2745 { this.unexpected(); } 2728 2746 return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit) … … 2731 2749 return id 2732 2750 2733 case types .regexp:2751 case types$1.regexp: 2734 2752 var value = this.value; 2735 2753 node = this.parseLiteral(value.value); … … 2737 2755 return node 2738 2756 2739 case types .num: case types.string:2757 case types$1.num: case types$1.string: 2740 2758 return this.parseLiteral(this.value) 2741 2759 2742 case types ._null: case types._true: case types._false:2760 case types$1._null: case types$1._true: case types$1._false: 2743 2761 node = this.startNode(); 2744 node.value = this.type === types ._null ? null : this.type === types._true;2762 node.value = this.type === types$1._null ? null : this.type === types$1._true; 2745 2763 node.raw = this.type.keyword; 2746 2764 this.next(); 2747 2765 return this.finishNode(node, "Literal") 2748 2766 2749 case types .parenL:2767 case types$1.parenL: 2750 2768 var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit); 2751 2769 if (refDestructuringErrors) { … … 2757 2775 return expr 2758 2776 2759 case types .bracketL:2777 case types$1.bracketL: 2760 2778 node = this.startNode(); 2761 2779 this.next(); 2762 node.elements = this.parseExprList(types .bracketR, true, true, refDestructuringErrors);2780 node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors); 2763 2781 return this.finishNode(node, "ArrayExpression") 2764 2782 2765 case types .braceL:2766 this.overrideContext(types $1.b_expr);2783 case types$1.braceL: 2784 this.overrideContext(types.b_expr); 2767 2785 return this.parseObj(false, refDestructuringErrors) 2768 2786 2769 case types ._function:2787 case types$1._function: 2770 2788 node = this.startNode(); 2771 2789 this.next(); 2772 2790 return this.parseFunction(node, 0) 2773 2791 2774 case types ._class:2792 case types$1._class: 2775 2793 return this.parseClass(this.startNode(), false) 2776 2794 2777 case types ._new:2795 case types$1._new: 2778 2796 return this.parseNew() 2779 2797 2780 case types .backQuote:2798 case types$1.backQuote: 2781 2799 return this.parseTemplate() 2782 2800 2783 case types ._import:2801 case types$1._import: 2784 2802 if (this.options.ecmaVersion >= 11) { 2785 2803 return this.parseExprImport() … … 2793 2811 }; 2794 2812 2795 pp$ 4.parseExprImport = function() {2813 pp$5.parseExprImport = function() { 2796 2814 var node = this.startNode(); 2797 2815 … … 2802 2820 2803 2821 switch (this.type) { 2804 case types .parenL:2822 case types$1.parenL: 2805 2823 return this.parseDynamicImport(node) 2806 case types .dot:2824 case types$1.dot: 2807 2825 node.meta = meta; 2808 2826 return this.parseImportMeta(node) … … 2812 2830 }; 2813 2831 2814 pp$ 4.parseDynamicImport = function(node) {2832 pp$5.parseDynamicImport = function(node) { 2815 2833 this.next(); // skip `(` 2816 2834 … … 2819 2837 2820 2838 // Verify ending. 2821 if (!this.eat(types .parenR)) {2839 if (!this.eat(types$1.parenR)) { 2822 2840 var errorPos = this.start; 2823 if (this.eat(types .comma) && this.eat(types.parenR)) {2841 if (this.eat(types$1.comma) && this.eat(types$1.parenR)) { 2824 2842 this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()"); 2825 2843 } else { … … 2831 2849 }; 2832 2850 2833 pp$ 4.parseImportMeta = function(node) {2851 pp$5.parseImportMeta = function(node) { 2834 2852 this.next(); // skip `.` 2835 2853 … … 2847 2865 }; 2848 2866 2849 pp$ 4.parseLiteral = function(value) {2867 pp$5.parseLiteral = function(value) { 2850 2868 var node = this.startNode(); 2851 2869 node.value = value; … … 2856 2874 }; 2857 2875 2858 pp$ 4.parseParenExpression = function() {2859 this.expect(types .parenL);2876 pp$5.parseParenExpression = function() { 2877 this.expect(types$1.parenL); 2860 2878 var val = this.parseExpression(); 2861 this.expect(types .parenR);2879 this.expect(types$1.parenR); 2862 2880 return val 2863 2881 }; 2864 2882 2865 pp$ 4.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {2883 pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) { 2866 2884 var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; 2867 2885 if (this.options.ecmaVersion >= 6) { … … 2874 2892 this.awaitPos = 0; 2875 2893 // Do not save awaitIdentPos to allow checking awaits nested in parameters 2876 while (this.type !== types .parenR) {2877 first ? first = false : this.expect(types .comma);2878 if (allowTrailingComma && this.afterTrailingComma(types .parenR, true)) {2894 while (this.type !== types$1.parenR) { 2895 first ? first = false : this.expect(types$1.comma); 2896 if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) { 2879 2897 lastIsComma = true; 2880 2898 break 2881 } else if (this.type === types .ellipsis) {2899 } else if (this.type === types$1.ellipsis) { 2882 2900 spreadStart = this.start; 2883 2901 exprList.push(this.parseParenItem(this.parseRestBinding())); 2884 if (this.type === types .comma) { this.raise(this.start, "Comma is not permitted after the rest element"); }2902 if (this.type === types$1.comma) { this.raise(this.start, "Comma is not permitted after the rest element"); } 2885 2903 break 2886 2904 } else { … … 2889 2907 } 2890 2908 var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc; 2891 this.expect(types .parenR);2892 2893 if (canBeArrow && !this.canInsertSemicolon() && this.eat(types .arrow)) {2909 this.expect(types$1.parenR); 2910 2911 if (canBeArrow && !this.canInsertSemicolon() && this.eat(types$1.arrow)) { 2894 2912 this.checkPatternErrors(refDestructuringErrors, false); 2895 2913 this.checkYieldAwaitInDefaultParams(); … … 2925 2943 }; 2926 2944 2927 pp$ 4.parseParenItem = function(item) {2945 pp$5.parseParenItem = function(item) { 2928 2946 return item 2929 2947 }; 2930 2948 2931 pp$ 4.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {2932 return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, f orInit)2949 pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) { 2950 return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit) 2933 2951 }; 2934 2952 … … 2939 2957 // argument list. 2940 2958 2941 var empty $1= [];2942 2943 pp$ 4.parseNew = function() {2959 var empty = []; 2960 2961 pp$5.parseNew = function() { 2944 2962 if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } 2945 2963 var node = this.startNode(); 2946 2964 var meta = this.parseIdent(true); 2947 if (this.options.ecmaVersion >= 6 && this.eat(types .dot)) {2965 if (this.options.ecmaVersion >= 6 && this.eat(types$1.dot)) { 2948 2966 node.meta = meta; 2949 2967 var containsEsc = this.containsEsc; … … 2957 2975 return this.finishNode(node, "MetaProperty") 2958 2976 } 2959 var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types ._import;2977 var startPos = this.start, startLoc = this.startLoc, isImport = this.type === types$1._import; 2960 2978 node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true, false); 2961 2979 if (isImport && node.callee.type === "ImportExpression") { 2962 2980 this.raise(startPos, "Cannot use new with import()"); 2963 2981 } 2964 if (this.eat(types .parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); }2965 else { node.arguments = empty $1; }2982 if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); } 2983 else { node.arguments = empty; } 2966 2984 return this.finishNode(node, "NewExpression") 2967 2985 }; … … 2969 2987 // Parse template expression. 2970 2988 2971 pp$ 4.parseTemplateElement = function(ref) {2989 pp$5.parseTemplateElement = function(ref) { 2972 2990 var isTagged = ref.isTagged; 2973 2991 2974 2992 var elem = this.startNode(); 2975 if (this.type === types .invalidTemplate) {2993 if (this.type === types$1.invalidTemplate) { 2976 2994 if (!isTagged) { 2977 2995 this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); … … 2988 3006 } 2989 3007 this.next(); 2990 elem.tail = this.type === types .backQuote;3008 elem.tail = this.type === types$1.backQuote; 2991 3009 return this.finishNode(elem, "TemplateElement") 2992 3010 }; 2993 3011 2994 pp$ 4.parseTemplate = function(ref) {3012 pp$5.parseTemplate = function(ref) { 2995 3013 if ( ref === void 0 ) ref = {}; 2996 3014 var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; … … 3002 3020 node.quasis = [curElt]; 3003 3021 while (!curElt.tail) { 3004 if (this.type === types .eof) { this.raise(this.pos, "Unterminated template literal"); }3005 this.expect(types .dollarBraceL);3022 if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); } 3023 this.expect(types$1.dollarBraceL); 3006 3024 node.expressions.push(this.parseExpression()); 3007 this.expect(types .braceR);3025 this.expect(types$1.braceR); 3008 3026 node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged})); 3009 3027 } … … 3012 3030 }; 3013 3031 3014 pp$ 4.isAsyncProp = function(prop) {3032 pp$5.isAsyncProp = function(prop) { 3015 3033 return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && 3016 (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)) &&3034 (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)) && 3017 3035 !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) 3018 3036 }; … … 3020 3038 // Parse an object literal or binding pattern. 3021 3039 3022 pp$ 4.parseObj = function(isPattern, refDestructuringErrors) {3040 pp$5.parseObj = function(isPattern, refDestructuringErrors) { 3023 3041 var node = this.startNode(), first = true, propHash = {}; 3024 3042 node.properties = []; 3025 3043 this.next(); 3026 while (!this.eat(types .braceR)) {3044 while (!this.eat(types$1.braceR)) { 3027 3045 if (!first) { 3028 this.expect(types .comma);3029 if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types .braceR)) { break }3046 this.expect(types$1.comma); 3047 if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break } 3030 3048 } else { first = false; } 3031 3049 … … 3037 3055 }; 3038 3056 3039 pp$ 4.parseProperty = function(isPattern, refDestructuringErrors) {3057 pp$5.parseProperty = function(isPattern, refDestructuringErrors) { 3040 3058 var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; 3041 if (this.options.ecmaVersion >= 9 && this.eat(types .ellipsis)) {3059 if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) { 3042 3060 if (isPattern) { 3043 3061 prop.argument = this.parseIdent(false); 3044 if (this.type === types .comma) {3062 if (this.type === types$1.comma) { 3045 3063 this.raise(this.start, "Comma is not permitted after the rest element"); 3046 3064 } … … 3048 3066 } 3049 3067 // To disallow parenthesized identifier via `this.toAssignable()`. 3050 if (this.type === types .parenL && refDestructuringErrors) {3068 if (this.type === types$1.parenL && refDestructuringErrors) { 3051 3069 if (refDestructuringErrors.parenthesizedAssign < 0) { 3052 3070 refDestructuringErrors.parenthesizedAssign = this.start; … … 3059 3077 prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); 3060 3078 // To disallow trailing comma via `this.toAssignable()`. 3061 if (this.type === types .comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {3079 if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { 3062 3080 refDestructuringErrors.trailingComma = this.start; 3063 3081 } … … 3073 3091 } 3074 3092 if (!isPattern) 3075 { isGenerator = this.eat(types .star); }3093 { isGenerator = this.eat(types$1.star); } 3076 3094 } 3077 3095 var containsEsc = this.containsEsc; … … 3079 3097 if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { 3080 3098 isAsync = true; 3081 isGenerator = this.options.ecmaVersion >= 9 && this.eat(types .star);3099 isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star); 3082 3100 this.parsePropertyName(prop, refDestructuringErrors); 3083 3101 } else { … … 3088 3106 }; 3089 3107 3090 pp$ 4.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {3091 if ((isGenerator || isAsync) && this.type === types .colon)3108 pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { 3109 if ((isGenerator || isAsync) && this.type === types$1.colon) 3092 3110 { this.unexpected(); } 3093 3111 3094 if (this.eat(types .colon)) {3112 if (this.eat(types$1.colon)) { 3095 3113 prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); 3096 3114 prop.kind = "init"; 3097 } else if (this.options.ecmaVersion >= 6 && this.type === types .parenL) {3115 } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) { 3098 3116 if (isPattern) { this.unexpected(); } 3099 3117 prop.kind = "init"; … … 3103 3121 this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && 3104 3122 (prop.key.name === "get" || prop.key.name === "set") && 3105 (this.type !== types .comma && this.type !== types.braceR && this.type !== types.eq)) {3123 (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) { 3106 3124 if (isGenerator || isAsync) { this.unexpected(); } 3107 3125 prop.kind = prop.key.name; … … 3127 3145 if (isPattern) { 3128 3146 prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key)); 3129 } else if (this.type === types .eq && refDestructuringErrors) {3147 } else if (this.type === types$1.eq && refDestructuringErrors) { 3130 3148 if (refDestructuringErrors.shorthandAssign < 0) 3131 3149 { refDestructuringErrors.shorthandAssign = this.start; } … … 3138 3156 }; 3139 3157 3140 pp$ 4.parsePropertyName = function(prop) {3158 pp$5.parsePropertyName = function(prop) { 3141 3159 if (this.options.ecmaVersion >= 6) { 3142 if (this.eat(types .bracketL)) {3160 if (this.eat(types$1.bracketL)) { 3143 3161 prop.computed = true; 3144 3162 prop.key = this.parseMaybeAssign(); 3145 this.expect(types .bracketR);3163 this.expect(types$1.bracketR); 3146 3164 return prop.key 3147 3165 } else { … … 3149 3167 } 3150 3168 } 3151 return prop.key = this.type === types .num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")3169 return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never") 3152 3170 }; 3153 3171 3154 3172 // Initialize empty function node. 3155 3173 3156 pp$ 4.initFunction = function(node) {3174 pp$5.initFunction = function(node) { 3157 3175 node.id = null; 3158 3176 if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; } … … 3162 3180 // Parse object or class method. 3163 3181 3164 pp$ 4.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {3182 pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) { 3165 3183 var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; 3166 3184 … … 3176 3194 this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0)); 3177 3195 3178 this.expect(types .parenL);3179 node.params = this.parseBindingList(types .parenR, false, this.options.ecmaVersion >= 8);3196 this.expect(types$1.parenL); 3197 node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8); 3180 3198 this.checkYieldAwaitInDefaultParams(); 3181 3199 this.parseFunctionBody(node, false, true, false); … … 3189 3207 // Parse arrow function expression with given parameters. 3190 3208 3191 pp$ 4.parseArrowExpression = function(node, params, isAsync, forInit) {3209 pp$5.parseArrowExpression = function(node, params, isAsync, forInit) { 3192 3210 var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos; 3193 3211 … … 3211 3229 // Parse function body and check parameters. 3212 3230 3213 pp$ 4.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {3214 var isExpression = isArrowFunction && this.type !== types .braceL;3231 pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) { 3232 var isExpression = isArrowFunction && this.type !== types$1.braceL; 3215 3233 var oldStrict = this.strict, useStrict = false; 3216 3234 … … 3248 3266 }; 3249 3267 3250 pp$ 4.isSimpleParamList = function(params) {3268 pp$5.isSimpleParamList = function(params) { 3251 3269 for (var i = 0, list = params; i < list.length; i += 1) 3252 3270 { … … 3261 3279 // or "arguments" and duplicate parameters. 3262 3280 3263 pp$ 4.checkParams = function(node, allowDuplicates) {3281 pp$5.checkParams = function(node, allowDuplicates) { 3264 3282 var nameHash = Object.create(null); 3265 3283 for (var i = 0, list = node.params; i < list.length; i += 1) … … 3277 3295 // for array literals). 3278 3296 3279 pp$ 4.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {3297 pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { 3280 3298 var elts = [], first = true; 3281 3299 while (!this.eat(close)) { 3282 3300 if (!first) { 3283 this.expect(types .comma);3301 this.expect(types$1.comma); 3284 3302 if (allowTrailingComma && this.afterTrailingComma(close)) { break } 3285 3303 } else { first = false; } 3286 3304 3287 3305 var elt = (void 0); 3288 if (allowEmpty && this.type === types .comma)3306 if (allowEmpty && this.type === types$1.comma) 3289 3307 { elt = null; } 3290 else if (this.type === types .ellipsis) {3308 else if (this.type === types$1.ellipsis) { 3291 3309 elt = this.parseSpread(refDestructuringErrors); 3292 if (refDestructuringErrors && this.type === types .comma && refDestructuringErrors.trailingComma < 0)3310 if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0) 3293 3311 { refDestructuringErrors.trailingComma = this.start; } 3294 3312 } else { … … 3300 3318 }; 3301 3319 3302 pp$ 4.checkUnreserved = function(ref) {3320 pp$5.checkUnreserved = function(ref) { 3303 3321 var start = ref.start; 3304 3322 var end = ref.end; … … 3329 3347 // identifiers. 3330 3348 3331 pp$ 4.parseIdent = function(liberal, isBinding) {3349 pp$5.parseIdent = function(liberal, isBinding) { 3332 3350 var node = this.startNode(); 3333 if (this.type === types .name) {3351 if (this.type === types$1.name) { 3334 3352 node.name = this.value; 3335 3353 } else if (this.type.keyword) { … … 3357 3375 }; 3358 3376 3359 pp$ 4.parsePrivateIdent = function() {3377 pp$5.parsePrivateIdent = function() { 3360 3378 var node = this.startNode(); 3361 if (this.type === types .privateId) {3379 if (this.type === types$1.privateId) { 3362 3380 node.name = this.value; 3363 3381 } else { … … 3379 3397 // Parses yield expression inside generator. 3380 3398 3381 pp$ 4.parseYield = function(forInit) {3399 pp$5.parseYield = function(forInit) { 3382 3400 if (!this.yieldPos) { this.yieldPos = this.start; } 3383 3401 3384 3402 var node = this.startNode(); 3385 3403 this.next(); 3386 if (this.type === types .semi || this.canInsertSemicolon() || (this.type !== types.star && !this.type.startsExpr)) {3404 if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) { 3387 3405 node.delegate = false; 3388 3406 node.argument = null; 3389 3407 } else { 3390 node.delegate = this.eat(types .star);3408 node.delegate = this.eat(types$1.star); 3391 3409 node.argument = this.parseMaybeAssign(forInit); 3392 3410 } … … 3394 3412 }; 3395 3413 3396 pp$ 4.parseAwait = function(forInit) {3414 pp$5.parseAwait = function(forInit) { 3397 3415 if (!this.awaitPos) { this.awaitPos = this.start; } 3398 3416 … … 3403 3421 }; 3404 3422 3405 var pp$ 5= Parser.prototype;3423 var pp$4 = Parser.prototype; 3406 3424 3407 3425 // This function is used to raise exceptions on parse errors. It … … 3411 3429 // message. 3412 3430 3413 pp$ 5.raise = function(pos, message) {3431 pp$4.raise = function(pos, message) { 3414 3432 var loc = getLineInfo(this.input, pos); 3415 3433 message += " (" + loc.line + ":" + loc.column + ")"; … … 3419 3437 }; 3420 3438 3421 pp$ 5.raiseRecoverable = pp$5.raise;3422 3423 pp$ 5.curPosition = function() {3439 pp$4.raiseRecoverable = pp$4.raise; 3440 3441 pp$4.curPosition = function() { 3424 3442 if (this.options.locations) { 3425 3443 return new Position(this.curLine, this.pos - this.lineStart) … … 3427 3445 }; 3428 3446 3429 var pp$ 6= Parser.prototype;3447 var pp$3 = Parser.prototype; 3430 3448 3431 3449 var Scope = function Scope(flags) { … … 3443 3461 // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. 3444 3462 3445 pp$ 6.enterScope = function(flags) {3463 pp$3.enterScope = function(flags) { 3446 3464 this.scopeStack.push(new Scope(flags)); 3447 3465 }; 3448 3466 3449 pp$ 6.exitScope = function() {3467 pp$3.exitScope = function() { 3450 3468 this.scopeStack.pop(); 3451 3469 }; … … 3454 3472 // > At the top level of a function, or script, function declarations are 3455 3473 // > treated like var declarations rather than like lexical declarations. 3456 pp$ 6.treatFunctionsAsVarInScope = function(scope) {3474 pp$3.treatFunctionsAsVarInScope = function(scope) { 3457 3475 return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP) 3458 3476 }; 3459 3477 3460 pp$ 6.declareName = function(name, bindingType, pos) {3478 pp$3.declareName = function(name, bindingType, pos) { 3461 3479 var redeclared = false; 3462 3480 if (bindingType === BIND_LEXICAL) { … … 3493 3511 }; 3494 3512 3495 pp$ 6.checkLocalExport = function(id) {3513 pp$3.checkLocalExport = function(id) { 3496 3514 // scope.functions must be empty as Module code is always strict. 3497 3515 if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && … … 3501 3519 }; 3502 3520 3503 pp$ 6.currentScope = function() {3521 pp$3.currentScope = function() { 3504 3522 return this.scopeStack[this.scopeStack.length - 1] 3505 3523 }; 3506 3524 3507 pp$ 6.currentVarScope = function() {3525 pp$3.currentVarScope = function() { 3508 3526 for (var i = this.scopeStack.length - 1;; i--) { 3509 3527 var scope = this.scopeStack[i]; … … 3513 3531 3514 3532 // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. 3515 pp$ 6.currentThisScope = function() {3533 pp$3.currentThisScope = function() { 3516 3534 for (var i = this.scopeStack.length - 1;; i--) { 3517 3535 var scope = this.scopeStack[i]; … … 3534 3552 // Start an AST node, attaching a start offset. 3535 3553 3536 var pp$ 7= Parser.prototype;3537 3538 pp$ 7.startNode = function() {3554 var pp$2 = Parser.prototype; 3555 3556 pp$2.startNode = function() { 3539 3557 return new Node(this, this.start, this.startLoc) 3540 3558 }; 3541 3559 3542 pp$ 7.startNodeAt = function(pos, loc) {3560 pp$2.startNodeAt = function(pos, loc) { 3543 3561 return new Node(this, pos, loc) 3544 3562 }; … … 3556 3574 } 3557 3575 3558 pp$ 7.finishNode = function(node, type) {3576 pp$2.finishNode = function(node, type) { 3559 3577 return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) 3560 3578 }; … … 3562 3580 // Finish node at given position 3563 3581 3564 pp$ 7.finishNodeAt = function(node, type, pos, loc) {3582 pp$2.finishNodeAt = function(node, type, pos, loc) { 3565 3583 return finishNodeAt.call(this, node, type, pos, loc) 3566 3584 }; 3567 3585 3568 pp$ 7.copyNode = function(node) {3586 pp$2.copyNode = function(node) { 3569 3587 var newNode = new Node(this, node.start, this.startLoc); 3570 3588 for (var prop in node) { newNode[prop] = node[prop]; } … … 3623 3641 buildUnicodeData(12); 3624 3642 3625 var pp$ 8= Parser.prototype;3643 var pp$1 = Parser.prototype; 3626 3644 3627 3645 var RegExpValidationState = function RegExpValidationState(parser) { … … 3719 3737 }; 3720 3738 3721 function codePointToString (ch) {3739 function codePointToString$1(ch) { 3722 3740 if (ch <= 0xFFFF) { return String.fromCharCode(ch) } 3723 3741 ch -= 0x10000; … … 3731 3749 * @returns {void} 3732 3750 */ 3733 pp$ 8.validateRegExpFlags = function(state) {3751 pp$1.validateRegExpFlags = function(state) { 3734 3752 var validFlags = state.validFlags; 3735 3753 var flags = state.flags; … … 3752 3770 * @returns {void} 3753 3771 */ 3754 pp$ 8.validateRegExpPattern = function(state) {3772 pp$1.validateRegExpPattern = function(state) { 3755 3773 this.regexp_pattern(state); 3756 3774 … … 3767 3785 3768 3786 // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern 3769 pp$ 8.regexp_pattern = function(state) {3787 pp$1.regexp_pattern = function(state) { 3770 3788 state.pos = 0; 3771 3789 state.lastIntValue = 0; … … 3801 3819 3802 3820 // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction 3803 pp$ 8.regexp_disjunction = function(state) {3821 pp$1.regexp_disjunction = function(state) { 3804 3822 this.regexp_alternative(state); 3805 3823 while (state.eat(0x7C /* | */)) { … … 3817 3835 3818 3836 // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative 3819 pp$ 8.regexp_alternative = function(state) {3837 pp$1.regexp_alternative = function(state) { 3820 3838 while (state.pos < state.source.length && this.regexp_eatTerm(state)) 3821 3839 { } … … 3823 3841 3824 3842 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term 3825 pp$ 8.regexp_eatTerm = function(state) {3843 pp$1.regexp_eatTerm = function(state) { 3826 3844 if (this.regexp_eatAssertion(state)) { 3827 3845 // Handle `QuantifiableAssertion Quantifier` alternative. … … 3846 3864 3847 3865 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion 3848 pp$ 8.regexp_eatAssertion = function(state) {3866 pp$1.regexp_eatAssertion = function(state) { 3849 3867 var start = state.pos; 3850 3868 state.lastAssertionIsQuantifiable = false; … … 3884 3902 3885 3903 // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier 3886 pp$ 8.regexp_eatQuantifier = function(state, noError) {3904 pp$1.regexp_eatQuantifier = function(state, noError) { 3887 3905 if ( noError === void 0 ) noError = false; 3888 3906 … … 3895 3913 3896 3914 // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix 3897 pp$ 8.regexp_eatQuantifierPrefix = function(state, noError) {3915 pp$1.regexp_eatQuantifierPrefix = function(state, noError) { 3898 3916 return ( 3899 3917 state.eat(0x2A /* * */) || … … 3903 3921 ) 3904 3922 }; 3905 pp$ 8.regexp_eatBracedQuantifier = function(state, noError) {3923 pp$1.regexp_eatBracedQuantifier = function(state, noError) { 3906 3924 var start = state.pos; 3907 3925 if (state.eat(0x7B /* { */)) { … … 3929 3947 3930 3948 // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom 3931 pp$ 8.regexp_eatAtom = function(state) {3949 pp$1.regexp_eatAtom = function(state) { 3932 3950 return ( 3933 3951 this.regexp_eatPatternCharacters(state) || … … 3939 3957 ) 3940 3958 }; 3941 pp$ 8.regexp_eatReverseSolidusAtomEscape = function(state) {3959 pp$1.regexp_eatReverseSolidusAtomEscape = function(state) { 3942 3960 var start = state.pos; 3943 3961 if (state.eat(0x5C /* \ */)) { … … 3949 3967 return false 3950 3968 }; 3951 pp$ 8.regexp_eatUncapturingGroup = function(state) {3969 pp$1.regexp_eatUncapturingGroup = function(state) { 3952 3970 var start = state.pos; 3953 3971 if (state.eat(0x28 /* ( */)) { … … 3963 3981 return false 3964 3982 }; 3965 pp$ 8.regexp_eatCapturingGroup = function(state) {3983 pp$1.regexp_eatCapturingGroup = function(state) { 3966 3984 if (state.eat(0x28 /* ( */)) { 3967 3985 if (this.options.ecmaVersion >= 9) { … … 3981 3999 3982 4000 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom 3983 pp$ 8.regexp_eatExtendedAtom = function(state) {4001 pp$1.regexp_eatExtendedAtom = function(state) { 3984 4002 return ( 3985 4003 state.eat(0x2E /* . */) || … … 3994 4012 3995 4013 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier 3996 pp$ 8.regexp_eatInvalidBracedQuantifier = function(state) {4014 pp$1.regexp_eatInvalidBracedQuantifier = function(state) { 3997 4015 if (this.regexp_eatBracedQuantifier(state, true)) { 3998 4016 state.raise("Nothing to repeat"); … … 4002 4020 4003 4021 // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter 4004 pp$ 8.regexp_eatSyntaxCharacter = function(state) {4022 pp$1.regexp_eatSyntaxCharacter = function(state) { 4005 4023 var ch = state.current(); 4006 4024 if (isSyntaxCharacter(ch)) { … … 4024 4042 // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter 4025 4043 // But eat eager. 4026 pp$ 8.regexp_eatPatternCharacters = function(state) {4044 pp$1.regexp_eatPatternCharacters = function(state) { 4027 4045 var start = state.pos; 4028 4046 var ch = 0; … … 4034 4052 4035 4053 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter 4036 pp$ 8.regexp_eatExtendedPatternCharacter = function(state) {4054 pp$1.regexp_eatExtendedPatternCharacter = function(state) { 4037 4055 var ch = state.current(); 4038 4056 if ( … … 4055 4073 // [empty] 4056 4074 // `?` GroupName 4057 pp$ 8.regexp_groupSpecifier = function(state) {4075 pp$1.regexp_groupSpecifier = function(state) { 4058 4076 if (state.eat(0x3F /* ? */)) { 4059 4077 if (this.regexp_eatGroupName(state)) { … … 4071 4089 // `<` RegExpIdentifierName `>` 4072 4090 // Note: this updates `state.lastStringValue` property with the eaten name. 4073 pp$ 8.regexp_eatGroupName = function(state) {4091 pp$1.regexp_eatGroupName = function(state) { 4074 4092 state.lastStringValue = ""; 4075 4093 if (state.eat(0x3C /* < */)) { … … 4086 4104 // RegExpIdentifierName RegExpIdentifierPart 4087 4105 // Note: this updates `state.lastStringValue` property with the eaten name. 4088 pp$ 8.regexp_eatRegExpIdentifierName = function(state) {4106 pp$1.regexp_eatRegExpIdentifierName = function(state) { 4089 4107 state.lastStringValue = ""; 4090 4108 if (this.regexp_eatRegExpIdentifierStart(state)) { 4091 state.lastStringValue += codePointToString (state.lastIntValue);4109 state.lastStringValue += codePointToString$1(state.lastIntValue); 4092 4110 while (this.regexp_eatRegExpIdentifierPart(state)) { 4093 state.lastStringValue += codePointToString (state.lastIntValue);4111 state.lastStringValue += codePointToString$1(state.lastIntValue); 4094 4112 } 4095 4113 return true … … 4103 4121 // `_` 4104 4122 // `\` RegExpUnicodeEscapeSequence[+U] 4105 pp$ 8.regexp_eatRegExpIdentifierStart = function(state) {4123 pp$1.regexp_eatRegExpIdentifierStart = function(state) { 4106 4124 var start = state.pos; 4107 4125 var forceU = this.options.ecmaVersion >= 11; … … 4131 4149 // <ZWNJ> 4132 4150 // <ZWJ> 4133 pp$ 8.regexp_eatRegExpIdentifierPart = function(state) {4151 pp$1.regexp_eatRegExpIdentifierPart = function(state) { 4134 4152 var start = state.pos; 4135 4153 var forceU = this.options.ecmaVersion >= 11; … … 4153 4171 4154 4172 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape 4155 pp$ 8.regexp_eatAtomEscape = function(state) {4173 pp$1.regexp_eatAtomEscape = function(state) { 4156 4174 if ( 4157 4175 this.regexp_eatBackReference(state) || … … 4171 4189 return false 4172 4190 }; 4173 pp$ 8.regexp_eatBackReference = function(state) {4191 pp$1.regexp_eatBackReference = function(state) { 4174 4192 var start = state.pos; 4175 4193 if (this.regexp_eatDecimalEscape(state)) { … … 4189 4207 return false 4190 4208 }; 4191 pp$ 8.regexp_eatKGroupName = function(state) {4209 pp$1.regexp_eatKGroupName = function(state) { 4192 4210 if (state.eat(0x6B /* k */)) { 4193 4211 if (this.regexp_eatGroupName(state)) { … … 4201 4219 4202 4220 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape 4203 pp$ 8.regexp_eatCharacterEscape = function(state) {4221 pp$1.regexp_eatCharacterEscape = function(state) { 4204 4222 return ( 4205 4223 this.regexp_eatControlEscape(state) || … … 4212 4230 ) 4213 4231 }; 4214 pp$ 8.regexp_eatCControlLetter = function(state) {4232 pp$1.regexp_eatCControlLetter = function(state) { 4215 4233 var start = state.pos; 4216 4234 if (state.eat(0x63 /* c */)) { … … 4222 4240 return false 4223 4241 }; 4224 pp$ 8.regexp_eatZero = function(state) {4242 pp$1.regexp_eatZero = function(state) { 4225 4243 if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { 4226 4244 state.lastIntValue = 0; … … 4232 4250 4233 4251 // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape 4234 pp$ 8.regexp_eatControlEscape = function(state) {4252 pp$1.regexp_eatControlEscape = function(state) { 4235 4253 var ch = state.current(); 4236 4254 if (ch === 0x74 /* t */) { … … 4263 4281 4264 4282 // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter 4265 pp$ 8.regexp_eatControlLetter = function(state) {4283 pp$1.regexp_eatControlLetter = function(state) { 4266 4284 var ch = state.current(); 4267 4285 if (isControlLetter(ch)) { … … 4280 4298 4281 4299 // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence 4282 pp$ 8.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {4300 pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) { 4283 4301 if ( forceU === void 0 ) forceU = false; 4284 4302 … … 4325 4343 4326 4344 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape 4327 pp$ 8.regexp_eatIdentityEscape = function(state) {4345 pp$1.regexp_eatIdentityEscape = function(state) { 4328 4346 if (state.switchU) { 4329 4347 if (this.regexp_eatSyntaxCharacter(state)) { … … 4348 4366 4349 4367 // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape 4350 pp$ 8.regexp_eatDecimalEscape = function(state) {4368 pp$1.regexp_eatDecimalEscape = function(state) { 4351 4369 state.lastIntValue = 0; 4352 4370 var ch = state.current(); … … 4362 4380 4363 4381 // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape 4364 pp$ 8.regexp_eatCharacterClassEscape = function(state) {4382 pp$1.regexp_eatCharacterClassEscape = function(state) { 4365 4383 var ch = state.current(); 4366 4384 … … 4404 4422 // UnicodePropertyName `=` UnicodePropertyValue 4405 4423 // LoneUnicodePropertyNameOrValue 4406 pp$ 8.regexp_eatUnicodePropertyValueExpression = function(state) {4424 pp$1.regexp_eatUnicodePropertyValueExpression = function(state) { 4407 4425 var start = state.pos; 4408 4426 … … 4426 4444 return false 4427 4445 }; 4428 pp$ 8.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {4446 pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { 4429 4447 if (!has(state.unicodeProperties.nonBinary, name)) 4430 4448 { state.raise("Invalid property name"); } … … 4432 4450 { state.raise("Invalid property value"); } 4433 4451 }; 4434 pp$ 8.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {4452 pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { 4435 4453 if (!state.unicodeProperties.binary.test(nameOrValue)) 4436 4454 { state.raise("Invalid property name"); } … … 4439 4457 // UnicodePropertyName :: 4440 4458 // UnicodePropertyNameCharacters 4441 pp$ 8.regexp_eatUnicodePropertyName = function(state) {4459 pp$1.regexp_eatUnicodePropertyName = function(state) { 4442 4460 var ch = 0; 4443 4461 state.lastStringValue = ""; 4444 4462 while (isUnicodePropertyNameCharacter(ch = state.current())) { 4445 state.lastStringValue += codePointToString (ch);4463 state.lastStringValue += codePointToString$1(ch); 4446 4464 state.advance(); 4447 4465 } … … 4454 4472 // UnicodePropertyValue :: 4455 4473 // UnicodePropertyValueCharacters 4456 pp$ 8.regexp_eatUnicodePropertyValue = function(state) {4474 pp$1.regexp_eatUnicodePropertyValue = function(state) { 4457 4475 var ch = 0; 4458 4476 state.lastStringValue = ""; 4459 4477 while (isUnicodePropertyValueCharacter(ch = state.current())) { 4460 state.lastStringValue += codePointToString (ch);4478 state.lastStringValue += codePointToString$1(ch); 4461 4479 state.advance(); 4462 4480 } … … 4469 4487 // LoneUnicodePropertyNameOrValue :: 4470 4488 // UnicodePropertyValueCharacters 4471 pp$ 8.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {4489 pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { 4472 4490 return this.regexp_eatUnicodePropertyValue(state) 4473 4491 }; 4474 4492 4475 4493 // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass 4476 pp$ 8.regexp_eatCharacterClass = function(state) {4494 pp$1.regexp_eatCharacterClass = function(state) { 4477 4495 if (state.eat(0x5B /* [ */)) { 4478 4496 state.eat(0x5E /* ^ */); … … 4490 4508 // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges 4491 4509 // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash 4492 pp$ 8.regexp_classRanges = function(state) {4510 pp$1.regexp_classRanges = function(state) { 4493 4511 while (this.regexp_eatClassAtom(state)) { 4494 4512 var left = state.lastIntValue; … … 4507 4525 // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom 4508 4526 // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash 4509 pp$ 8.regexp_eatClassAtom = function(state) {4527 pp$1.regexp_eatClassAtom = function(state) { 4510 4528 var start = state.pos; 4511 4529 … … 4536 4554 4537 4555 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape 4538 pp$ 8.regexp_eatClassEscape = function(state) {4556 pp$1.regexp_eatClassEscape = function(state) { 4539 4557 var start = state.pos; 4540 4558 … … 4563 4581 4564 4582 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter 4565 pp$ 8.regexp_eatClassControlLetter = function(state) {4583 pp$1.regexp_eatClassControlLetter = function(state) { 4566 4584 var ch = state.current(); 4567 4585 if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { … … 4574 4592 4575 4593 // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence 4576 pp$ 8.regexp_eatHexEscapeSequence = function(state) {4594 pp$1.regexp_eatHexEscapeSequence = function(state) { 4577 4595 var start = state.pos; 4578 4596 if (state.eat(0x78 /* x */)) { … … 4589 4607 4590 4608 // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits 4591 pp$ 8.regexp_eatDecimalDigits = function(state) {4609 pp$1.regexp_eatDecimalDigits = function(state) { 4592 4610 var start = state.pos; 4593 4611 var ch = 0; … … 4604 4622 4605 4623 // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits 4606 pp$ 8.regexp_eatHexDigits = function(state) {4624 pp$1.regexp_eatHexDigits = function(state) { 4607 4625 var start = state.pos; 4608 4626 var ch = 0; … … 4633 4651 // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence 4634 4652 // Allows only 0-377(octal) i.e. 0-255(decimal). 4635 pp$ 8.regexp_eatLegacyOctalEscapeSequence = function(state) {4653 pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) { 4636 4654 if (this.regexp_eatOctalDigit(state)) { 4637 4655 var n1 = state.lastIntValue; … … 4652 4670 4653 4671 // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit 4654 pp$ 8.regexp_eatOctalDigit = function(state) {4672 pp$1.regexp_eatOctalDigit = function(state) { 4655 4673 var ch = state.current(); 4656 4674 if (isOctalDigit(ch)) { … … 4669 4687 // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit 4670 4688 // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence 4671 pp$ 8.regexp_eatFixedHexDigits = function(state, length) {4689 pp$1.regexp_eatFixedHexDigits = function(state, length) { 4672 4690 var start = state.pos; 4673 4691 state.lastIntValue = 0; … … 4701 4719 // ## Tokenizer 4702 4720 4703 var pp $9= Parser.prototype;4721 var pp = Parser.prototype; 4704 4722 4705 4723 // Move to the next token 4706 4724 4707 pp $9.next = function(ignoreEscapeSequenceInKeyword) {4725 pp.next = function(ignoreEscapeSequenceInKeyword) { 4708 4726 if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) 4709 4727 { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } … … 4718 4736 }; 4719 4737 4720 pp $9.getToken = function() {4738 pp.getToken = function() { 4721 4739 this.next(); 4722 4740 return new Token(this) … … 4725 4743 // If we're in an ES6 environment, make parsers iterable 4726 4744 if (typeof Symbol !== "undefined") 4727 { pp $9[Symbol.iterator] = function() {4728 var this$1 = this;4745 { pp[Symbol.iterator] = function() { 4746 var this$1$1 = this; 4729 4747 4730 4748 return { 4731 4749 next: function () { 4732 var token = this$1 .getToken();4750 var token = this$1$1.getToken(); 4733 4751 return { 4734 done: token.type === types .eof,4752 done: token.type === types$1.eof, 4735 4753 value: token 4736 4754 } … … 4745 4763 // properties. 4746 4764 4747 pp $9.nextToken = function() {4765 pp.nextToken = function() { 4748 4766 var curContext = this.curContext(); 4749 4767 if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } … … 4751 4769 this.start = this.pos; 4752 4770 if (this.options.locations) { this.startLoc = this.curPosition(); } 4753 if (this.pos >= this.input.length) { return this.finishToken(types .eof) }4771 if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) } 4754 4772 4755 4773 if (curContext.override) { return curContext.override(this) } … … 4757 4775 }; 4758 4776 4759 pp $9.readToken = function(code) {4777 pp.readToken = function(code) { 4760 4778 // Identifier or keyword. '\uXXXX' sequences are allowed in 4761 4779 // identifiers, so '\' also dispatches to that. … … 4766 4784 }; 4767 4785 4768 pp $9.fullCharCodeAtPos = function() {4786 pp.fullCharCodeAtPos = function() { 4769 4787 var code = this.input.charCodeAt(this.pos); 4770 4788 if (code <= 0xd7ff || code >= 0xdc00) { return code } … … 4773 4791 }; 4774 4792 4775 pp $9.skipBlockComment = function() {4793 pp.skipBlockComment = function() { 4776 4794 var startLoc = this.options.onComment && this.curPosition(); 4777 4795 var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); … … 4791 4809 }; 4792 4810 4793 pp $9.skipLineComment = function(startSkip) {4811 pp.skipLineComment = function(startSkip) { 4794 4812 var start = this.pos; 4795 4813 var startLoc = this.options.onComment && this.curPosition(); … … 4806 4824 // whitespace and comments, and. 4807 4825 4808 pp $9.skipSpace = function() {4826 pp.skipSpace = function() { 4809 4827 loop: while (this.pos < this.input.length) { 4810 4828 var ch = this.input.charCodeAt(this.pos); … … 4851 4869 // right position. 4852 4870 4853 pp $9.finishToken = function(type, val) {4871 pp.finishToken = function(type, val) { 4854 4872 this.end = this.pos; 4855 4873 if (this.options.locations) { this.endLoc = this.curPosition(); } … … 4870 4888 // All in the name of speed. 4871 4889 // 4872 pp $9.readToken_dot = function() {4890 pp.readToken_dot = function() { 4873 4891 var next = this.input.charCodeAt(this.pos + 1); 4874 4892 if (next >= 48 && next <= 57) { return this.readNumber(true) } … … 4876 4894 if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' 4877 4895 this.pos += 3; 4878 return this.finishToken(types .ellipsis)4896 return this.finishToken(types$1.ellipsis) 4879 4897 } else { 4880 4898 ++this.pos; 4881 return this.finishToken(types .dot)4882 } 4883 }; 4884 4885 pp $9.readToken_slash = function() { // '/'4899 return this.finishToken(types$1.dot) 4900 } 4901 }; 4902 4903 pp.readToken_slash = function() { // '/' 4886 4904 var next = this.input.charCodeAt(this.pos + 1); 4887 4905 if (this.exprAllowed) { ++this.pos; return this.readRegexp() } 4888 if (next === 61) { return this.finishOp(types .assign, 2) }4889 return this.finishOp(types .slash, 1)4890 }; 4891 4892 pp $9.readToken_mult_modulo_exp = function(code) { // '%*'4906 if (next === 61) { return this.finishOp(types$1.assign, 2) } 4907 return this.finishOp(types$1.slash, 1) 4908 }; 4909 4910 pp.readToken_mult_modulo_exp = function(code) { // '%*' 4893 4911 var next = this.input.charCodeAt(this.pos + 1); 4894 4912 var size = 1; 4895 var tokentype = code === 42 ? types .star : types.modulo;4913 var tokentype = code === 42 ? types$1.star : types$1.modulo; 4896 4914 4897 4915 // exponentiation operator ** and **= 4898 4916 if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) { 4899 4917 ++size; 4900 tokentype = types .starstar;4918 tokentype = types$1.starstar; 4901 4919 next = this.input.charCodeAt(this.pos + 2); 4902 4920 } 4903 4921 4904 if (next === 61) { return this.finishOp(types .assign, size + 1) }4922 if (next === 61) { return this.finishOp(types$1.assign, size + 1) } 4905 4923 return this.finishOp(tokentype, size) 4906 4924 }; 4907 4925 4908 pp $9.readToken_pipe_amp = function(code) { // '|&'4926 pp.readToken_pipe_amp = function(code) { // '|&' 4909 4927 var next = this.input.charCodeAt(this.pos + 1); 4910 4928 if (next === code) { 4911 4929 if (this.options.ecmaVersion >= 12) { 4912 4930 var next2 = this.input.charCodeAt(this.pos + 2); 4913 if (next2 === 61) { return this.finishOp(types .assign, 3) }4914 } 4915 return this.finishOp(code === 124 ? types .logicalOR : types.logicalAND, 2)4916 } 4917 if (next === 61) { return this.finishOp(types .assign, 2) }4918 return this.finishOp(code === 124 ? types .bitwiseOR : types.bitwiseAND, 1)4919 }; 4920 4921 pp $9.readToken_caret = function() { // '^'4931 if (next2 === 61) { return this.finishOp(types$1.assign, 3) } 4932 } 4933 return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2) 4934 } 4935 if (next === 61) { return this.finishOp(types$1.assign, 2) } 4936 return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1) 4937 }; 4938 4939 pp.readToken_caret = function() { // '^' 4922 4940 var next = this.input.charCodeAt(this.pos + 1); 4923 if (next === 61) { return this.finishOp(types .assign, 2) }4924 return this.finishOp(types .bitwiseXOR, 1)4925 }; 4926 4927 pp $9.readToken_plus_min = function(code) { // '+-'4941 if (next === 61) { return this.finishOp(types$1.assign, 2) } 4942 return this.finishOp(types$1.bitwiseXOR, 1) 4943 }; 4944 4945 pp.readToken_plus_min = function(code) { // '+-' 4928 4946 var next = this.input.charCodeAt(this.pos + 1); 4929 4947 if (next === code) { … … 4935 4953 return this.nextToken() 4936 4954 } 4937 return this.finishOp(types .incDec, 2)4938 } 4939 if (next === 61) { return this.finishOp(types .assign, 2) }4940 return this.finishOp(types .plusMin, 1)4941 }; 4942 4943 pp $9.readToken_lt_gt = function(code) { // '<>'4955 return this.finishOp(types$1.incDec, 2) 4956 } 4957 if (next === 61) { return this.finishOp(types$1.assign, 2) } 4958 return this.finishOp(types$1.plusMin, 1) 4959 }; 4960 4961 pp.readToken_lt_gt = function(code) { // '<>' 4944 4962 var next = this.input.charCodeAt(this.pos + 1); 4945 4963 var size = 1; 4946 4964 if (next === code) { 4947 4965 size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; 4948 if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types .assign, size + 1) }4949 return this.finishOp(types .bitShift, size)4966 if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) } 4967 return this.finishOp(types$1.bitShift, size) 4950 4968 } 4951 4969 if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && … … 4957 4975 } 4958 4976 if (next === 61) { size = 2; } 4959 return this.finishOp(types .relational, size)4960 }; 4961 4962 pp $9.readToken_eq_excl = function(code) { // '=!'4977 return this.finishOp(types$1.relational, size) 4978 }; 4979 4980 pp.readToken_eq_excl = function(code) { // '=!' 4963 4981 var next = this.input.charCodeAt(this.pos + 1); 4964 if (next === 61) { return this.finishOp(types .equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }4982 if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } 4965 4983 if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>' 4966 4984 this.pos += 2; 4967 return this.finishToken(types .arrow)4968 } 4969 return this.finishOp(code === 61 ? types .eq : types.prefix, 1)4970 }; 4971 4972 pp $9.readToken_question = function() { // '?'4985 return this.finishToken(types$1.arrow) 4986 } 4987 return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1) 4988 }; 4989 4990 pp.readToken_question = function() { // '?' 4973 4991 var ecmaVersion = this.options.ecmaVersion; 4974 4992 if (ecmaVersion >= 11) { … … 4976 4994 if (next === 46) { 4977 4995 var next2 = this.input.charCodeAt(this.pos + 2); 4978 if (next2 < 48 || next2 > 57) { return this.finishOp(types .questionDot, 2) }4996 if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) } 4979 4997 } 4980 4998 if (next === 63) { 4981 4999 if (ecmaVersion >= 12) { 4982 5000 var next2$1 = this.input.charCodeAt(this.pos + 2); 4983 if (next2$1 === 61) { return this.finishOp(types .assign, 3) }5001 if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) } 4984 5002 } 4985 return this.finishOp(types .coalesce, 2)4986 } 4987 } 4988 return this.finishOp(types .question, 1)4989 }; 4990 4991 pp $9.readToken_numberSign = function() { // '#'5003 return this.finishOp(types$1.coalesce, 2) 5004 } 5005 } 5006 return this.finishOp(types$1.question, 1) 5007 }; 5008 5009 pp.readToken_numberSign = function() { // '#' 4992 5010 var ecmaVersion = this.options.ecmaVersion; 4993 5011 var code = 35; // '#' … … 4996 5014 code = this.fullCharCodeAtPos(); 4997 5015 if (isIdentifierStart(code, true) || code === 92 /* '\' */) { 4998 return this.finishToken(types .privateId, this.readWord1())4999 } 5000 } 5001 5002 this.raise(this.pos, "Unexpected character '" + codePointToString $1(code) + "'");5003 }; 5004 5005 pp $9.getTokenFromCode = function(code) {5016 return this.finishToken(types$1.privateId, this.readWord1()) 5017 } 5018 } 5019 5020 this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); 5021 }; 5022 5023 pp.getTokenFromCode = function(code) { 5006 5024 switch (code) { 5007 5025 // The interpretation of a dot depends on whether it is followed … … 5011 5029 5012 5030 // Punctuation tokens. 5013 case 40: ++this.pos; return this.finishToken(types .parenL)5014 case 41: ++this.pos; return this.finishToken(types .parenR)5015 case 59: ++this.pos; return this.finishToken(types .semi)5016 case 44: ++this.pos; return this.finishToken(types .comma)5017 case 91: ++this.pos; return this.finishToken(types .bracketL)5018 case 93: ++this.pos; return this.finishToken(types .bracketR)5019 case 123: ++this.pos; return this.finishToken(types .braceL)5020 case 125: ++this.pos; return this.finishToken(types .braceR)5021 case 58: ++this.pos; return this.finishToken(types .colon)5031 case 40: ++this.pos; return this.finishToken(types$1.parenL) 5032 case 41: ++this.pos; return this.finishToken(types$1.parenR) 5033 case 59: ++this.pos; return this.finishToken(types$1.semi) 5034 case 44: ++this.pos; return this.finishToken(types$1.comma) 5035 case 91: ++this.pos; return this.finishToken(types$1.bracketL) 5036 case 93: ++this.pos; return this.finishToken(types$1.bracketR) 5037 case 123: ++this.pos; return this.finishToken(types$1.braceL) 5038 case 125: ++this.pos; return this.finishToken(types$1.braceR) 5039 case 58: ++this.pos; return this.finishToken(types$1.colon) 5022 5040 5023 5041 case 96: // '`' 5024 5042 if (this.options.ecmaVersion < 6) { break } 5025 5043 ++this.pos; 5026 return this.finishToken(types .backQuote)5044 return this.finishToken(types$1.backQuote) 5027 5045 5028 5046 case 48: // '0' … … 5047 5065 // characters it is given as second argument, and returns a token 5048 5066 // of the type given by its first argument. 5049 5050 5067 case 47: // '/' 5051 5068 return this.readToken_slash() … … 5073 5090 5074 5091 case 126: // '~' 5075 return this.finishOp(types .prefix, 1)5092 return this.finishOp(types$1.prefix, 1) 5076 5093 5077 5094 case 35: // '#' … … 5079 5096 } 5080 5097 5081 this.raise(this.pos, "Unexpected character '" + codePointToString $1(code) + "'");5082 }; 5083 5084 pp $9.finishOp = function(type, size) {5098 this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); 5099 }; 5100 5101 pp.finishOp = function(type, size) { 5085 5102 var str = this.input.slice(this.pos, this.pos + size); 5086 5103 this.pos += size; … … 5088 5105 }; 5089 5106 5090 pp $9.readRegexp = function() {5107 pp.readRegexp = function() { 5091 5108 var escaped, inClass, start = this.pos; 5092 5109 for (;;) { … … 5123 5140 } 5124 5141 5125 return this.finishToken(types .regexp, {pattern: pattern, flags: flags, value: value})5142 return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value}) 5126 5143 }; 5127 5144 … … 5130 5147 // will return `null` unless the integer has exactly `len` digits. 5131 5148 5132 pp $9.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {5149 pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) { 5133 5150 // `len` is used for character escape sequences. In that case, disallow separators. 5134 5151 var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined; … … 5184 5201 } 5185 5202 5186 pp $9.readRadixNumber = function(radix) {5203 pp.readRadixNumber = function(radix) { 5187 5204 var start = this.pos; 5188 5205 this.pos += 2; // 0x … … 5193 5210 ++this.pos; 5194 5211 } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } 5195 return this.finishToken(types .num, val)5212 return this.finishToken(types$1.num, val) 5196 5213 }; 5197 5214 5198 5215 // Read an integer, octal integer, or floating-point number. 5199 5216 5200 pp $9.readNumber = function(startsWithDot) {5217 pp.readNumber = function(startsWithDot) { 5201 5218 var start = this.pos; 5202 5219 if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); } … … 5208 5225 ++this.pos; 5209 5226 if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } 5210 return this.finishToken(types .num, val$1)5227 return this.finishToken(types$1.num, val$1) 5211 5228 } 5212 5229 if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; } … … 5224 5241 5225 5242 var val = stringToNumber(this.input.slice(start, this.pos), octal); 5226 return this.finishToken(types .num, val)5243 return this.finishToken(types$1.num, val) 5227 5244 }; 5228 5245 5229 5246 // Read a string value, interpreting backslash-escapes. 5230 5247 5231 pp $9.readCodePoint = function() {5248 pp.readCodePoint = function() { 5232 5249 var ch = this.input.charCodeAt(this.pos), code; 5233 5250 … … 5244 5261 }; 5245 5262 5246 function codePointToString $1(code) {5263 function codePointToString(code) { 5247 5264 // UTF-16 Decoding 5248 5265 if (code <= 0xFFFF) { return String.fromCharCode(code) } … … 5251 5268 } 5252 5269 5253 pp $9.readString = function(quote) {5270 pp.readString = function(quote) { 5254 5271 var out = "", chunkStart = ++this.pos; 5255 5272 for (;;) { … … 5274 5291 } 5275 5292 out += this.input.slice(chunkStart, this.pos++); 5276 return this.finishToken(types .string, out)5293 return this.finishToken(types$1.string, out) 5277 5294 }; 5278 5295 … … 5281 5298 var INVALID_TEMPLATE_ESCAPE_ERROR = {}; 5282 5299 5283 pp $9.tryReadTemplateToken = function() {5300 pp.tryReadTemplateToken = function() { 5284 5301 this.inTemplateElement = true; 5285 5302 try { … … 5296 5313 }; 5297 5314 5298 pp $9.invalidStringToken = function(position, message) {5315 pp.invalidStringToken = function(position, message) { 5299 5316 if (this.inTemplateElement && this.options.ecmaVersion >= 9) { 5300 5317 throw INVALID_TEMPLATE_ESCAPE_ERROR … … 5304 5321 }; 5305 5322 5306 pp $9.readTmplToken = function() {5323 pp.readTmplToken = function() { 5307 5324 var out = "", chunkStart = this.pos; 5308 5325 for (;;) { … … 5310 5327 var ch = this.input.charCodeAt(this.pos); 5311 5328 if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${' 5312 if (this.pos === this.start && (this.type === types .template || this.type === types.invalidTemplate)) {5329 if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) { 5313 5330 if (ch === 36) { 5314 5331 this.pos += 2; 5315 return this.finishToken(types .dollarBraceL)5332 return this.finishToken(types$1.dollarBraceL) 5316 5333 } else { 5317 5334 ++this.pos; 5318 return this.finishToken(types .backQuote)5335 return this.finishToken(types$1.backQuote) 5319 5336 } 5320 5337 } 5321 5338 out += this.input.slice(chunkStart, this.pos); 5322 return this.finishToken(types .template, out)5339 return this.finishToken(types$1.template, out) 5323 5340 } 5324 5341 if (ch === 92) { // '\' … … 5351 5368 5352 5369 // Reads a template token to search for the end, without validating any escape sequences 5353 pp $9.readInvalidTemplateToken = function() {5370 pp.readInvalidTemplateToken = function() { 5354 5371 for (; this.pos < this.input.length; this.pos++) { 5355 5372 switch (this.input[this.pos]) { … … 5362 5379 break 5363 5380 } 5381 5364 5382 // falls through 5365 5366 5383 case "`": 5367 return this.finishToken(types .invalidTemplate, this.input.slice(this.start, this.pos))5384 return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos)) 5368 5385 5369 5386 // no default … … 5375 5392 // Used to read escaped characters 5376 5393 5377 pp $9.readEscapedChar = function(inTemplate) {5394 pp.readEscapedChar = function(inTemplate) { 5378 5395 var ch = this.input.charCodeAt(++this.pos); 5379 5396 ++this.pos; … … 5382 5399 case 114: return "\r" // 'r' -> '\r' 5383 5400 case 120: return String.fromCharCode(this.readHexChar(2)) // 'x' 5384 case 117: return codePointToString $1(this.readCodePoint()) // 'u'5401 case 117: return codePointToString(this.readCodePoint()) // 'u' 5385 5402 case 116: return "\t" // 't' -> '\t' 5386 5403 case 98: return "\b" // 'b' -> '\b' … … 5440 5457 // Used to read character escape sequences ('\x', '\u', '\U'). 5441 5458 5442 pp $9.readHexChar = function(len) {5459 pp.readHexChar = function(len) { 5443 5460 var codePos = this.pos; 5444 5461 var n = this.readInt(16, len); … … 5453 5470 // as a micro-optimization. 5454 5471 5455 pp $9.readWord1 = function() {5472 pp.readWord1 = function() { 5456 5473 this.containsEsc = false; 5457 5474 var word = "", first = true, chunkStart = this.pos; … … 5471 5488 if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) 5472 5489 { this.invalidStringToken(escStart, "Invalid Unicode escape"); } 5473 word += codePointToString $1(esc);5490 word += codePointToString(esc); 5474 5491 chunkStart = this.pos; 5475 5492 } else { … … 5484 5501 // words when necessary. 5485 5502 5486 pp $9.readWord = function() {5503 pp.readWord = function() { 5487 5504 var word = this.readWord1(); 5488 var type = types .name;5505 var type = types$1.name; 5489 5506 if (this.keywords.test(word)) { 5490 type = keywords $1[word];5507 type = keywords[word]; 5491 5508 } 5492 5509 return this.finishToken(type, word) … … 5495 5512 // Acorn is a tiny, fast JavaScript parser written in JavaScript. 5496 5513 5497 var version = "8. 5.0";5514 var version = "8.6.0"; 5498 5515 5499 5516 Parser.acorn = { … … 5506 5523 Node: Node, 5507 5524 TokenType: TokenType, 5508 tokTypes: types ,5509 keywordTypes: keywords $1,5525 tokTypes: types$1, 5526 keywordTypes: keywords, 5510 5527 TokContext: TokContext, 5511 tokContexts: types $1,5528 tokContexts: types, 5512 5529 isIdentifierChar: isIdentifierChar, 5513 5530 isIdentifierStart: isIdentifierStart, … … 5557 5574 exports.isIdentifierStart = isIdentifierStart; 5558 5575 exports.isNewLine = isNewLine; 5559 exports.keywordTypes = keywords $1;5576 exports.keywordTypes = keywords; 5560 5577 exports.lineBreak = lineBreak; 5561 5578 exports.lineBreakG = lineBreakG; … … 5563 5580 exports.parse = parse; 5564 5581 exports.parseExpressionAt = parseExpressionAt; 5565 exports.tokContexts = types $1;5566 exports.tokTypes = types ;5582 exports.tokContexts = types; 5583 exports.tokTypes = types$1; 5567 5584 exports.tokenizer = tokenizer; 5568 5585 exports.version = version; … … 5570 5587 Object.defineProperty(exports, '__esModule', { value: true }); 5571 5588 5572 })) );5589 })); -
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 }; -
trip-planner-front/node_modules/acorn/dist/bin.js
r59329aa re29cc2e 4 4 var fs = require('fs'); 5 5 var acorn = require('./acorn.js'); 6 7 function _interopNamespace(e) { 8 if (e && e.__esModule) return e; 9 var n = Object.create(null); 10 if (e) { 11 Object.keys(e).forEach(function (k) { 12 if (k !== 'default') { 13 var d = Object.getOwnPropertyDescriptor(e, k); 14 Object.defineProperty(n, k, d.get ? d : { 15 enumerable: true, 16 get: function () { return e[k]; } 17 }); 18 } 19 }); 20 } 21 n["default"] = e; 22 return Object.freeze(n); 23 } 24 25 var acorn__namespace = /*#__PURE__*/_interopNamespace(acorn); 6 26 7 27 var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false; … … 45 65 fileIdx = idx; 46 66 if (!tokenize) { 47 result = acorn .parse(code, options);67 result = acorn__namespace.parse(code, options); 48 68 options.program = result; 49 69 } else { 50 var tokenizer = acorn .tokenizer(code, options), token;70 var tokenizer = acorn__namespace.tokenizer(code, options), token; 51 71 do { 52 72 token = tokenizer.getToken(); 53 73 result.push(token); 54 } while (token.type !== acorn .tokTypes.eof)74 } while (token.type !== acorn__namespace.tokTypes.eof) 55 75 } 56 76 });
Note:
See TracChangeset
for help on using the changeset viewer.