Duplicate property keys in destructuring form throws SyntaxError in strict-mode

RESOLVED WORKSFORME

Status

()

Core
JavaScript Engine
RESOLVED WORKSFORME
5 years ago
3 years ago

People

(Reporter: anba, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130409194949

Steps to reproduce:

test case:
js> "use strict"; var {a:a1,a:a2} = {}
typein:4:0 SyntaxError: property name a appears more than once in object literal:
typein:4:0 "use strict"; var {a:a1,a:a2} = {}
typein:4:0 ..........................^
js> "use strict"; ({a:a1,a:a2}) = {}
typein:5:0 SyntaxError: property name a appears more than once in object literal:
typein:5:0 "use strict"; ({a:a1,a:a2}) = {}
typein:5:0 .......................^


Both forms are allowed by the ES6 draft. Duplicate property keys checks (see Static Semantics: Early Errors, 11.1.5  Object Initialiser) only have to be performed for object initialisers, not for destructing forms (destructuring assignment / destructuring binding patterns).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 694100
Status: NEW → UNCONFIRMED
Ever confirmed: false
(Assignee)

Updated

3 years ago
Assignee: general → nobody
(Reporter)

Comment 1

3 years ago
No longer reproducible - resolving as WFM. (Probably fixed as a side-effect of allowing duplicate properties - bug 1041128.)
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.