Arrow functions and return values
Peter van der Zee
ecma at qfox.nl
Thu Nov 29 02:58:10 PST 2012
On Thu, Nov 29, 2012 at 10:32 AM, Brendan Eich <brendan at mozilla.com> wrote:
> You would need a second ; after b * c; to spell the empty statement.
Interesting fact actually, it would mean the empty statement is no
longer a NOOP. It can actually alter a program. I can't think of a
situation where this is the case in es5, not counting preventing
syntactical errors. But with implicit return values, the empty
statement could make the difference.
Not sure if this is a problem, just noting that it seems to be a
change, one that'll be hard to debug for once implicit returns are
heavily used. OTOH people might be tempted to "optimize" functions by
adding an empty statement at the end. Or something.
More information about the es-discuss