Re: In ES6, do for loops with a let/const initializer create a separate scope?

2014-06-16 Thread Allen Wirfs-Brock
On Jun 16, 2014, at 11:29 AM, Michael Zhou wrote: > Thanks for the clarification, one detail about the order between incrementing > and setting $$lastIteration_i: > { >let i = $$lastIteration_i; //create and initialize per iteration i >if (!(i<10)) break; > { > let i; >} >

Re: Re: In ES6, do for loops with a let/const initializer create a separate scope?

2014-06-16 Thread Michael Zhou
Thanks for the clarification, one detail about the order between incrementing and setting $$lastIteration_i: { let i = $$lastIteration_i; //create and initialize per iteration i if (!(i<10)) break; { let i; } *i++; $$lastIteration_i = i;* } Should it be* $$lastIteratio

Re: In ES6, do for loops with a let/const initializer create a separate scope?

2014-06-16 Thread Andreas Rossberg
On 13 June 2014 18:23, Allen Wirfs-Brock wrote: > We could consider special cases loop bodies that are BlockStatements and > statically reject those that contain declaration that shadow the loop > declarations. However, I think it is probably best to leave that sort of > check for linters to p

Re: In ES6, do for loops with a let/const initializer create a separate scope?

2014-06-13 Thread Allen Wirfs-Brock
On Jun 12, 2014, at 12:50 PM, Michael Zhou wrote: > In other words, is > for (let i = 0; i < 10; i++) { > let i; > } > > legal? I feel it is, but I'm not sure if the specs has made that clear. > Thanks! The above is legal according to the current ES6 spec. draft. The let in the loop body b

In ES6, do for loops with a let/const initializer create a separate scope?

2014-06-12 Thread Michael Zhou
In other words, is for (let i = 0; i < 10; i++) { let i; } legal? I feel it is, but I'm not sure if the specs has made that clear. Thanks! ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss