lexical for-in/for-of loose end

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Jan 31 10:19:57 PST 2012


On Jan 31, 2012, at 10:09 AM, Brendan Eich wrote:

>> Allen Wirfs-Brock <mailto:allen at wirfs-brock.com>
>> January 31, 2012 8:43 AM
>> On Jan 31, 2012, at 8:36 AM, Brendan Eich wrote:
>>>  Let's see how easy it is to split the 'var' and 'let/const' cases...
>> 
>> already done
> 
> In the latest draft on the wiki? I thought I had downloaded that already.
>>> But you could make a twisted argument for an effect-ful 'let' initialization expression also being "useful" in this way. We mustn't go there.
>> 
>> might be "useful", but it would break the scoping rules.
> 
> No, I meant this:
> 
>  let i = 42, j = 3;
>  for (let x = i *= j in {});
> 
> No iterations, x not in scope after -- but i is 126 after. Do Not Want (the initialiser).

 for the same effec:

 let i = 42, j = 3;
 for (let x  in (i *= j ,{}));

Allen





More information about the es-discuss mailing list