Initializer expression on for-in syntax subject

John Lenz concavelenz at gmail.com
Sat Mar 15 08:39:59 PDT 2014


If we can get uglify and closure compiler to reject it it will go a long
way toward making sure it doesn't crop up in the wild.
On Mar 14, 2014 10:20 PM, "Brendan Eich" <brendan at mozilla.org> wrote:

> Peter van der Zee wrote:
>
>>
>> Which browsers currently don't accept this construct? I wasn't even aware
>> that JSC didn't support it at some point.
>>
>>
> Did anyone say JSC lacked support? I think KJS followed ES3, and this was
> in the ES1 grammar, so I doubt it was never supported.
>
>  Minifiers might rely on this construct. And perhaps some js1k entries, if
>> that matters anything.
>>
>>
> Extremely doubtful. It doesn't save anything. A minifier cannot count on
> the loop iterating 0 times.
>
>  Why is there a desire for banishment anyways? Only lack of consistency
>> compared to not using the var keyword,
>>
>>
> This is only about the 'var' case. The initialiser in 'for (var x = y in
> z)' is due only to reuse of the wrong grammar nonterminal in ES1, based on
> JScript de-facto non-standard behavior. It is a wart and a pain to
> implement. We don't expect it to be hard to remove, unlike other warts, but
> we'll find out.
>
>  or was there a bigger problem with this? The thread comes out of the blue
>> to me so I probably missed a prior discussion :)
>>
>>
> ES6 revised the old grammar dating from ES1, breaking for(var x = y in z).
> That was intentional and discussed in past meetings and threads.
>
> /be
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140315/732820e1/attachment.html>


More information about the es-discuss mailing list