1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-13 16:38:14 +00:00

Don't mistake certain JS method calls for keywords

* lisp/progmodes/js.el (js--ctrl-statement-indentation):
Braceless keyword can't come after a period (bug#22063).
This commit is contained in:
Dmitry Gutov 2015-12-01 05:40:57 +02:00
parent 49689a415c
commit 48471e9614
2 changed files with 15 additions and 0 deletions

View File

@ -1823,6 +1823,7 @@ nil."
(skip-syntax-backward " ")
(skip-syntax-backward "w_")
(looking-at js--possibly-braceless-keyword-re))
(memq (char-before) '(?\s ?\t ?\n ?\}))
(not (js--end-of-do-while-loop-p))))
(save-excursion
(goto-char (match-beginning 0))

View File

@ -76,6 +76,20 @@ class A {
}
}
if (true)
1
else
2
Foobar
.find()
.catch((err) => {
return 2;
})
.then((num) => {
console.log(num);
});
// Local Variables:
// indent-tabs-mode: nil
// js-indent-level: 2