The previous logic for ArrayPattern and ObjectPattern was two strict: every identifier inside these nodes was assumed to be an assignment, but in e.g.({foo: value} = …) and ({foo: value = bar}) only value is being assigned to, not foo or bar. In the new logic, only an ArrayPattern’s elements and an ObjectPattern’s property values are directly tested for assignment; everything else is detected via AssignmentPattern through the outer walk.
Fixes #182.
The previous logic for ArrayPattern and ObjectPattern was two strict: every identifier inside these nodes was assumed to be an assignment, but in e.g.
({foo: value} = …)
and({foo: value = bar})
onlyvalue
is being assigned to, notfoo
orbar
. In the new logic, only an ArrayPattern’s elements and an ObjectPattern’s property values are directly tested for assignment; everything else is detected via AssignmentPattern through the outer walk.