Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

should allow duplicate __proto__ keys in patterns #306

Closed
babel-bot opened this issue Jan 17, 2017 · 3 comments
Closed

should allow duplicate __proto__ keys in patterns #306

babel-bot opened this issue Jan 17, 2017 · 3 comments

Comments

@babel-bot
Copy link

Original issue submitted by @gsathya in babel/babel#5145

Input Code

result = { __proto__: x, __proto__: y } = value;

Babel Configuration (.babelrc, package.json, cli command)

presets - latest

Expected Behavior

No error

Current Behavior

Error: Redefinition of __proto__ property

Possible Solution

Context

Your Environment

software version
Babel
node
npm
Operating System
@xtuc
Copy link
Member

xtuc commented Jan 17, 2017

@gsathya The spec says that:

It is a Syntax Error if PropertyNameList of PropertyDefinitionList contains any duplicate entries for __proto__ [...]

(source)

@gsathya
Copy link
Member

gsathya commented Jan 17, 2017

When ObjectLiteral appears in a context where ObjectAssignmentPattern is required the Early Error rule is not applied. In addition, it is not applied when initially parsing a CoverParenthesizedExpressionAndArrowParameterList.

@babel-bot
Copy link
Author

This issue has been moved to babel/babel#6705.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants