Intentional breaking change in ES6 draft spec?

Brendan Eich brendan at mozilla.com
Fri Jun 14 11:09:54 PDT 2013


Andy Wingo wrote:
> On Fri 14 Jun 2013 04:24, Luke Hoban<lukeh at microsoft.com>  writes:
>
>> (I believe this introduces the only place that "var x" is allowed but
>> cannot have an initializer?).
>
> FWIW, there are similar situations in the same spot of the grammar: "let
> x" can't have an initializer in for-of or for-in, and neither can "var
> x" in for-of.

Right. Again inlining and specializing can win. One may be tempted to 
over-share sub-parsers in JS. That bites back (and indeed did in ES1 
days -- I believe the only reason we allowed an initializer in 
for(var/in) was because JScript did it that way, and Shon wrote the 
grammar down for the spec).

/be


More information about the es-discuss mailing list