Closed Bug 866624 Opened 12 years ago Closed 10 years ago

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

Categories

(Core :: JavaScript Engine, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: anba, Unassigned)

References

(Blocks 1 open bug)

Details

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: es6
Status: NEW → UNCONFIRMED
Ever confirmed: false
Assignee: general → nobody
No longer reproducible - resolving as WFM. (Probably fixed as a side-effect of allowing duplicate properties - bug 1041128.)
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.