IsValidSimpleAssignmentTarget with parenthesized LHS expressions

Isiah Meadows isiahmeadows at
Tue May 2 00:57:26 UTC 2017

Is my understanding correct in interpreting that `((foo)) = 1` is a
valid expression in both strict and sloppy mode, but `({x}) = 1` is

Here's my logic:


This tells me that when the LHS is neither an array nor object literal
pattern, an early error occurs if and only if
IsValidSimpleAssignmentTarget of the left hand side is false.


In the second rule, it gets the covered expression and returns
IsValidSimpleAssignmentTarget of its subexpression.


The covered expression is the expression in parentheses.

- The rules are applied recursively.

After we apply the previous two rules again, finally do
IsValidSimpleAssignmentTarget of the identifier `foo`.


`foo` is neither `arguments` nor `eval`, so
IsValidSimpleAssignmentTarget is true.


So because the rules are applied recursively, and it recurses into
`foo` and `{x}` respectively, it validates the former and invalidates
the latter. Is my reasoning correct in this study? Or did I miss
something important.

In addition, if this is the case, there are two issues I see right off:

1. The recursion does not allow for the obvious extension of `({x}) =
1` as an expression.
2. This is either a spec bug that it's allowed, a spec bug it's not
allowed, or a bug in multiple self-hosted ESTree parsers.


Isiah Meadows
me at

More information about the es-discuss mailing list