[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master df51992 09/38: Fix function/class declaration issues from
From: |
Dmitry Gutov |
Subject: |
[elpa] master df51992 09/38: Fix function/class declaration issues from commit 7e4293b |
Date: |
Wed, 28 Feb 2018 20:12:09 -0500 (EST) |
branch: master
commit df51992a648c7fb3e441106defdbffa2ef2f020d
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Fix function/class declaration issues from commit 7e4293b
Parse default export functions and classes as statements of
expressions depending on whether the name is present.
Fixes #441.
---
js2-mode.el | 12 +++++++++---
tests/parser.el | 2 +-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index 983c919..3ce65de 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -9045,14 +9045,20 @@ invalid export statements."
(setq from-clause (js2-parse-from-clause))))
((js2-match-token js2-DEFAULT)
(setq default (cond ((js2-match-token js2-CLASS)
- (js2-parse-class-expr))
+ (if (eq (js2-peek-token) js2-NAME)
+ (js2-parse-class-stmt)
+ (js2-parse-class-expr)))
((js2-match-token js2-NAME)
(if (js2-match-async-function)
- (js2-parse-function-expr t)
+ (if (eq (js2-peek-token) js2-NAME)
+ (js2-parse-async-function-stmt)
+ (js2-parse-function-expr t))
(js2-unget-token)
(js2-parse-expr)))
((js2-match-token js2-FUNCTION)
- (js2-parse-function-expr))
+ (if (eq (js2-peek-token) js2-NAME)
+ (js2-parse-function-stmt)
+ (js2-parse-function-expr)))
(t (js2-parse-expr)))))
((or (js2-match-token js2-VAR) (js2-match-token js2-CONST)
(js2-match-token js2-LET))
(setq declaration (js2-parse-variables (js2-current-token-type)
(js2-current-token-beg))))
diff --git a/tests/parser.el b/tests/parser.el
index 25bda07..ccacd01 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -884,7 +884,7 @@ the test."
"export async function f() {\n await f();\n}")
(js2-deftest-parse parse-export-default-async-function-allow-await
- "export default async function f() { await f();\n}")
+ "export default async function f() {\n await f();\n}")
;;; Strings
- [elpa] master dd295e8 13/38: Merge pull request #461 from Fuco1/feature/add-object-property-access-face, (continued)
- [elpa] master dd295e8 13/38: Merge pull request #461 from Fuco1/feature/add-object-property-access-face, Dmitry Gutov, 2018/02/28
- [elpa] master ce540d2 19/38: Merge pull request #465 from felipeochoa/jsdoc-abstract, Dmitry Gutov, 2018/02/28
- [elpa] master ba14eb8 16/38: [feat] add jsdoc @abstract and @virtual empty tags, Dmitry Gutov, 2018/02/28
- [elpa] master 4062ae4 22/38: [bugfix] Mark @type jsdoc tag as a typed tag not an arg tag, Dmitry Gutov, 2018/02/28
- [elpa] master 47dc8f2 25/38: [feat] add @typedef jsdoc highlighting support, Dmitry Gutov, 2018/02/28
- [elpa] master eba9797 26/38: Merge pull request #469 from felipeochoa/jsdoc-typedef, Dmitry Gutov, 2018/02/28
- [elpa] master 32c0491 15/38: Merge pull request #464 from felipeochoa/unary-node-pos, Dmitry Gutov, 2018/02/28
- [elpa] master e481404 27/38: [bugfix] error when parsing malformed namespace import, Dmitry Gutov, 2018/02/28
- [elpa] master ba3263b 28/38: Merge pull request #473 from felipeochoa/namespace-import-error, Dmitry Gutov, 2018/02/28
- [elpa] master 3ec4114 30/38: Explicitly pass the variable instead of relying on dynamic binding, Dmitry Gutov, 2018/02/28
- [elpa] master df51992 09/38: Fix function/class declaration issues from commit 7e4293b,
Dmitry Gutov <=
- [elpa] master 7e4293b 01/38: Parse all default exports as expressions, Dmitry Gutov, 2018/02/28
- [elpa] master 5cb52a7 11/38: Merge pull request #454 from olessavluk/trailing-comma, Dmitry Gutov, 2018/02/28
- [elpa] master a27c9cb 17/38: Fix length of shorthand object property nodes (e.g. `{foo, bar}`), Dmitry Gutov, 2018/02/28
- [elpa] master 29d295a 31/38: Merge pull request #476 from lelit/avoid-dynbind, Dmitry Gutov, 2018/02/28
- [elpa] master a495394 34/38: Do not overwrite POS, Dmitry Gutov, 2018/02/28
- [elpa] master 4e032e6 24/38: Merge pull request #467 from felipeochoa/jsdoc-single-line, Dmitry Gutov, 2018/02/28
- [elpa] master 33c7169 32/38: Port over fix for https://debbugs.gnu.org/23391, Dmitry Gutov, 2018/02/28
- [elpa] master 38e4257 37/38: Release new version, Dmitry Gutov, 2018/02/28
- [elpa] master 8488723 29/38: Merge pull request #466 from mishoo/master, Dmitry Gutov, 2018/02/28
- [elpa] master dfaa145 12/38: Add separate object property access face., Dmitry Gutov, 2018/02/28