From 5e07de2db4041e02a278011b162dcdd25f3af7b2 Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Mon, 12 Sep 2016 18:44:02 +0300 Subject: [PATCH] Rephrase "assigning/binding to rvalue" error messages with context (#119) --- src/parser/expression.js | 14 ++++----- src/parser/lval.js | 31 ++++++++++--------- src/parser/statement.js | 15 ++++----- src/plugins/flow.js | 10 +++--- .../core/uncategorised/367/options.json | 2 +- .../core/uncategorised/368/options.json | 2 +- .../core/uncategorised/369/options.json | 2 +- .../core/uncategorised/370/options.json | 2 +- .../core/uncategorised/371/options.json | 2 +- .../core/uncategorised/372/options.json | 2 +- .../core/uncategorised/373/options.json | 2 +- .../core/uncategorised/374/options.json | 2 +- .../core/uncategorised/383/options.json | 2 +- .../core/uncategorised/384/options.json | 2 +- .../core/uncategorised/417/options.json | 2 +- .../core/uncategorised/418/options.json | 2 +- .../es2015/uncategorised/220/options.json | 2 +- .../es2015/uncategorised/221/options.json | 2 +- .../es2015/uncategorised/222/options.json | 2 +- .../es2015/uncategorised/251/options.json | 2 +- .../es2015/uncategorised/252/options.json | 2 +- .../es2015/uncategorised/284/options.json | 2 +- .../es2015/uncategorised/288/options.json | 2 +- .../es2015/uncategorised/37/options.json | 2 +- .../invalid-lhs-01/options.json | 2 +- .../invalid-lhs-02/options.json | 2 +- .../invalid-group-assignment/options.json | 2 +- .../invalid-lhs-init/options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../invalid-syntax/migrated_0045/options.json | 2 +- .../invalid-syntax/migrated_0046/options.json | 2 +- .../invalid-syntax/migrated_0047/options.json | 2 +- .../invalid-syntax/migrated_0052/options.json | 2 +- .../invalid-syntax/migrated_0053/options.json | 2 +- .../invalid-syntax/migrated_0054/options.json | 2 +- .../invalid-syntax/migrated_0055/options.json | 2 +- .../invalid-syntax/migrated_0056/options.json | 2 +- .../invalid-syntax/migrated_0066/options.json | 2 +- .../invalid-syntax/migrated_0067/options.json | 2 +- .../invalid-syntax/migrated_0098/options.json | 2 +- .../invalid-syntax/migrated_0099/options.json | 2 +- .../invalid-syntax/migrated_0125/options.json | 2 +- .../invalid-syntax/migrated_0126/options.json | 2 +- 44 files changed, 77 insertions(+), 73 deletions(-) diff --git a/src/parser/expression.js b/src/parser/expression.js index 6159d306f6..cf68e6c241 100644 --- a/src/parser/expression.js +++ b/src/parser/expression.js @@ -113,10 +113,10 @@ pp.parseMaybeAssign = function (noIn, refShorthandDefaultPos, afterLeftParse, re if (this.state.type.isAssign) { let node = this.startNodeAt(startPos, startLoc); node.operator = this.state.value; - node.left = this.match(tt.eq) ? this.toAssignable(left) : left; + node.left = this.match(tt.eq) ? this.toAssignable(left, undefined, "assignment expression") : left; refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly - this.checkLVal(left); + this.checkLVal(left, undefined, undefined, "assignment expression"); if (left.extra && left.extra.parenthesized) { let errorMsg; @@ -232,7 +232,7 @@ pp.parseMaybeUnary = function (refShorthandDefaultPos) { } if (update) { - this.checkLVal(node.argument); + this.checkLVal(node.argument, undefined, undefined, "prefix operation"); } else if (this.state.strict && node.operator === "delete" && node.argument.type === "Identifier") { this.raise(node.start, "Deleting local variable in strict mode"); } @@ -248,7 +248,7 @@ pp.parseMaybeUnary = function (refShorthandDefaultPos) { node.operator = this.state.value; node.prefix = false; node.argument = expr; - this.checkLVal(expr); + this.checkLVal(expr, undefined, undefined, "postfix operation"); this.next(); expr = this.finishNode(node, "UpdateExpression"); } @@ -855,7 +855,7 @@ pp.parseMethod = function (node, isGenerator, isAsync) { pp.parseArrowExpression = function (node, params, isAsync) { this.initFunction(node, isAsync); - node.params = this.toAssignableList(params, true); + node.params = this.toAssignableList(params, true, "arrow function parameters"); this.parseFunctionBody(node, true); return this.finishNode(node, "ArrowFunctionExpression"); }; @@ -911,13 +911,13 @@ pp.parseFunctionBody = function (node, allowExpression) { let oldStrict = this.state.strict; if (isStrict) this.state.strict = true; if (node.id) { - this.checkLVal(node.id, true); + this.checkLVal(node.id, true, undefined, "function name"); } for (let param of (node.params: Array)) { if (isStrict && param.type !== "Identifier") { this.raise(param.start, "Non-simple parameter in strict mode"); } - this.checkLVal(param, true, nameHash); + this.checkLVal(param, true, nameHash, "function parameter list"); } this.state.strict = oldStrict; } diff --git a/src/parser/lval.js b/src/parser/lval.js index 6e2611d2ac..350037ce72 100644 --- a/src/parser/lval.js +++ b/src/parser/lval.js @@ -9,7 +9,7 @@ const pp = Parser.prototype; // Convert existing expression atom to assignable pattern // if possible. -pp.toAssignable = function (node, isBinding) { +pp.toAssignable = function (node, isBinding, contextDescription) { if (node) { switch (node.type) { case "Identifier": @@ -28,13 +28,13 @@ pp.toAssignable = function (node, isBinding) { this.raise(prop.key.start, "Object pattern can't contain methods"); } } else { - this.toAssignable(prop, isBinding); + this.toAssignable(prop, isBinding, "object destructuring pattern"); } } break; case "ObjectProperty": - this.toAssignable(node.value, isBinding); + this.toAssignable(node.value, isBinding, contextDescription); break; case "SpreadProperty": @@ -43,7 +43,7 @@ pp.toAssignable = function (node, isBinding) { case "ArrayExpression": node.type = "ArrayPattern"; - this.toAssignableList(node.elements, isBinding); + this.toAssignableList(node.elements, isBinding, contextDescription); break; case "AssignmentExpression": @@ -59,7 +59,7 @@ pp.toAssignable = function (node, isBinding) { if (!isBinding) break; default: - this.raise(node.start, "Assigning to rvalue"); + this.raise(node.start, "Invalid left-hand side" + (contextDescription ? (" in " + contextDescription) : " expression")); } } return node; @@ -67,7 +67,7 @@ pp.toAssignable = function (node, isBinding) { // Convert list of expression atoms to binding list. -pp.toAssignableList = function (exprList, isBinding) { +pp.toAssignableList = function (exprList, isBinding, contextDescription) { let end = exprList.length; if (end) { let last = exprList[end - 1]; @@ -76,7 +76,7 @@ pp.toAssignableList = function (exprList, isBinding) { } else if (last && last.type === "SpreadElement") { last.type = "RestElement"; let arg = last.argument; - this.toAssignable(arg, isBinding); + this.toAssignable(arg, isBinding, contextDescription); if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") { this.unexpected(arg.start); } @@ -85,7 +85,7 @@ pp.toAssignableList = function (exprList, isBinding) { } for (let i = 0; i < end; i++) { let elt = exprList[i]; - if (elt) this.toAssignable(elt, isBinding); + if (elt) this.toAssignable(elt, isBinding, contextDescription); } return exprList; }; @@ -198,7 +198,7 @@ pp.parseMaybeDefault = function (startPos, startLoc, left) { // Verify that a node is an lval — something that can be assigned // to. -pp.checkLVal = function (expr, isBinding, checkClashes) { +pp.checkLVal = function (expr, isBinding, checkClashes, contextDescription) { switch (expr.type) { case "Identifier": if (this.state.strict && (reservedWords.strictBind(expr.name) || reservedWords.strict(expr.name))) { @@ -234,26 +234,29 @@ pp.checkLVal = function (expr, isBinding, checkClashes) { case "ObjectPattern": for (let prop of (expr.properties: Array)) { if (prop.type === "ObjectProperty") prop = prop.value; - this.checkLVal(prop, isBinding, checkClashes); + this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern"); } break; case "ArrayPattern": for (let elem of (expr.elements: Array)) { - if (elem) this.checkLVal(elem, isBinding, checkClashes); + if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern"); } break; case "AssignmentPattern": - this.checkLVal(expr.left, isBinding, checkClashes); + this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern"); break; case "RestProperty": + this.checkLVal(expr.argument, isBinding, checkClashes, "rest property"); + break; + case "RestElement": - this.checkLVal(expr.argument, isBinding, checkClashes); + this.checkLVal(expr.argument, isBinding, checkClashes, "rest element"); break; default: - this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " rvalue"); + this.raise(expr.start, (isBinding ? "Binding invalid" : "Invalid") + " left-hand side" + (contextDescription ? (" in " + contextDescription) : " expression")); } }; diff --git a/src/parser/statement.js b/src/parser/statement.js index d5ff1cc175..4817c04e3b 100644 --- a/src/parser/statement.js +++ b/src/parser/statement.js @@ -259,8 +259,9 @@ pp.parseForStatement = function (node) { let refShorthandDefaultPos = {start: 0}; let init = this.parseExpression(true, refShorthandDefaultPos); if (this.match(tt._in) || this.isContextual("of")) { - this.toAssignable(init); - this.checkLVal(init); + const description = this.isContextual("of") ? "for-of statement" : "for-in statement"; + this.toAssignable(init, undefined, description); + this.checkLVal(init, undefined, undefined, description); return this.parseForIn(node, init, forAwait); } else if (refShorthandDefaultPos.start) { this.unexpected(refShorthandDefaultPos.start); @@ -371,7 +372,7 @@ pp.parseTryStatement = function (node) { this.expect(tt.parenL); clause.param = this.parseBindingAtom(); - this.checkLVal(clause.param, true, Object.create(null)); + this.checkLVal(clause.param, true, Object.create(null), "catch clause"); this.expect(tt.parenR); clause.body = this.parseBlock(); @@ -564,7 +565,7 @@ pp.parseVar = function (node, isFor, kind) { pp.parseVarHead = function (decl) { decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, true); + this.checkLVal(decl.id, true, undefined, "variable declaration"); }; // Parse a function declaration or literal (depending on the @@ -983,7 +984,7 @@ pp.parseImportSpecifiers = function (node) { this.next(); this.expectContextual("as"); specifier.local = this.parseIdentifier(); - this.checkLVal(specifier.local, true); + this.checkLVal(specifier.local, true, undefined, "import namespace specifier"); node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier")); return; } @@ -1000,7 +1001,7 @@ pp.parseImportSpecifiers = function (node) { let specifier = this.startNode(); specifier.imported = this.parseIdentifier(true); specifier.local = this.eatContextual("as") ? this.parseIdentifier() : specifier.imported.__clone(); - this.checkLVal(specifier.local, true); + this.checkLVal(specifier.local, true, undefined, "import specifier"); node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); } }; @@ -1008,6 +1009,6 @@ pp.parseImportSpecifiers = function (node) { pp.parseImportSpecifierDefault = function (id, startPos, startLoc) { let node = this.startNodeAt(startPos, startLoc); node.local = id; - this.checkLVal(node.local, true); + this.checkLVal(node.local, true, undefined, "default import specifier"); return this.finishNode(node, "ImportDefaultSpecifier"); }; diff --git a/src/plugins/flow.js b/src/plugins/flow.js index 26c5fc38ff..c624fbe2b5 100644 --- a/src/plugins/flow.js +++ b/src/plugins/flow.js @@ -904,25 +904,25 @@ export default function (instance) { }); instance.extend("toAssignable", function (inner) { - return function (node, isBinding) { + return function (node, isBinding, contextDescription) { if (node.type === "TypeCastExpression") { - return inner.call(this, this.typeCastToParameter(node), isBinding); + return inner.call(this, this.typeCastToParameter(node), isBinding, contextDescription); } else { - return inner.call(this, node, isBinding); + return inner.call(this, node, isBinding, contextDescription); } }; }); // turn type casts that we found in function parameter head into type annotated params instance.extend("toAssignableList", function (inner) { - return function (exprList, isBinding) { + return function (exprList, isBinding, contextDescription) { for (let i = 0; i < exprList.length; i++) { let expr = exprList[i]; if (expr && expr.type === "TypeCastExpression") { exprList[i] = this.typeCastToParameter(expr); } } - return inner.call(this, exprList, isBinding); + return inner.call(this, exprList, isBinding, contextDescription); }; }); diff --git a/test/fixtures/core/uncategorised/367/options.json b/test/fixtures/core/uncategorised/367/options.json index de19a8ed39..740de73d85 100644 --- a/test/fixtures/core/uncategorised/367/options.json +++ b/test/fixtures/core/uncategorised/367/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in assignment expression (1:0)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/368/options.json b/test/fixtures/core/uncategorised/368/options.json index de19a8ed39..740de73d85 100644 --- a/test/fixtures/core/uncategorised/368/options.json +++ b/test/fixtures/core/uncategorised/368/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in assignment expression (1:0)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/369/options.json b/test/fixtures/core/uncategorised/369/options.json index 4d699b8b0c..d8b91465e5 100644 --- a/test/fixtures/core/uncategorised/369/options.json +++ b/test/fixtures/core/uncategorised/369/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:1)" + "throws": "Invalid left-hand side in assignment expression (1:1)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/370/options.json b/test/fixtures/core/uncategorised/370/options.json index de19a8ed39..57f8bee850 100644 --- a/test/fixtures/core/uncategorised/370/options.json +++ b/test/fixtures/core/uncategorised/370/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in postfix operation (1:0)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/371/options.json b/test/fixtures/core/uncategorised/371/options.json index de19a8ed39..57f8bee850 100644 --- a/test/fixtures/core/uncategorised/371/options.json +++ b/test/fixtures/core/uncategorised/371/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in postfix operation (1:0)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/372/options.json b/test/fixtures/core/uncategorised/372/options.json index 0b53e4963e..e58c443745 100644 --- a/test/fixtures/core/uncategorised/372/options.json +++ b/test/fixtures/core/uncategorised/372/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:2)" + "throws": "Invalid left-hand side in prefix operation (1:2)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/373/options.json b/test/fixtures/core/uncategorised/373/options.json index 0b53e4963e..e58c443745 100644 --- a/test/fixtures/core/uncategorised/373/options.json +++ b/test/fixtures/core/uncategorised/373/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:2)" + "throws": "Invalid left-hand side in prefix operation (1:2)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/374/options.json b/test/fixtures/core/uncategorised/374/options.json index 85f6f01102..83b3a8b5f3 100644 --- a/test/fixtures/core/uncategorised/374/options.json +++ b/test/fixtures/core/uncategorised/374/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:5)" + "throws": "Invalid left-hand side in for-in statement (1:5)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/383/options.json b/test/fixtures/core/uncategorised/383/options.json index de19a8ed39..740de73d85 100644 --- a/test/fixtures/core/uncategorised/383/options.json +++ b/test/fixtures/core/uncategorised/383/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in assignment expression (1:0)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/384/options.json b/test/fixtures/core/uncategorised/384/options.json index de19a8ed39..740de73d85 100644 --- a/test/fixtures/core/uncategorised/384/options.json +++ b/test/fixtures/core/uncategorised/384/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in assignment expression (1:0)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/417/options.json b/test/fixtures/core/uncategorised/417/options.json index 85f6f01102..83b3a8b5f3 100644 --- a/test/fixtures/core/uncategorised/417/options.json +++ b/test/fixtures/core/uncategorised/417/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:5)" + "throws": "Invalid left-hand side in for-in statement (1:5)" } \ No newline at end of file diff --git a/test/fixtures/core/uncategorised/418/options.json b/test/fixtures/core/uncategorised/418/options.json index 85f6f01102..83b3a8b5f3 100644 --- a/test/fixtures/core/uncategorised/418/options.json +++ b/test/fixtures/core/uncategorised/418/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:5)" + "throws": "Invalid left-hand side in for-in statement (1:5)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/220/options.json b/test/fixtures/es2015/uncategorised/220/options.json index de19a8ed39..740de73d85 100644 --- a/test/fixtures/es2015/uncategorised/220/options.json +++ b/test/fixtures/es2015/uncategorised/220/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in assignment expression (1:0)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/221/options.json b/test/fixtures/es2015/uncategorised/221/options.json index 4d699b8b0c..d8b91465e5 100644 --- a/test/fixtures/es2015/uncategorised/221/options.json +++ b/test/fixtures/es2015/uncategorised/221/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:1)" + "throws": "Invalid left-hand side in assignment expression (1:1)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/222/options.json b/test/fixtures/es2015/uncategorised/222/options.json index 6636a521f6..033fe6edc6 100644 --- a/test/fixtures/es2015/uncategorised/222/options.json +++ b/test/fixtures/es2015/uncategorised/222/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:7)" + "throws": "Invalid left-hand side in object destructuring pattern (1:7)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/251/options.json b/test/fixtures/es2015/uncategorised/251/options.json index 4d699b8b0c..419e8d307f 100644 --- a/test/fixtures/es2015/uncategorised/251/options.json +++ b/test/fixtures/es2015/uncategorised/251/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:1)" + "throws": "Invalid left-hand side in arrow function parameters (1:1)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/252/options.json b/test/fixtures/es2015/uncategorised/252/options.json index 4d699b8b0c..419e8d307f 100644 --- a/test/fixtures/es2015/uncategorised/252/options.json +++ b/test/fixtures/es2015/uncategorised/252/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:1)" + "throws": "Invalid left-hand side in arrow function parameters (1:1)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/284/options.json b/test/fixtures/es2015/uncategorised/284/options.json index edcc96bcf1..70cf4c97fe 100644 --- a/test/fixtures/es2015/uncategorised/284/options.json +++ b/test/fixtures/es2015/uncategorised/284/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:3)" + "throws": "Invalid left-hand side in arrow function parameters (1:3)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/288/options.json b/test/fixtures/es2015/uncategorised/288/options.json index 4d699b8b0c..d8b91465e5 100644 --- a/test/fixtures/es2015/uncategorised/288/options.json +++ b/test/fixtures/es2015/uncategorised/288/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:1)" + "throws": "Invalid left-hand side in assignment expression (1:1)" } \ No newline at end of file diff --git a/test/fixtures/es2015/uncategorised/37/options.json b/test/fixtures/es2015/uncategorised/37/options.json index 0b53e4963e..b5496da473 100644 --- a/test/fixtures/es2015/uncategorised/37/options.json +++ b/test/fixtures/es2015/uncategorised/37/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:2)" + "throws": "Invalid left-hand side in arrow function parameters (1:2)" } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json index f940813b9f..552c89da58 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:4)" + "throws": "Invalid left-hand side in object destructuring pattern (1:4)" } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json index 85f6f01102..a457612ad3 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:5)" + "throws": "Invalid left-hand side in object destructuring pattern (1:5)" } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json b/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json index 4d699b8b0c..d8b91465e5 100644 --- a/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json +++ b/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:1)" + "throws": "Invalid left-hand side in assignment expression (1:1)" } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json b/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json index 85f6f01102..29280a8d63 100644 --- a/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json +++ b/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:5)" + "throws": "Invalid left-hand side in for-of statement (1:5)" } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json index b7fab4d126..1c860a7eb9 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:16)" + "throws": "Invalid left-hand side in arrow function parameters (1:16)" } \ No newline at end of file diff --git a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json index b38eacd757..92cc34a930 100644 --- a/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json +++ b/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:25)" + "throws": "Invalid left-hand side in arrow function parameters (1:25)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json index de19a8ed39..740de73d85 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in assignment expression (1:0)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json index de19a8ed39..740de73d85 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in assignment expression (1:0)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json index 4d699b8b0c..d8b91465e5 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:1)" + "throws": "Invalid left-hand side in assignment expression (1:1)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json index de19a8ed39..57f8bee850 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in postfix operation (1:0)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json index de19a8ed39..57f8bee850 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in postfix operation (1:0)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json index 0b53e4963e..e58c443745 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:2)" + "throws": "Invalid left-hand side in prefix operation (1:2)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json index 0b53e4963e..e58c443745 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:2)" + "throws": "Invalid left-hand side in prefix operation (1:2)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json index 85f6f01102..83b3a8b5f3 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:5)" + "throws": "Invalid left-hand side in for-in statement (1:5)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json index de19a8ed39..740de73d85 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in assignment expression (1:0)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json index de19a8ed39..740de73d85 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:0)" + "throws": "Invalid left-hand side in assignment expression (1:0)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json index 4d699b8b0c..419e8d307f 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:1)" + "throws": "Invalid left-hand side in arrow function parameters (1:1)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json index 4d699b8b0c..419e8d307f 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:1)" + "throws": "Invalid left-hand side in arrow function parameters (1:1)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json index 85f6f01102..83b3a8b5f3 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:5)" + "throws": "Invalid left-hand side in for-in statement (1:5)" } \ No newline at end of file diff --git a/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json b/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json index 85f6f01102..83b3a8b5f3 100644 --- a/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json +++ b/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json @@ -1,3 +1,3 @@ { - "throws": "Assigning to rvalue (1:5)" + "throws": "Invalid left-hand side in for-in statement (1:5)" } \ No newline at end of file