aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2016-05-11 02:26:54 +0300
committerDmitry Gutov2016-05-11 02:27:46 +0300
commit8d2f78c421c73730f344dbf71dbed61d5ef8e46d (patch)
tree11ec8e2e941034e9bef5bc75c445d8d57a65f7a4
parentfc8a4e0ad44667cff79750946ebc695968e95b01 (diff)
downloademacs-8d2f78c421c73730f344dbf71dbed61d5ef8e46d.tar.gz
emacs-8d2f78c421c73730f344dbf71dbed61d5ef8e46d.zip
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.
-rw-r--r--lisp/progmodes/js.el2
-rw-r--r--test/indent/js.js6
2 files changed, 7 insertions, 1 deletions
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'."
1744 "Regular expression matching variable declaration keywords.") 1744 "Regular expression matching variable declaration keywords.")
1745 1745
1746(defconst js--indent-operator-re 1746(defconst js--indent-operator-re
1747 (concat "[-+*/%<>&^|?:.]\\([^-+*/]\\|$\\)\\|!?=\\|" 1747 (concat "[-+*/%<>&^|?:.]\\([^-+*/.]\\|$\\)\\|!?=\\|"
1748 (js--regexp-opt-symbol '("in" "instanceof"))) 1748 (js--regexp-opt-symbol '("in" "instanceof")))
1749 "Regexp matching operators that affect indentation of continued expressions.") 1749 "Regexp matching operators that affect indentation of continued expressions.")
1750 1750
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
103 console.log(num); 103 console.log(num);
104 }); 104 });
105 105
106var z = [
107 ...iterableObj,
108 4,
109 5
110]
111
106var arr = [ 112var arr = [
107 -1, 2, 113 -1, 2,
108 -3, 4 + 114 -3, 4 +