Deconstructing assignment and reader/modify/write operands

Allen Wirfs-Brock allen at
Tue Sep 24 11:58:38 PDT 2013

On Sep 24, 2013, at 11:46 AM, Oliver Hunt wrote:

> I'll try to rephrase:
> As I read the spec this is not a syntax error, and so gets delayed to runtime.  Given that we're already doing work to determine whether we should be destructuring (which results in different runtime semantics), it seems we should promote (demote?) <deconstructing lhs> <rwm operator> <expression> to a syntax error -- it seems like it would be an easy typo to make so detecting it earlier would seem a plus.

It is an early error, which is specified via the "IsValidSinpleAssigment" based Early Error rules in 

This follows from the ES5 requirement in clause 16: that says "Attempts to PutValue on any value for which early determination can be made that the value is not a Reference" [is an early error].

IsValidSimpleAssignmentTarget is a formalization of that "early determination".

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list