Closed Bug 1279735 Opened 3 years ago Closed 3 years ago

Allow const declaration in for-in loop

Categories

(Core :: JavaScript Engine, defect)

49 Branch
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 449811

People

(Reporter: balloonguy123, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0
Build ID: 20160611004009

Steps to reproduce:

Run the following script:

let a={};
for(const x in a){}


Actual results:

SyntaxError: missing = in const declaration


Expected results:

Declaring x as const should not have raised a syntax error. http://www.ecma-international.org/ecma-262/6.0/#sec-iteration-statements suggests that a const declaration is valid, and the syntax does not raise an error in Chrome 51.0.2704.84
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 449811
You need to log in before you can comment on or make changes to this bug.