Closed Bug 971712 Opened 10 years ago Closed 10 years ago

Fix scope of let-bound loop variables in for loops

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 854037

People

(Reporter: wingo, Unassigned)

Details

SM's implementation of for (let x = 0; x < 10; x++); is obsolete.  The current desugaring is:

 {
   let x;
   for (x = 0; x < 10; x++);
 }

whereas it should create a new binding for "x" on each iteration.

Here's one spec link: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-for-statement-runtime-semantics-labelledevaluation
Indeed; I knew there was one somewhere.  (I searched for "scope", not "binding" :)  Thanks André.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Blocks: es6
No longer blocks: es6
You need to log in before you can comment on or make changes to this bug.