-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: record parenthesized identifier error for LHS
- Loading branch information
Showing
40 changed files
with
1,050 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...s/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
([ [(a)] = [] ] = []) => {} |
74 changes: 74 additions & 0 deletions
74
...abel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, | ||
"errors": [ | ||
"SyntaxError: Invalid parenthesized assignment pattern (1:5)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, | ||
"expression": { | ||
"type": "ArrowFunctionExpression", | ||
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
{ | ||
"type": "AssignmentPattern", | ||
"start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, | ||
"left": { | ||
"type": "ArrayPattern", | ||
"start":1,"end":15,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":15}}, | ||
"elements": [ | ||
{ | ||
"type": "AssignmentPattern", | ||
"start":3,"end":13,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":13}}, | ||
"left": { | ||
"type": "ArrayPattern", | ||
"start":3,"end":8,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":8}}, | ||
"elements": [ | ||
{ | ||
"type": "Identifier", | ||
"start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, | ||
"extra": { | ||
"parenthesized": true, | ||
"parenStart": 4 | ||
}, | ||
"name": "a" | ||
} | ||
] | ||
}, | ||
"right": { | ||
"type": "ArrayExpression", | ||
"start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, | ||
"elements": [] | ||
} | ||
} | ||
] | ||
}, | ||
"right": { | ||
"type": "ArrayExpression", | ||
"start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, | ||
"elements": [] | ||
} | ||
} | ||
], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, | ||
"body": [], | ||
"directives": [] | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...s/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
([(a) = [] ] = []) => {} |
68 changes: 68 additions & 0 deletions
68
...abel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, | ||
"errors": [ | ||
"SyntaxError: Invalid parenthesized assignment pattern (1:3)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, | ||
"expression": { | ||
"type": "ArrowFunctionExpression", | ||
"start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
{ | ||
"type": "AssignmentPattern", | ||
"start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, | ||
"left": { | ||
"type": "ArrayPattern", | ||
"start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, | ||
"elements": [ | ||
{ | ||
"type": "AssignmentPattern", | ||
"start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, | ||
"left": { | ||
"type": "Identifier", | ||
"start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, | ||
"extra": { | ||
"parenthesized": true, | ||
"parenStart": 2 | ||
}, | ||
"name": "a" | ||
}, | ||
"right": { | ||
"type": "ArrayExpression", | ||
"start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, | ||
"elements": [] | ||
} | ||
} | ||
] | ||
}, | ||
"right": { | ||
"type": "ArrayExpression", | ||
"start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17}}, | ||
"elements": [] | ||
} | ||
} | ||
], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":22,"end":24,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":24}}, | ||
"body": [], | ||
"directives": [] | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...l-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ a: (foo.qux) } = {}) => {} |
81 changes: 81 additions & 0 deletions
81
...arser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, | ||
"errors": [ | ||
"SyntaxError: Binding member expression (1:7)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, | ||
"expression": { | ||
"type": "ArrowFunctionExpression", | ||
"start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
{ | ||
"type": "AssignmentPattern", | ||
"start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, | ||
"left": { | ||
"type": "ObjectPattern", | ||
"start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, | ||
"properties": [ | ||
{ | ||
"type": "ObjectProperty", | ||
"start":3,"end":15,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":15}}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, | ||
"name": "a" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "MemberExpression", | ||
"start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14}}, | ||
"extra": { | ||
"parenthesized": true, | ||
"parenStart": 6 | ||
}, | ||
"object": { | ||
"type": "Identifier", | ||
"start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, | ||
"name": "foo" | ||
}, | ||
"computed": false, | ||
"property": { | ||
"type": "Identifier", | ||
"start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"qux"}, | ||
"name": "qux" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"right": { | ||
"type": "ObjectExpression", | ||
"start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, | ||
"properties": [] | ||
} | ||
} | ||
], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, | ||
"body": [], | ||
"directives": [] | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...es/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ a: (foo) } = {}) => {} |
71 changes: 71 additions & 0 deletions
71
...babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, | ||
"errors": [ | ||
"SyntaxError: Invalid parenthesized assignment pattern (1:7)" | ||
], | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, | ||
"expression": { | ||
"type": "ArrowFunctionExpression", | ||
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, | ||
"id": null, | ||
"generator": false, | ||
"async": false, | ||
"params": [ | ||
{ | ||
"type": "AssignmentPattern", | ||
"start":1,"end":18,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":18}}, | ||
"left": { | ||
"type": "ObjectPattern", | ||
"start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, | ||
"properties": [ | ||
{ | ||
"type": "ObjectProperty", | ||
"start":3,"end":11,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":11}}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, | ||
"name": "a" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "Identifier", | ||
"start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, | ||
"extra": { | ||
"parenthesized": true, | ||
"parenStart": 6 | ||
}, | ||
"name": "foo" | ||
} | ||
} | ||
] | ||
}, | ||
"right": { | ||
"type": "ObjectExpression", | ||
"start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, | ||
"properties": [] | ||
} | ||
} | ||
], | ||
"body": { | ||
"type": "BlockStatement", | ||
"start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, | ||
"body": [], | ||
"directives": [] | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...s/babel-parser/test/fixtures/es2015/destructuring/lhs-parenthesized-assignment-2/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
([(a) = [] ] = []); |
Oops, something went wrong.