lexical for-in/for-of loose end

Brendan Eich brendan at mozilla.org
Tue Jan 31 10:25:55 PST 2012


Allen Wirfs-Brock wrote:
>> >  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 ,{}));

So? I wrote "effect" not "scope", now you're defending the unwanted 
degree of side-effecting freedom? :-|.

One can always make expressions have effects. That's not the point. The 
reuse of VariableDeclarationNoIn in 12.6.4 without any refactoring or 
semantic restriction to forbid an initialiser was a mistake. I'm glad to 
get rid of it, but teasing me will cause endless grumpy fear that it 
will live on. :-P

/be


More information about the es-discuss mailing list