Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Allow duplicate __proto__ keys in patterns, simple case (#6705) * Update test262 whitelist * Rename checkDuplicatedProto's parameter and adjust type * Store first __proto__ redefinition's position
- Loading branch information
1 parent
dcf7d89
commit 06313a6
Showing
5 changed files
with
230 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
1 change: 1 addition & 0 deletions
1
packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto/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 } = {}); |
207 changes: 207 additions & 0 deletions
207
packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto/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,207 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 38, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 38 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 38, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 38 | ||
} | ||
}, | ||
"sourceType": "script", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "ExpressionStatement", | ||
"start": 0, | ||
"end": 38, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 38 | ||
} | ||
}, | ||
"expression": { | ||
"type": "AssignmentExpression", | ||
"start": 1, | ||
"end": 36, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 36 | ||
} | ||
}, | ||
"operator": "=", | ||
"left": { | ||
"type": "ObjectPattern", | ||
"start": 1, | ||
"end": 31, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 31 | ||
} | ||
}, | ||
"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": 12, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 3 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
}, | ||
"identifierName": "__proto__" | ||
}, | ||
"name": "__proto__" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "Identifier", | ||
"start": 14, | ||
"end": 15, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 15 | ||
}, | ||
"identifierName": "x" | ||
}, | ||
"name": "x" | ||
} | ||
}, | ||
{ | ||
"type": "ObjectProperty", | ||
"start": 17, | ||
"end": 29, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 17 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 29 | ||
} | ||
}, | ||
"method": false, | ||
"key": { | ||
"type": "Identifier", | ||
"start": 17, | ||
"end": 26, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 17 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 26 | ||
}, | ||
"identifierName": "__proto__" | ||
}, | ||
"name": "__proto__" | ||
}, | ||
"computed": false, | ||
"shorthand": false, | ||
"value": { | ||
"type": "Identifier", | ||
"start": 28, | ||
"end": 29, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 28 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 29 | ||
}, | ||
"identifierName": "y" | ||
}, | ||
"name": "y" | ||
} | ||
} | ||
] | ||
}, | ||
"right": { | ||
"type": "ObjectExpression", | ||
"start": 34, | ||
"end": 36, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 34 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 36 | ||
} | ||
}, | ||
"properties": [] | ||
}, | ||
"extra": { | ||
"parenthesized": true, | ||
"parenStart": 0 | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |
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