NOTE An ExpressionStatement cannot start with an opening curly brace
because that might make it ambiguous with a Block. Also, an
ExpressionStatement cannot start with the function keyword because that
might make it ambiguous with a FunctionDeclaration.
Of course we cannot naively extend the lookahead rejection set to
include ( because that forbids a top level parenthesized expression
statement. One way around this is to refactor the grammar similarly to
what I propose in
to separate InitialValue from AssignmentExpression, and then allow
'function'-free function expressions as alternative right parts for
IniitalValues. Thus you could write such shorthand function expressions
in all places where you can write function expressions today, except
unparenthesized followed by . or [ or another operator (+ might be
useful, or confusing, sporadically).
This also allows us to extend the shorthand syntax to support an
expression body as well as a braced statement list: