Fix scope of let-bound loop variables in for loops

RESOLVED DUPLICATE of bug 854037

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 854037
4 years ago
4 years ago

People

(Reporter: wingo, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
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
dup of bug 854037?
(Reporter)

Comment 3

4 years ago
Indeed; I knew there was one somewhere.  (I searched for "scope", not "binding" :)  Thanks André.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 854037
Blocks: 694100
No longer blocks: 694100
You need to log in before you can comment on or make changes to this bug.