[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/js2-mode 515d876 27/61: Fix parsing static props withou
From: |
Dmitry Gutov |
Subject: |
[elpa] externals/js2-mode 515d876 27/61: Fix parsing static props without semicolons |
Date: |
Sun, 20 Dec 2020 12:20:03 -0500 (EST) |
branch: externals/js2-mode
commit 515d876c6ae45a61cf67a7bd5723fe4c9e518756
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Fix parsing static props without semicolons
Fixes #477
---
js2-mode.el | 8 ++++++++
tests/parser.el | 3 +++
2 files changed, 11 insertions(+)
diff --git a/js2-mode.el b/js2-mode.el
index 64cc72c..924bc03 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -10960,6 +10960,14 @@ expression)."
elem-key-string previous-elem-key-string
after-comma previous-token)
(while continue
+ ;; Clear out any lookahead tokens (possibly wrong modifier).
+ ;; FIXME: Deal with this problem in a more systematic fashion.
+ ;; Perhaps by making this modifier affect not how the token
+ ;; struct is constructed, but when js2-get-token returns based
+ ;; on it.
+ (when (> js2-ti-lookahead 0)
+ (setq js2-ti-lookahead 0)
+ (setq js2-ts-cursor (js2-current-token-end)))
(setq tt (js2-get-prop-name-token)
static nil
elem nil
diff --git a/tests/parser.el b/tests/parser.el
index c87fa5f..2ad8b62 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -982,6 +982,9 @@ the test."
(js2-deftest-parse parse-class-public-field-computed
"class C {\n [a + b] = c\n}")
+(js2-deftest-parse parse-class-static-fields-no-semi
+ "class C {\n static a\n static b = 42\n}")
+
;;; Operators
(js2-deftest-parse exponentiation
- [elpa] externals/js2-mode 41ca3ad 14/61: Reference latest revision of the commentary, (continued)
- [elpa] externals/js2-mode 41ca3ad 14/61: Reference latest revision of the commentary, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 037bcf7 16/61: Clarify what is likely to fail, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode e785721 17/61: Reference latest revision of the commentary, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode d9bba5b 12/61: Update recommendations for using JSX with respect to Emacs 27, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 6cc0a8a 15/61: Merge paragraphs so the information reads better, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 14113fe 18/61: Remove date, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 8e2cdd4 19/61: Revert extra added information, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode bb73461 20/61: Revert doc changes and explain JSX options for all emacsen later, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 3a80b00 25/61: use type face for class, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 9837d78 28/61: Fix ‘huge-hex’ test for newer Emacsen., Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 515d876 27/61: Fix parsing static props without semicolons,
Dmitry Gutov <=
- [elpa] externals/js2-mode 61a8c91 29/61: Merge pull request #550 from phst/huge-hex, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 997d6bd 30/61: Avoid undefined behavior in indentation tests., Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 999c0e7 22/61: Merge pull request #531 from jacksonrayhamilton/jsx-documentation, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 2d2fb4b 21/61: Reference latest revision of the commentary, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 146c1f6 32/61: Migrate off deprecated ‘cl’ library., Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode d642b7b 34/61: Remove an unused variable, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 8841175 23/61: support optional-chaining operator, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode b3841a7 24/61: Merge pull request #533 from redguardtoo/master, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 1a5dee9 38/61: Merge pull request #552 from phst/cl, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode a6e1305 41/61: Merge pull request #555 from phst/unused-arg, Dmitry Gutov, 2020/12/20