1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

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.
This commit is contained in:
Dmitry Gutov 2016-05-11 02:26:54 +03:00
parent fc8a4e0ad4
commit 8d2f78c421
2 changed files with 7 additions and 1 deletions

View 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.")

View File

@ -103,6 +103,12 @@ Foobar
console.log(num);
});
var z = [
...iterableObj,
4,
5
]
var arr = [
-1, 2,
-3, 4 +