David-Sarah Hopwood wrote: > Mark S. Miller wrote: >> [...] I recommend the per-iteration view. If we can >> agree quickly on per-iteration, then >> >> for (const x = ...) {...x...} >> >> should be allowed in ES3.1 (whether or not const hoists to block >> start). After ES3.1 >> >> for (const i :T[i] = ...) {...; a[i] = function(){...i...}; ...} >> >> would then mean what it should mean. Cool. > > Not so fast :-) Consider: > > for (let i = 0; i < 10; i++) { ... } > > In the "i++", which iteration's 'i' is the LeftHandSideExpression > referring to? Or does this expand to something like: > > let ($i = 0) { > for (; > let (i = $i) {i < 10}; > let (i = $i) {{i++;} $i = i;}} { > let (i = $i) {...}; > } > } > > ?
This expansion is wrong for the case where the body updates i. I'll have to think about it some more. -- David-Sarah Hopwood _______________________________________________ Es-discuss mailing list Es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss