lexical for-in/for-of loose end

Brendan Eich brendan at mozilla.org
Tue Jan 31 10:09:52 PST 2012


> 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).

/be


More information about the es-discuss mailing list