[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 92a8857 23/31: Support async arrow function without parent
From: |
Dmitry Gutov |
Subject: |
[elpa] master 92a8857 23/31: Support async arrow function without parentheses |
Date: |
Fri, 21 Jul 2017 09:04:58 -0400 (EDT) |
branch: master
commit 92a8857c7b99c6469434c2c4ae0f0f8fe29e2a47
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Support async arrow function without parentheses
Fixes #433.
---
NEWS.md | 1 +
js2-mode.el | 7 +++++--
tests/parser.el | 3 +++
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index 587fe0d..bdf52ae 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
## Next
+* Support async arrow function without parentheses.
* Support for trailing commas in function parameter lists.
## 2017-01-16
diff --git a/js2-mode.el b/js2-mode.el
index d7977e5..9b7f7fd 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -9890,8 +9890,11 @@ If NODE is non-nil, it is the AST node associated with
the symbol."
(js2-record-imenu-functions right left))
;; do this last so ide checks above can use absolute positions
(js2-node-add-children pn left right))
- ((and (= tt js2-ARROW)
- (>= js2-language-version 200))
+ ((and (>= js2-language-version 200)
+ (or
+ (= tt js2-ARROW)
+ (and async-p
+ (= (js2-peek-token) js2-ARROW))))
(js2-ts-seek ts-state)
(when async-p
(js2-record-face 'font-lock-keyword-face)
diff --git a/tests/parser.el b/tests/parser.el
index 65cb209..181e741 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -501,6 +501,9 @@ the test."
(js2-deftest-parse async-arrow-function-expression
"a = async (b) => { b;\n};")
+(js2-deftest-parse async-arrow-function-without-parens
+ "a = async b => 3;" :reference "a = async (b) => {3};")
+
(js2-deftest-parse async-method-in-object-literal
"({async f() {}});")
- [elpa] master 908395e 11/31: Allow trailing comma in param list (#410), (continued)
- [elpa] master 908395e 11/31: Allow trailing comma in param list (#410), Dmitry Gutov, 2017/07/21
- [elpa] master 659f683 14/31: Merge pull request #421 from raxod502/feat/C-M-j, Dmitry Gutov, 2017/07/21
- [elpa] master 8a5f492 20/31: Merge pull request #425 from shicks/jsdoc, Dmitry Gutov, 2017/07/21
- [elpa] master d3b31ba 10/31: js2-node-qname-component: Nandle computed properties, Dmitry Gutov, 2017/07/21
- [elpa] master 4a87822 13/31: Map C-M-j to js2-line-break, Dmitry Gutov, 2017/07/21
- [elpa] master ca7df5b 16/31: Merge branch 'master' of github.com:mooz/js2-mode, Dmitry Gutov, 2017/07/21
- [elpa] master b3f74f0 19/31: Fix jsdoc highlighting for tags w/ optional braces, Dmitry Gutov, 2017/07/21
- [elpa] master 9ce2542 07/31: Add support for ES7 class public fields, Dmitry Gutov, 2017/07/21
- [elpa] master 7349309 21/31: Add tests for `/*jslint*/` declarations, Dmitry Gutov, 2017/07/21
- [elpa] master b176925 24/31: Update NEWS.md, Dmitry Gutov, 2017/07/21
- [elpa] master 92a8857 23/31: Support async arrow function without parentheses,
Dmitry Gutov <=
- [elpa] master 890cf81 27/31: Merge pull request #434 from lelit/issue420, Dmitry Gutov, 2017/07/21
- [elpa] master 558f53f 22/31: Merge pull request #358 from JulianKniephoff/master, Dmitry Gutov, 2017/07/21
- [elpa] master cb57d9b 30/31: Bump the version, Dmitry Gutov, 2017/07/21
- [elpa] master a604872 26/31: Recognize initialized variable in destructuring object assignment, Dmitry Gutov, 2017/07/21
- [elpa] master f1badee 18/31: Replace (equal nil ...) with (null ...), Dmitry Gutov, 2017/07/21
- [elpa] master 2c459c6 29/31: Merge pull request #436 from felipeochoa/issue429, Dmitry Gutov, 2017/07/21
- [elpa] master 3df50ab 17/31: Add option js2-getprop-has-side-effects (#424), Dmitry Gutov, 2017/07/21
- [elpa] master 867919e 28/31: Always consider `await` to have side-effects, Dmitry Gutov, 2017/07/21
- [elpa] master 97d27d6 15/31: Put the visitor and printer properties on unprefixed symbols as well, Dmitry Gutov, 2017/07/21
- [elpa] master 231ac7f 31/31: Merge commit 'cb57d9b67390ae3ff70ab64169bbc4f1264244bc' from js2-mode, Dmitry Gutov, 2017/07/21