]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't treat JS spread as contination method call
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 10 May 2016 23:26:54 +0000 (02:26 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 10 May 2016 23:27:46 +0000 (02:27 +0300)
* lisp/progmodes/js.el (js--indent-operator-re):
Allow only one dot (bug#23492).

* test/indent/js.js (default): Add a corresponding example.

lisp/progmodes/js.el
test/indent/js.js

index 48eb3e778e1b8e6bddc67e1a8481ba68ff30de99..f024d397ffb5790bfcdadd6fc13a9c3f2d513c51 100644 (file)
@@ -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.")
 
index 23fae17b3ce58a5f9363e7e8d57ac79a73cbf07e..b40d47b3e5da00254c8fe81551ee1e61daa1b81f 100644 (file)
@@ -103,6 +103,12 @@ Foobar
     console.log(num);
   });
 
+var z = [
+  ...iterableObj,
+  4,
+  5
+]
+
 var arr = [
   -1, 2,
   -3, 4 +