[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5cb52a7 11/38: Merge pull request #454 from olessavluk/tra
From: |
Dmitry Gutov |
Subject: |
[elpa] master 5cb52a7 11/38: Merge pull request #454 from olessavluk/trailing-comma |
Date: |
Wed, 28 Feb 2018 20:12:09 -0500 (EST) |
branch: master
commit 5cb52a7de8218bb2d50f67ba422fa7b2d51d1dc6
Merge: df51992 daed014
Author: Dmitry Gutov <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #454 from olessavluk/trailing-comma
Add support for trailing comma in function arguments
---
NEWS.md | 4 ++++
js2-mode.el | 4 +++-
tests/parser.el | 4 ++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/NEWS.md b/NEWS.md
index 51ff733..dcba655 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,9 @@
# History of user-visible changes
+## Next
+
+* Support for trailing comma in function arguments
+
## 2017-07-21
* Support for async arrow function without parentheses.
diff --git a/js2-mode.el b/js2-mode.el
index 3ce65de..fd1655a 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -10238,7 +10238,9 @@ Returns the list in reverse order. Consumes the
right-paren token."
(js2-unget-token)
(push (js2-parse-assign-expr) result)))
while
- (js2-match-token js2-COMMA))
+ (and (js2-match-token js2-COMMA)
+ (or (< js2-language-version 200)
+ (not (= js2-RP (js2-peek-token))))))
(js2-must-match js2-RP "msg.no.paren.arg")
result)))
diff --git a/tests/parser.el b/tests/parser.el
index ccacd01..173bbe9 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -106,6 +106,10 @@ the test."
(js2-deftest-parse function-statement
"function foo() {\n}")
+(js2-deftest-parse trailing-comma-in-function-arguments
+ "f(a, b,);"
+ :reference "f(a, b);")
+
(js2-deftest-parse function-statement-inside-block
"if (true) {\n function foo() {\n }\n}")
- [elpa] master ba14eb8 16/38: [feat] add jsdoc @abstract and @virtual empty tags, (continued)
- [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, 2018/02/28
- [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 <=
- [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
- [elpa] master 700c024 23/38: Merge pull request #468 from felipeochoa/jsdoc-type, Dmitry Gutov, 2018/02/28
- [elpa] master 5a99c23 20/38: Add tests for jsdoc highlighting, Dmitry Gutov, 2018/02/28