Thanks, Brendan!

> This lines up with what Luke Hoban presented at the last TC39 meeting. So
> far, so good (but not a done deal by any means, of course). The main bone
> of contention is the use of ! in promises future-proposed syntax.


"!" won't work, in my opinion.  Besides being an eyesore, it is unfriendly
to chaining because of the newline restrictions required by ASI.  E.g. this
won't work as expected:

    getSomethingAsync()
    !method1()
    !method2()
    !etc();



>  The hard part is arrow functions.  One possibility would be to use
>> another cover grammar and place the modifier to the left of the arrow
>> function:
>>
>>     modifier [NoNewLine] Identifier =>
>>     modifier [NoNewLine] ArgumentList =>
>>
>
> We could do this.
>
>
Don't need the newline restriction in the second rule:

    modifier [NoNewLine] Identifier =>
    modifier ArgumentList =>

I was able to generically implement this syntax without too much trouble
[1].  Allowing default initializers in the arrow function head makes me
nervous though, given Javascript's context-sensitive tokenization.  Do you
think that was a mistake?

In any case, I think this is the way to go for generic function modifiers!

I'll post some other feedback regarding async functions in the near future.

[1]: https://github.com/zenparsing/es6parse
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to