Annex A of 5th Edition
Brendan Eich
brendan at mozilla.com
Thu Sep 6 16:41:12 PDT 2012
Joseph Spencer wrote:
> My apologies on that one. I meant to type the following:
>
> PostfixExpression:
> LeftHandSideExpression [no LineTerminator here] ++
> LeftHandSideExpression [no LineTerminator here] --
>
> PrefixExpression:
> ++ [no LineTerminator here] LeftHandSideExpression
> -- [no LineTerminator here] LeftHandSideExpression
>
> It appears to me that as currently written the following is considered
> valid sytax:
>
> ++++someVar;
Yes, that is goofy. It dates back to ES1 -- if memory serves (and it may
not at this late date), my original Netscape 2 "Mocha" JS engine did not
parse this.
However, I think it may fall out of a desire by Microsoft back in the
ES1 days to support the goofy ability of "host objects" to return
References (ECMA-262 spec term).
> I hadn't thought about es3 compatability though, so I could see the
> reasoning in keeping it as is.
Yeah, engine implementors have no good incentive to tweak here, and some
legitimate fear of a breaking change that would only lose market share.
/be
More information about the es-discuss
mailing list