From bdf683ec35278f04a8a71bfc27ed8a18dcaabb25 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 16 Aug 2011 17:29:44 +0400 Subject: [PATCH] Do not warn about trailing commas in destructuring assignment arrays Fixes http://code.google.com/p/js2-mode/issues/detail?id=110 --- js2-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js2-mode.el b/js2-mode.el index f94395d09..ec324ba81 100644 --- a/js2-mode.el +++ b/js2-mode.el @@ -9427,7 +9427,7 @@ array-literals, array comprehensions and regular expressions." :len (- js2-ts-cursor pos) :elems (nreverse elems))) (apply #'js2-node-add-children pn (js2-array-node-elems pn)) - (when after-comma + (when (and after-comma (not js2-is-in-lhs)) (js2-parse-warn-trailing-comma "msg.array.trailing.comma" pos elems after-comma))) ;; destructuring binding -- 2.39.2