emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master c0e0309 022/110: Allow semicolons in a class body


From: Dmitry Gutov
Subject: [elpa] master c0e0309 022/110: Allow semicolons in a class body
Date: Thu, 23 Jun 2016 01:12:53 +0000 (UTC)

branch: master
commit c0e03098ad8fb3496f2ad7ff63b7ae4ac7f817fa
Author: Carl Lei <address@hidden>
Commit: Carl Lei <address@hidden>

    Allow semicolons in a class body
---
 js2-mode.el     |    4 ++++
 tests/parser.el |    3 +++
 2 files changed, 7 insertions(+)

diff --git a/js2-mode.el b/js2-mode.el
index c98917c..865f287 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -10649,6 +10649,10 @@ expression)."
         (if after-comma
             (js2-parse-warn-trailing-comma "msg.extra.trailing.comma"
                                            pos elems after-comma)))
+       ;; Skip semicolons in a class body
+       ((and class-p
+             (= tt js2-SEMI))
+        nil)
        (t
         (js2-report-error "msg.bad.prop")
         (unless js2-recover-from-parse-errors
diff --git a/tests/parser.el b/tests/parser.el
index 650bac8..c65be2c 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -766,6 +766,9 @@ the test."
 (js2-deftest-parse parse-class-keywordlike-method
   "class C {\n  delete() {}\n  if() {}\n}")
 
+(js2-deftest-parse parse-harmony-class-allow-semicolon-element
+  "class Foo {;}" :reference "class Foo {\n}")
+
 ;;; Scopes
 
 (js2-deftest ast-symbol-table-includes-fn-node "function foo() {}"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]