From 6664b40c36b7c6b3d66fef66f0b5a079a9767c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 14:33:09 +0200 Subject: [PATCH] Remove duplicates messages about invalid lhs --- .../babel-parser/src/parser/expression.js | 10 +++- packages/babel-parser/src/parser/lval.js | 55 ++++++++++++++----- packages/babel-parser/src/plugins/estree.js | 18 +++--- packages/babel-parser/src/plugins/flow.js | 12 +++- .../src/plugins/typescript/index.js | 16 +++--- .../core/uncategorised/367/output.json | 1 - .../core/uncategorised/368/output.json | 1 - .../core/uncategorised/369/output.json | 1 - .../core/uncategorised/383/output.json | 1 - .../core/uncategorised/384/output.json | 1 - .../es2015/uncategorised/221/output.json | 1 - .../es2015/uncategorised/222/output.json | 1 - .../es2015/uncategorised/251/output.json | 1 - .../es2015/uncategorised/252/output.json | 2 - .../es2015/uncategorised/284/output.json | 1 - .../es2015/uncategorised/37/output.json | 1 - .../es2015/uncategorised/395/output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../invalid-lhs-01/output.json | 1 - .../invalid-lhs-02/output.json | 1 - .../invalid-group-assignment/output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../invalid-syntax/migrated_0045/output.json | 1 - .../invalid-syntax/migrated_0046/output.json | 1 - .../invalid-syntax/migrated_0047/output.json | 1 - .../invalid-syntax/migrated_0066/output.json | 1 - .../invalid-syntax/migrated_0067/output.json | 1 - .../invalid-syntax/migrated_0098/output.json | 1 - .../invalid-syntax/migrated_0099/output.json | 2 - .../import-meta/not-assignable/output.json | 1 - .../regression/issue-58-failing-1/output.json | 1 - 37 files changed, 76 insertions(+), 69 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 64f7d8afc356..8572a89749cf 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -205,7 +205,13 @@ export default class ExpressionParser extends LValParser { this.expectPlugin("logicalAssignment"); } node.left = this.match(tt.eq) - ? this.toAssignable(left, undefined, "assignment expression") + ? this.toAssignable( + left, + undefined, + "assignment expression", + // ignore invalid lhs expressions, since they will be reported by checkLVal + true, + ) : left; refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly @@ -1835,6 +1841,8 @@ export default class ExpressionParser extends LValParser { params, true, "arrow function parameters", + // Ignore invalid bindings, since they will be checked by checkParams + true, ); } diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js index 8e2ce05c683e..4ffb10bb9fdb 100644 --- a/packages/babel-parser/src/parser/lval.js +++ b/packages/babel-parser/src/parser/lval.js @@ -41,6 +41,7 @@ export default class LValParser extends NodeUtils { node: Node, isBinding: ?boolean, contextDescription: string, + ignoreInvalid: boolean = false, ): Node { if (node) { switch (node.type) { @@ -59,12 +60,22 @@ export default class LValParser extends NodeUtils { ) { const prop = node.properties[i]; const isLast = i === last; - this.toAssignableObjectExpressionProp(prop, isBinding, isLast); + this.toAssignableObjectExpressionProp( + prop, + isBinding, + isLast, + ignoreInvalid, + ); } break; case "ObjectProperty": - this.toAssignable(node.value, isBinding, contextDescription); + this.toAssignable( + node.value, + isBinding, + contextDescription, + ignoreInvalid, + ); break; case "SpreadElement": { @@ -72,13 +83,18 @@ export default class LValParser extends NodeUtils { node.type = "RestElement"; const arg = node.argument; - this.toAssignable(arg, isBinding, contextDescription); + this.toAssignable(arg, isBinding, contextDescription, ignoreInvalid); break; } case "ArrayExpression": node.type = "ArrayPattern"; - this.toAssignableList(node.elements, isBinding, contextDescription); + this.toAssignableList( + node.elements, + isBinding, + contextDescription, + ignoreInvalid, + ); break; case "AssignmentExpression": @@ -98,20 +114,22 @@ export default class LValParser extends NodeUtils { node.expression, isBinding, contextDescription, + ignoreInvalid, ); break; case "MemberExpression": if (!isBinding) break; - default: { - const message = - "Invalid left-hand side" + - (contextDescription - ? " in " + contextDescription - : /* istanbul ignore next */ "expression"); - this.raise(node.start, message); - } + default: + if (!ignoreInvalid) { + const message = + "Invalid left-hand side" + + (contextDescription + ? " in " + contextDescription + : /* istanbul ignore next */ "expression"); + this.raise(node.start, message); + } } } return node; @@ -121,6 +139,7 @@ export default class LValParser extends NodeUtils { prop: Node, isBinding: ?boolean, isLast: boolean, + ignoreInvalid?: boolean = false, ) { if (prop.type === "ObjectMethod") { const error = @@ -132,7 +151,12 @@ export default class LValParser extends NodeUtils { } else if (prop.type === "SpreadElement" && !isLast) { this.raiseRestNotLast(prop.start); } else { - this.toAssignable(prop, isBinding, "object destructuring pattern"); + this.toAssignable( + prop, + isBinding, + "object destructuring pattern", + ignoreInvalid, + ); } } @@ -142,6 +166,7 @@ export default class LValParser extends NodeUtils { exprList: Expression[], isBinding: ?boolean, contextDescription: string, + ignoreInvalid?: boolean = false, ): $ReadOnlyArray { let end = exprList.length; if (end) { @@ -151,7 +176,7 @@ export default class LValParser extends NodeUtils { } else if (last && last.type === "SpreadElement") { last.type = "RestElement"; const arg = last.argument; - this.toAssignable(arg, isBinding, contextDescription); + this.toAssignable(arg, isBinding, contextDescription, ignoreInvalid); if ( arg.type !== "Identifier" && arg.type !== "MemberExpression" && @@ -166,7 +191,7 @@ export default class LValParser extends NodeUtils { for (let i = 0; i < end; i++) { const elt = exprList[i]; if (elt) { - this.toAssignable(elt, isBinding, contextDescription); + this.toAssignable(elt, isBinding, contextDescription, ignoreInvalid); if (elt.type === "RestElement") { this.raiseRestNotLast(elt.start); } diff --git a/packages/babel-parser/src/plugins/estree.js b/packages/babel-parser/src/plugins/estree.js index 6a3cdd9cf6bb..c2766c7cfbcc 100644 --- a/packages/babel-parser/src/plugins/estree.js +++ b/packages/babel-parser/src/plugins/estree.js @@ -359,21 +359,23 @@ export default (superClass: Class): Class => node: N.Node, isBinding: ?boolean, contextDescription: string, + ignoreInvalid?: boolean, ): N.Node { if (isSimpleProperty(node)) { - this.toAssignable(node.value, isBinding, contextDescription); + this.toAssignable( + node.value, + isBinding, + contextDescription, + ignoreInvalid, + ); return node; } - return super.toAssignable(node, isBinding, contextDescription); + return super.toAssignable(...arguments); } - toAssignableObjectExpressionProp( - prop: N.Node, - isBinding: ?boolean, - isLast: boolean, - ) { + toAssignableObjectExpressionProp(prop: N.Node) { if (prop.kind === "get" || prop.kind === "set") { throw this.raise( prop.key.start, @@ -385,7 +387,7 @@ export default (superClass: Class): Class => "Object pattern can't contain methods", ); } else { - super.toAssignableObjectExpressionProp(prop, isBinding, isLast); + super.toAssignableObjectExpressionProp(...arguments); } } }; diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index be15eea7fa04..eacda4b8e26f 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -1978,15 +1978,17 @@ export default (superClass: Class): Class => node: N.Node, isBinding: ?boolean, contextDescription: string, + ignoreInvalid?: boolean, ): N.Node { if (node.type === "TypeCastExpression") { return super.toAssignable( this.typeCastToParameter(node), isBinding, contextDescription, + ignoreInvalid, ); } else { - return super.toAssignable(node, isBinding, contextDescription); + return super.toAssignable(...arguments); } } @@ -1995,6 +1997,7 @@ export default (superClass: Class): Class => exprList: N.Expression[], isBinding: ?boolean, contextDescription: string, + ignoreInvalid?: boolean, ): $ReadOnlyArray { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; @@ -2002,7 +2005,12 @@ export default (superClass: Class): Class => exprList[i] = this.typeCastToParameter(expr); } } - return super.toAssignableList(exprList, isBinding, contextDescription); + return super.toAssignableList( + exprList, + isBinding, + contextDescription, + ignoreInvalid, + ); } // this is a list of nodes, from something like a call expression, we need to filter the diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index a0e413ea632e..1f9956f308fc 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -2233,6 +2233,7 @@ export default (superClass: Class): Class => node: N.Node, isBinding: ?boolean, contextDescription: string, + ignoreInvalid?: boolean, ): N.Node { switch (node.type) { case "TSTypeCastExpression": @@ -2240,9 +2241,8 @@ export default (superClass: Class): Class => this.typeCastToParameter(node), isBinding, contextDescription, + ignoreInvalid, ); - case "TSParameterProperty": - return super.toAssignable(node, isBinding, contextDescription); case "TSAsExpression": case "TSNonNullExpression": case "TSTypeAssertion": @@ -2250,10 +2250,12 @@ export default (superClass: Class): Class => node.expression, isBinding, contextDescription, + ignoreInvalid, ); return node; + case "TSParameterProperty": default: - return super.toAssignable(node, isBinding, contextDescription); + return super.toAssignable(...arguments); } } @@ -2361,11 +2363,7 @@ export default (superClass: Class): Class => } } - toAssignableList( - exprList: N.Expression[], - isBinding: ?boolean, - contextDescription: string, - ): $ReadOnlyArray { + toAssignableList(exprList: N.Expression[]): $ReadOnlyArray { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if (!expr) continue; @@ -2382,7 +2380,7 @@ export default (superClass: Class): Class => break; } } - return super.toAssignableList(exprList, isBinding, contextDescription); + return super.toAssignableList(...arguments); } typeCastToParameter(node: N.TsTypeCastExpression): N.Node { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json index 466f4bd92254..99a3e74a04af 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json index 8a8d67a80a10..8770df4abba7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json index b22f988e1aa7..42614106f157 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json index 329a2a1e98b7..56547ff7be13 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json index 12ab663d4186..ece139488ea0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json index 6932acaf94d1..58fa4ffd7fb9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:1)", "SyntaxError: Invalid left-hand side in array destructuring pattern (1:1)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json index 3b566923a758..e758dffee7fa 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:7)", "SyntaxError: Invalid left-hand side in object destructuring pattern (1:7)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json index ac99cb69ad3c..a65f6e201960 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", "SyntaxError: Binding invalid left-hand side in function paramter list (1:1)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json index 40ac21aa1966..3247dfab9aca 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json @@ -13,8 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", - "SyntaxError: Invalid left-hand side in arrow function parameters (1:5)", "SyntaxError: Binding invalid left-hand side in function paramter list (1:1)", "SyntaxError: Binding invalid left-hand side in function paramter list (1:5)" ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json index 05a6a4bba833..68f6ccb7cefc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:3)", "SyntaxError: Binding invalid left-hand side in array destructuring pattern (1:3)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json index 0f0e4be597a6..074d84652acc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:2)", "SyntaxError: Binding member expression (1:2)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json index 0f0e4be597a6..074d84652acc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:2)", "SyntaxError: Binding member expression (1:2)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json index 223d916de0b9..bb551e7c73fa 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:8)", - "SyntaxError: Invalid left-hand side in arrow function parameters (2:8)", "SyntaxError: Binding invalid left-hand side in function paramter list (2:8)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json index db7dd7867d99..5af11cb31e43 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:3)", - "SyntaxError: Invalid left-hand side in arrow function parameters (2:3)", "SyntaxError: Binding invalid left-hand side in function paramter list (2:3)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json index 595c1d116b37..ea07b9ddd785 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:3)", - "SyntaxError: Invalid left-hand side in arrow function parameters (2:3)", "SyntaxError: Binding invalid left-hand side in function paramter list (2:3)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json index c686bc898262..a3fbda8e50f6 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:9)", - "SyntaxError: Invalid left-hand side in arrow function parameters (2:9)", "SyntaxError: Binding invalid left-hand side in function paramter list (2:9)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json index 8eb8960ae355..9e8858777646 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)", "SyntaxError: Binding member expression (1:4)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json index 2956af5c9a0e..a0f4f6168da6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:24)", "SyntaxError: Binding member expression (1:24)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json index 89f16c86c886..b71ec1a70153 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)", "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json index 43142f71dcd8..0282d2b2a59c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:5)", "SyntaxError: Invalid left-hand side in object destructuring pattern (1:5)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json index 104d3f520ff3..a6616604e7dd 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json index 42f04be1d970..8f5d9fe4753e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (1:16)", - "SyntaxError: Invalid left-hand side in arrow function parameters (1:16)", "SyntaxError: Binding invalid left-hand side in function paramter list (1:16)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json index 37c159971dae..b15336d1d4b2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (1:25)", - "SyntaxError: Invalid left-hand side in arrow function parameters (1:25)", "SyntaxError: Binding invalid left-hand side in function paramter list (1:25)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json index 466f4bd92254..99a3e74a04af 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json index 8a8d67a80a10..8770df4abba7 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json index b22f988e1aa7..42614106f157 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json index 329a2a1e98b7..56547ff7be13 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json index 12ab663d4186..ece139488ea0 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json index ac99cb69ad3c..a65f6e201960 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", "SyntaxError: Binding invalid left-hand side in function paramter list (1:1)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json index 40ac21aa1966..3247dfab9aca 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json @@ -13,8 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", - "SyntaxError: Invalid left-hand side in arrow function parameters (1:5)", "SyntaxError: Binding invalid left-hand side in function paramter list (1:1)", "SyntaxError: Binding invalid left-hand side in function paramter list (1:5)" ], diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json index 914869881742..7610536beafc 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json index 7909cd594b5c..7827ed6b38c9 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (2:11)", "SyntaxError: Binding invalid left-hand side in function paramter list (2:11)" ], "program": {