[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 38aa66b 054/110: Do not print trailing semicolon for expor
From: |
Dmitry Gutov |
Subject: |
[elpa] master 38aa66b 054/110: Do not print trailing semicolon for export function and class |
Date: |
Thu, 23 Jun 2016 01:12:57 +0000 (UTC) |
branch: master
commit 38aa66bec00d8d4703da97d8a59ac4c669417545
Author: Carl Lei <address@hidden>
Commit: Carl Lei <address@hidden>
Do not print trailing semicolon for export function and class
---
js2-mode.el | 4 +++-
tests/parser.el | 6 ++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/js2-mode.el b/js2-mode.el
index bf7219a..2e5b210 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -2551,7 +2551,9 @@ so many of its properties will be nil.
(js2-print-from-clause from))
(exports-list
(js2-print-named-imports exports-list)))
- (unless (and default (not (js2-assign-node-p default)))
+ (unless (or (and default (not (js2-assign-node-p default)))
+ (and declaration (or (js2-function-node-p declaration)
+ (js2-class-node-p declaration))))
(insert ";\n"))))
(cl-defstruct (js2-while-node
diff --git a/tests/parser.el b/tests/parser.el
index 79481c8..198e578 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -799,6 +799,12 @@ the test."
(js2-deftest-parse parse-export-generator-declaration "export default
function* one() {\n}")
(js2-deftest-parse parse-export-assignment-expression "export default a = b;")
+(js2-deftest-parse parse-export-function-declaration-no-semi
+ "export function f() {\n}")
+
+(js2-deftest-parse parse-export-class-declaration-no-semi
+ "export class C {\n}")
+
;;; Strings
(js2-deftest-parse string-literal
- [elpa] master e0972fb 048/110: s/will/would, (continued)
- [elpa] master e0972fb 048/110: s/will/would, Dmitry Gutov, 2016/06/22
- [elpa] master d201a30 027/110: Merge pull request #281 from robbyoconnor/patch-1, Dmitry Gutov, 2016/06/22
- [elpa] master 667d320 034/110: Merge pull request #282 from jacksonrayhamilton/js2-jsx-mode, Dmitry Gutov, 2016/06/22
- [elpa] master 29f74b1 040/110: Allow 0o octals in strict mode, Dmitry Gutov, 2016/06/22
- [elpa] master 2a22635 035/110: Support .jsx file extension too in the example, Dmitry Gutov, 2016/06/22
- [elpa] master 4955584 037/110: Merge pull request #278 from redguardtoo/master, Dmitry Gutov, 2016/06/22
- [elpa] master 7c12f2c 031/110: Copy JSX indentation logic to js2-old-indent.el, Dmitry Gutov, 2016/06/22
- [elpa] master d0e4323 046/110: Add NEWS entry for async/await, Dmitry Gutov, 2016/06/22
- [elpa] master 0b1704b 041/110: Merge pull request #284 from XeCycle/0o-octals, Dmitry Gutov, 2016/06/22
- [elpa] master 7abe15e 043/110: Merge pull request #285 from dgreensp/fix-param-destruct, Dmitry Gutov, 2016/06/22
- [elpa] master 38aa66b 054/110: Do not print trailing semicolon for export function and class,
Dmitry Gutov <=
- [elpa] master 4cd81c7 050/110: Exported decls print a little funny; update tests, Dmitry Gutov, 2016/06/22
- [elpa] master 00a455f 009/110: Merge pull request #266 from jacksonrayhamilton/no-getter-setter-duplicate, Dmitry Gutov, 2016/06/22
- [elpa] master 4894200 056/110: Merge pull request #290 from XeCycle/export-async-fn, Dmitry Gutov, 2016/06/22
- [elpa] master 027d546 051/110: Merge pull request #287 from dgreensp/fix-export-decls, Dmitry Gutov, 2016/06/22
- [elpa] master 13f0ffb 042/110: Fix parsing of param with destructure and default, Dmitry Gutov, 2016/06/22
- [elpa] master e48e862 055/110: Also parse async function statement in export node, Dmitry Gutov, 2016/06/22
- [elpa] master e9227bd 058/110: Fix a byte-compilation warning, Dmitry Gutov, 2016/06/22
- [elpa] master 2a904e0 057/110: Implement object literal rest/spread (...), Dmitry Gutov, 2016/06/22
- [elpa] master 8047d7f 061/110: Recognize for-of and for-in loops with const, Dmitry Gutov, 2016/06/22
- [elpa] master 983f20a 072/110: Fix typo, Dmitry Gutov, 2016/06/22