branch: master commit 890cf817bbc206b2764c3f96f23613318bd47934 Merge: b176925 a604872 Author: Dmitry Gutov <dgu...@yandex.ru> Commit: GitHub <nore...@github.com>
Merge pull request #434 from lelit/issue420 Attempt to fix issue 420 --- js2-mode.el | 4 ++++ tests/parser.el | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/js2-mode.el b/js2-mode.el index 9b7f7fd..dca862a 100644 --- a/js2-mode.el +++ b/js2-mode.el @@ -7205,6 +7205,10 @@ When STRICT, signal an error if NODE is not one of the expected types." (setq targets (append (js2--collect-target-symbols subexpr strict) targets)))))) + ((js2-assign-node-p node) + (setq targets (append (js2--collect-target-symbols + (js2-assign-node-left node) strict) + targets))) (strict (js2-report-error "msg.no.parm" nil (js2-node-abs-pos node) (js2-node-len node)) diff --git a/tests/parser.el b/tests/parser.el index 181e741..c81ac0b 100644 --- a/tests/parser.el +++ b/tests/parser.el @@ -1255,6 +1255,10 @@ the test." "function foo() { let {a, b, c = 3} = {a: 1, b: 2}; }" '("foo@10:U" "a@23:U" "b@26:U" "c@29:U")) +(js2-deftest-classify-variables destructure-object-missing + "function foo() { let {foo: missing = 10} = {}; }" + '("foo@10:U" "missing@28:U")) + ;; Side effects (js2-deftest no-side-effects-at-top-level