Closed Bug 1268812 Opened 3 years ago Closed 3 years ago

"let" variable used in "for of" not scoped to individual loops

Categories

(Core :: JavaScript Engine, defect)

49 Branch
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 449811

People

(Reporter: alancutter, Unassigned)

Details

(Whiteboard: [parity-Chrome][parity-Edge])

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.22 Safari/537.36

Steps to reproduce:

Firefox Nightly: 49.0a1 (2016-04-25)
OS: Linux

Test case: https://jsfiddle.net/pkyce3uw/
let xs = ['P', 'A', 'S', 'S'];
let fs = [];
for (let x of xs) {
	fs.push(() => document.body.textContent += x);
}
for (let f of fs) {
	f();
}

This test passes in Chrome.


Actual results:

SSSS


Expected results:

PASS
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Whiteboard: [parity-Chrome][parity-Edge]
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
No longer depends on: 449811
Resolution: --- → DUPLICATE
Duplicate of bug: 449811
You need to log in before you can comment on or make changes to this bug.