Question about spec

rasmus ekman rasmus.ekman at
Wed Aug 22 14:17:17 PDT 2007

Just an arbitrary newbie question...
I note that the updated UnaryExpression BNF 
codifies part of the behaviour of ES-262 implementations:

UnaryExpression ->
	| delete PostfixExpression
	| void UnaryExpression
	| typeof UnaryExpression
	| ++ PostfixExpression
	| -- PostfixExpression
	| + UnaryExpression
	| - UnaryExpression

So ++++a is ruled out at syntax level, and -++a is legal while ++-a isn't.
This matches (part of) behaviour of current implementations.

But is ++a++ going to become legal?

In IE ++a++ etc are reported as runtime errors.
Seamonkey code goes directly to MemberExpression after matching ++/--,
is this the intention? If so, why not in spec?

More generally, is there a reason for deferring to runtime 
if it is knowable at parse time that a construct is anyway going to be an error?
(I'm thinking of detail issues like the above, but have no particular
examples at hand where seamonkey defers to runtime)



More information about the Es4-discuss mailing list