Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: duplicate __proto__ keys should be allowed in patterns
- Loading branch information
Showing
9 changed files
with
483 additions
and
17 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
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
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-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 @@ | ||
([{ __proto__: x, __proto__: y }] = [{}]); |
241 changes: 241 additions & 0 deletions
241
packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-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,241 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 42, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 42 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 42, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 42 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 0, | ||
"end": 42, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 42 | ||
} | ||
}, | ||
"expression": { | ||
"type": "AssignmentExpression", | ||
"start": 1, | ||
"end": 40, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 40 | ||
} | ||
}, | ||
"operator": "=", | ||
"left": { | ||
"type": "ArrayPattern", | ||
"start": 1, | ||
"end": 33, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33 | ||
} | ||
}, | ||
"elements": [ | ||
{ | ||
"type": "ObjectPattern", | ||
"start": 2, | ||
"end": 32, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 2 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 32 | ||
} | ||
}, | ||
"properties": [ | ||
{ | ||
"type": "ObjectProperty", | ||
"start": 4, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
} | ||
}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start": 4, | ||
"end": 13, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13 | ||
}, | ||
"identifierName": "__proto__" | ||
}, | ||
"name": "__proto__" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "Identifier", | ||
"start": 15, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 15 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
}, | ||
"identifierName": "x" | ||
}, | ||
"name": "x" | ||
} | ||
}, | ||
{ | ||
"type": "ObjectProperty", | ||
"start": 18, | ||
"end": 30, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 18 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 30 | ||
} | ||
}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start": 18, | ||
"end": 27, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 18 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 27 | ||
}, | ||
"identifierName": "__proto__" | ||
}, | ||
"name": "__proto__" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "Identifier", | ||
"start": 29, | ||
"end": 30, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 29 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 30 | ||
}, | ||
"identifierName": "y" | ||
}, | ||
"name": "y" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"right": { | ||
"type": "ArrayExpression", | ||
"start": 36, | ||
"end": 40, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 36 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 40 | ||
} | ||
}, | ||
"elements": [ | ||
{ | ||
"type": "ObjectExpression", | ||
"start": 37, | ||
"end": 39, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 37 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 39 | ||
} | ||
}, | ||
"properties": [] | ||
} | ||
] | ||
}, | ||
"extra": { | ||
"parenthesized": true, | ||
"parenStart": 0 | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-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 @@ | ||
({ __proto__: x, __proto__: y }) => {}; |
Oops, something went wrong.