Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
validate against nested ParenthesizedExpressions
- Loading branch information
1 parent
9724926
commit b1ca931
Showing
6 changed files
with
308 additions
and
21 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
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/core/categorized/valid-assignment-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 @@ | ||
[(((x)))] = t; |
121 changes: 121 additions & 0 deletions
121
packages/babel-parser/test/fixtures/core/categorized/valid-assignment-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,121 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 14, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 14, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 0, | ||
"end": 14, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"expression": { | ||
"type": "AssignmentExpression", | ||
"start": 0, | ||
"end": 13, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13 | ||
} | ||
}, | ||
"operator": "=", | ||
"left": { | ||
"type": "ArrayPattern", | ||
"start": 0, | ||
"end": 9, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
}, | ||
"elements": [ | ||
{ | ||
"type": "Identifier", | ||
"start": 4, | ||
"end": 5, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"identifierName": "x" | ||
}, | ||
"name": "x", | ||
"extra": { | ||
"parenthesized": true, | ||
"parenStart": 1 | ||
} | ||
} | ||
] | ||
}, | ||
"right": { | ||
"type": "Identifier", | ||
"start": 12, | ||
"end": 13, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13 | ||
}, | ||
"identifierName": "t" | ||
}, | ||
"name": "t" | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/core/uncategorised/566/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 @@ | ||
[(((x)))] = t; |
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/core/uncategorised/566/options.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,3 @@ | ||
{ | ||
"createParenthesizedExpressions": true | ||
} |
162 changes: 162 additions & 0 deletions
162
packages/babel-parser/test/fixtures/core/uncategorised/566/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,162 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 14, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 14, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 0, | ||
"end": 14, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"expression": { | ||
"type": "AssignmentExpression", | ||
"start": 0, | ||
"end": 13, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13 | ||
} | ||
}, | ||
"operator": "=", | ||
"left": { | ||
"type": "ArrayPattern", | ||
"start": 0, | ||
"end": 9, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9 | ||
} | ||
}, | ||
"elements": [ | ||
{ | ||
"type": "ParenthesizedExpression", | ||
"start": 1, | ||
"end": 8, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 8 | ||
} | ||
}, | ||
"expression": { | ||
"type": "ParenthesizedExpression", | ||
"start": 2, | ||
"end": 7, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 7 | ||
} | ||
}, | ||
"expression": { | ||
"type": "ParenthesizedExpression", | ||
"start": 3, | ||
"end": 6, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 3 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 6 | ||
} | ||
}, | ||
"expression": { | ||
"type": "Identifier", | ||
"start": 4, | ||
"end": 5, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"identifierName": "x" | ||
}, | ||
"name": "x" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"right": { | ||
"type": "Identifier", | ||
"start": 12, | ||
"end": 13, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 12 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13 | ||
}, | ||
"identifierName": "t" | ||
}, | ||
"name": "t" | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |