« Return to Thread: optional "function" keyword

Re: optional "function" keyword

by Brendan Eich-2 :: Rate this Message:

| View in Thread

Brendan Eich wrote:
> ShortFunctionExpression:
>     Identifier_opt ( FormalParameterList_opt ) { FunctionBody }
>     Identifier_opt ( FormalParameterList_opt ) IniitialValue

Let's try that again:

ShortFunctionExpression:
     Identifier_opt ( FormalParameterList_opt ) [no LineTerminator here]
{ FunctionBody }
     Identifier_opt ( FormalParameterList_opt ) [no LineTerminator here]
IniitialValue

But of course the second production creates bad ambiguities for all
InitialValue bodies that start with an operator or punctuator that could
be infix as well as prefix: +/-/[ at least.

More work needed. I may write a strawman up. Encourage me!

/be
_______________________________________________
es-discuss mailing list
es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss

 « Return to Thread: optional "function" keyword