Array comprehension syntax

Jason Orendorff jason.orendorff at gmail.com
Sat Sep 22 09:21:49 PDT 2012


On Sat, Sep 22, 2012 at 11:11 AM, Allen Wirfs-Brock
<allen at wirfs-brock.com> wrote:
> 3.  SpiderMonkey already supports this nonstandard syntax:
>        [x for each (x in obj)]
>    A paren-free ES6 array comprehension could begin with a function
>    call, like this:
>        [x for each(x in obj).y of z]
>    Currently SpiderMonkey treats 'each' as a keyword when it
>    appears after the 'for' keyword.
>
> [...]
> There seems to be all sort of complications for the form you suggesting.

I'm sorry for the confusion here.  I didn't mean to propose adding
for-each-in to ES6.  That would indeed be awful.  I just meant that
SpiderMonkey cannot necessarily drop this extension.  So if the ES6
syntax and SpiderMonkey's syntax can't coexist, it will be a problem
for us.

-j


More information about the es-discuss mailing list