From: Dmitry Gutov Date: Tue, 10 May 2016 23:26:54 +0000 (+0300) Subject: Don't treat JS spread as contination method call X-Git-Tag: emacs-25.0.94~14 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8d2f78c;p=emacs.git Don't treat JS spread as contination method call * lisp/progmodes/js.el (js--indent-operator-re): Allow only one dot (bug#23492). * test/indent/js.js (default): Add a corresponding example. --- diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 48eb3e778e1..f024d397ffb 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1744,7 +1744,7 @@ This performs fontification according to `js--class-styles'." "Regular expression matching variable declaration keywords.") (defconst js--indent-operator-re - (concat "[-+*/%<>&^|?:.]\\([^-+*/]\\|$\\)\\|!?=\\|" + (concat "[-+*/%<>&^|?:.]\\([^-+*/.]\\|$\\)\\|!?=\\|" (js--regexp-opt-symbol '("in" "instanceof"))) "Regexp matching operators that affect indentation of continued expressions.") diff --git a/test/indent/js.js b/test/indent/js.js index 23fae17b3ce..b40d47b3e5d 100644 --- a/test/indent/js.js +++ b/test/indent/js.js @@ -103,6 +103,12 @@ Foobar console.log(num); }); +var z = [ + ...iterableObj, + 4, + 5 +] + var arr = [ -1, 2, -3, 4 +