[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master b576cef 097/110: Declare vars created with renaming destru
From: |
Dmitry Gutov |
Subject: |
[elpa] master b576cef 097/110: Declare vars created with renaming destructuring |
Date: |
Thu, 23 Jun 2016 01:13:03 +0000 (UTC) |
branch: master
commit b576cef1e8751b6ceb7532e2ab833b551fc46860
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Declare vars created with renaming destructuring
Fixes regression from 0555a8a3.
---
js2-mode.el | 12 ++++++++++--
tests/parser.el | 3 ++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index 00be32c..b2efce0 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -8100,11 +8100,19 @@ declared; probably to check them for errors."
(dolist (elem (js2-object-node-elems node))
;; js2-infix-node-p catches both object prop node and initialized
;; binding element (which is directly an infix node).
- (when (js2-infix-node-p elem)
+ (cond
+ ((js2-object-prop-node-p elem)
+ (push (js2-define-destruct-symbols
+ ;; In abbreviated destructuring {a, b}, right == left.
+ (js2-object-prop-node-right elem)
+ decl-type face ignore-not-in-block)
+ name-nodes))
+ ;; Destructuring with default argument.
+ ((js2-infix-node-p elem)
(push (js2-define-destruct-symbols
(js2-infix-node-left elem)
decl-type face ignore-not-in-block)
- name-nodes)))
+ name-nodes))))
(apply #'append (nreverse name-nodes)))
((js2-array-node-p node)
(dolist (elem (js2-array-node-elems node))
diff --git a/tests/parser.el b/tests/parser.el
index 4a8c9c3..b546c1c 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -188,7 +188,8 @@ the test."
:warnings-count 0)
(js2-deftest-parse destruct-in-arguments
- "function f({a: aa, b: bb}) {\n}")
+ "function f({a: aa, b: bb}) {\n}"
+ :warnings-count 0)
(js2-deftest-parse destruct-in-array-comp-loop
"[a + b for ([a, b] in [[0, 1], [1, 2]])];")
- [elpa] master 983f20a 072/110: Fix typo, (continued)
- [elpa] master 983f20a 072/110: Fix typo, Dmitry Gutov, 2016/06/22
- [elpa] master f8248df 066/110: Record class declarations for IMenu, Dmitry Gutov, 2016/06/22
- [elpa] master d92e772 069/110: Fix async parsing, Dmitry Gutov, 2016/06/22
- [elpa] master 5c97dce 002/110: Fix typo; Refs #185, Dmitry Gutov, 2016/06/22
- [elpa] master 97065c8 075/110: Fix compiler warning, Dmitry Gutov, 2016/06/22
- [elpa] master 849e061 081/110: js2-indent-operator-re, js2-declaration-keyword-re: Use symbols boundaries, Dmitry Gutov, 2016/06/22
- [elpa] master b2af331 083/110: Special-case unary + and -, Dmitry Gutov, 2016/06/22
- [elpa] master 7e7b6da 076/110: Simplify await parsing, Dmitry Gutov, 2016/06/22
- [elpa] master b57d129 077/110: Merge pull request #304 from jacksonrayhamilton/fix-void-async-await, Dmitry Gutov, 2016/06/22
- [elpa] master 645d129 078/110: Add support for JSDoc @callback, @func and @method tags, Dmitry Gutov, 2016/06/22
- [elpa] master b576cef 097/110: Declare vars created with renaming destructuring,
Dmitry Gutov <=
- [elpa] master 12586e5 098/110: Allow space before global declaration, Dmitry Gutov, 2016/06/22
- [elpa] master 910520e 100/110: Merge pull request #333 from daniellandau/master, Dmitry Gutov, 2016/06/22
- [elpa] master 5ebc7b8 099/110: Change warning message to not conflict with spec, Dmitry Gutov, 2016/06/22
- [elpa] master ae3ed93 102/110: Backport for fix for #335, Dmitry Gutov, 2016/06/22
- [elpa] master fa419df 093/110: Merge pull request #327 from XeCycle/ckw-as, Dmitry Gutov, 2016/06/22
- [elpa] master b78d224 045/110: Parse async methods, Dmitry Gutov, 2016/06/22
- [elpa] master 5f00a97 059/110: Use SVG for Travis CI badge, Dmitry Gutov, 2016/06/22
- [elpa] master 4fc6ef8 064/110: js2-class-node: Inherit from js2-object-node, Dmitry Gutov, 2016/06/22
- [elpa] master ae922a3 067/110: Remove js2-make-await as unused, Dmitry Gutov, 2016/06/22
- [elpa] master 502c14a 003/110: Use = instead of eq; Refs #185, Dmitry Gutov, 2016/06/22