Use syntactic parameter for AssignmentExpression
kanghao.lkh at alibaba-inc.com
Thu Aug 7 10:53:08 PDT 2014
I have met at least one ES6 enthusiast who found AssignmentExpression
difficult to understand while trying to learn more about arrow
functions. Can we replace all uses of AssignmentExpression except one or
two to say, Expression[nocomma]?
Even better, if spec-wise backwards compatibility is not a problem,
could we just replace AssignmentExpression by Expression and the current
Expression by Expression[comma]. I think it better matches the mental
model of a normal programmer like me. Also, Java doesn't seem to allow
top level comma in Expression at all.
Speaking of which, shouldn't we use AssignmentExpression for
TemplateLiteral instead of Expression? It's not like we must parse a
full Expression within a balancing pair (we only allow
AssignmentExpression between '?' ':', unlike C and C++). Leaving
an extention point there for the future seems better. What do you think?
More information about the es-discuss