|
4 | 4 | *
|
5 | 5 | * GPU Accelerated JavaScript
|
6 | 6 | *
|
7 |
| - * @version 2.6.10 |
8 |
| - * @date Mon Mar 09 2020 05:45:42 GMT-0400 (Eastern Daylight Time) |
| 7 | + * @version 2.6.11 |
| 8 | + * @date Mon Mar 09 2020 05:48:54 GMT-0400 (Eastern Daylight Time) |
9 | 9 | *
|
10 | 10 | * @license MIT
|
11 | 11 | * The MIT License
|
|
1618 | 1618 | if (this.options.ecmaVersion >= 6) {
|
1619 | 1619 | if (name === "__proto__" && kind === "init") {
|
1620 | 1620 | if (propHash.proto) {
|
1621 |
| - if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; } |
1622 |
| - else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } |
| 1621 | + if (refDestructuringErrors) { |
| 1622 | + if (refDestructuringErrors.doubleProto < 0) |
| 1623 | + { refDestructuringErrors.doubleProto = key.start; } |
| 1624 | + } else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } |
1623 | 1625 | }
|
1624 | 1626 | propHash.proto = true;
|
1625 | 1627 | }
|
|
1668 | 1670 | else { this.exprAllowed = false; }
|
1669 | 1671 | }
|
1670 | 1672 |
|
1671 |
| - var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldShorthandAssign = -1; |
| 1673 | + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; |
1672 | 1674 | if (refDestructuringErrors) {
|
1673 | 1675 | oldParenAssign = refDestructuringErrors.parenthesizedAssign;
|
1674 | 1676 | oldTrailingComma = refDestructuringErrors.trailingComma;
|
1675 |
| - oldShorthandAssign = refDestructuringErrors.shorthandAssign; |
1676 |
| - refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.shorthandAssign = -1; |
| 1677 | + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; |
1677 | 1678 | } else {
|
1678 | 1679 | refDestructuringErrors = new DestructuringErrors;
|
1679 | 1680 | ownDestructuringErrors = true;
|
|
1688 | 1689 | var node = this.startNodeAt(startPos, startLoc);
|
1689 | 1690 | node.operator = this.value;
|
1690 | 1691 | node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left;
|
1691 |
| - if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); } |
1692 |
| - refDestructuringErrors.shorthandAssign = -1; |
| 1692 | + if (!ownDestructuringErrors) { |
| 1693 | + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1; |
| 1694 | + } |
| 1695 | + if (refDestructuringErrors.shorthandAssign >= node.left.start) |
| 1696 | + { refDestructuringErrors.shorthandAssign = -1; } |
1693 | 1697 | this.checkLVal(left);
|
1694 | 1698 | this.next();
|
1695 | 1699 | node.right = this.parseMaybeAssign(noIn);
|
|
1699 | 1703 | }
|
1700 | 1704 | if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
|
1701 | 1705 | if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
|
1702 |
| - if (oldShorthandAssign > -1) { refDestructuringErrors.shorthandAssign = oldShorthandAssign; } |
1703 | 1706 | return left
|
1704 | 1707 | };
|
1705 | 1708 |
|
|
1795 | 1798 | pp$3.parseExprSubscripts = function(refDestructuringErrors) {
|
1796 | 1799 | var startPos = this.start, startLoc = this.startLoc;
|
1797 | 1800 | var expr = this.parseExprAtom(refDestructuringErrors);
|
1798 |
| - var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; |
1799 |
| - if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr } |
| 1801 | + if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") |
| 1802 | + { return expr } |
1800 | 1803 | var result = this.parseSubscripts(expr, startPos, startLoc);
|
1801 | 1804 | if (refDestructuringErrors && result.type === "MemberExpression") {
|
1802 | 1805 | if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
|
|
2074 | 2077 | var empty$1 = [];
|
2075 | 2078 |
|
2076 | 2079 | pp$3.parseNew = function() {
|
| 2080 | + if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); } |
2077 | 2081 | var node = this.startNode();
|
2078 | 2082 | var meta = this.parseIdent(true);
|
2079 | 2083 | if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) {
|
|
2442 | 2446 | } else {
|
2443 | 2447 | this.unexpected();
|
2444 | 2448 | }
|
2445 |
| - this.next(); |
| 2449 | + this.next(!!liberal); |
2446 | 2450 | this.finishNode(node, "Identifier");
|
2447 | 2451 | if (!liberal) {
|
2448 | 2452 | this.checkUnreserved(node);
|
|
2473 | 2477 |
|
2474 | 2478 | var node = this.startNode();
|
2475 | 2479 | this.next();
|
2476 |
| - node.argument = this.parseMaybeUnary(null, true); |
| 2480 | + node.argument = this.parseMaybeUnary(null, false); |
2477 | 2481 | return this.finishNode(node, "AwaitExpression")
|
2478 | 2482 | };
|
2479 | 2483 |
|
|
2841 | 2845 | if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
|
2842 | 2846 | return c
|
2843 | 2847 | }
|
2844 |
| - return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00 |
| 2848 | + var next = s.charCodeAt(i + 1); |
| 2849 | + return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c |
2845 | 2850 | };
|
2846 | 2851 |
|
2847 | 2852 | RegExpValidationState.prototype.nextIndex = function nextIndex (i) {
|
|
2850 | 2855 | if (i >= l) {
|
2851 | 2856 | return l
|
2852 | 2857 | }
|
2853 |
| - var c = s.charCodeAt(i); |
2854 |
| - if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { |
| 2858 | + var c = s.charCodeAt(i), next; |
| 2859 | + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l || |
| 2860 | + (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) { |
2855 | 2861 | return i + 1
|
2856 | 2862 | }
|
2857 | 2863 | return i + 2
|
|
3750 | 3756 | var pp$9 = Parser.prototype;
|
3751 | 3757 |
|
3752 | 3758 |
|
3753 |
| - pp$9.next = function() { |
| 3759 | + pp$9.next = function(ignoreEscapeSequenceInKeyword) { |
| 3760 | + if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc) |
| 3761 | + { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); } |
3754 | 3762 | if (this.options.onToken)
|
3755 | 3763 | { this.options.onToken(new Token(this)); }
|
3756 | 3764 |
|
|
4127 | 4135 | if (!startsWithDot && this.readInt(10) === null) { this.raise(start, "Invalid number"); }
|
4128 | 4136 | var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
|
4129 | 4137 | if (octal && this.strict) { this.raise(start, "Invalid number"); }
|
4130 |
| - if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; } |
4131 | 4138 | var next = this.input.charCodeAt(this.pos);
|
4132 | 4139 | if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
|
4133 | 4140 | var str$1 = this.input.slice(start, this.pos);
|
|
4136 | 4143 | if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
|
4137 | 4144 | return this.finishToken(types.num, val$1)
|
4138 | 4145 | }
|
| 4146 | + if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; } |
4139 | 4147 | if (next === 46 && !octal) {
|
4140 | 4148 | ++this.pos;
|
4141 | 4149 | this.readInt(10);
|
|
4303 | 4311 | case 10:
|
4304 | 4312 | if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
|
4305 | 4313 | return ""
|
| 4314 | + case 56: |
| 4315 | + case 57: |
| 4316 | + if (inTemplate) { |
| 4317 | + var codePos = this.pos - 1; |
| 4318 | + |
| 4319 | + this.invalidStringToken( |
| 4320 | + codePos, |
| 4321 | + "Invalid escape sequence in template string" |
| 4322 | + ); |
| 4323 | + |
| 4324 | + return null |
| 4325 | + } |
4306 | 4326 | default:
|
4307 | 4327 | if (ch >= 48 && ch <= 55) {
|
4308 | 4328 | var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
|
|
4372 | 4392 | var word = this.readWord1();
|
4373 | 4393 | var type = types.name;
|
4374 | 4394 | if (this.keywords.test(word)) {
|
4375 |
| - if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + word); } |
4376 | 4395 | type = keywords$1[word];
|
4377 | 4396 | }
|
4378 | 4397 | return this.finishToken(type, word)
|
|
0 commit comments