[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 64ec0a2 14/49: Allow newline in globals declaration
From: |
Dmitry Gutov |
Subject: |
[elpa] master 64ec0a2 14/49: Allow newline in globals declaration |
Date: |
Mon, 16 Jan 2017 15:35:47 +0000 (UTC) |
branch: master
commit 64ec0a26673215e36f89e31d7935f99b731fd03d
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Allow newline in globals declaration
Fixes #373.
---
js2-mode.el | 2 +-
tests/externs.el | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/js2-mode.el b/js2-mode.el
index 1e7f61b..e6d1c00 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -7283,7 +7283,7 @@ are ignored."
when (and (eq 'block (js2-comment-node-format node))
(save-excursion
(goto-char (js2-node-abs-pos node))
- (looking-at "/\\* *global ")))
+ (looking-at "/\\* *global\\(?: \\|$\\)")))
append (js2-get-jslint-globals-in
(match-end 0)
(js2-node-abs-end node))))
diff --git a/tests/externs.el b/tests/externs.el
index 75b93cd..3540f3c 100644
--- a/tests/externs.el
+++ b/tests/externs.el
@@ -49,6 +49,13 @@
(should (equal (js2-get-jslint-globals)
'("foo" "bar" "baz")))))
+(ert-deftest js2-finds-jslint-globals-with-newline ()
+ (with-temp-buffer
+ (insert "/* global\nfoo, bar")
+ (js2-mode)
+ (should (equal (js2-get-jslint-globals)
+ '("foo" "bar")))))
+
;;;TODO
;; ensure that any symbols bound with the import syntax are added to the
extern list
;; ensure that any symbols bound with the export syntax exist in the file scope
- [elpa] master 68db1f5 05/49: Makefile: use -Q to avoid site-lisp loading, (continued)
- [elpa] master 68db1f5 05/49: Makefile: use -Q to avoid site-lisp loading, Dmitry Gutov, 2017/01/16
- [elpa] master 4e5babf 03/49: Merge pull request #345 from jacott/master, Dmitry Gutov, 2017/01/16
- [elpa] master 980eb3d 04/49: Support ES7 exponentiation, Dmitry Gutov, 2017/01/16
- [elpa] master 49f9761 08/49: js2-jsdoc-arg-tag-regexp: Recognize @module, Dmitry Gutov, 2017/01/16
- [elpa] master e45206b 11/49: js2-parse-class: Convert positions to relative for NAME and EXTENDS, too, Dmitry Gutov, 2017/01/16
- [elpa] master bea6942 13/49: Unbind js2-mode-show-node, Dmitry Gutov, 2017/01/16
- [elpa] master c0801b2 12/49: Propertize regexp literals like js-mode does, Dmitry Gutov, 2017/01/16
- [elpa] master 9a8aaa9 28/49: Fix length of name in namespace-import nodes, Dmitry Gutov, 2017/01/16
- [elpa] master 44c289f 24/49: Copy edits, Dmitry Gutov, 2017/01/16
- [elpa] master b6d9301 17/49: Merge pull request #377 from XeCycle/memfn-delete, Dmitry Gutov, 2017/01/16
- [elpa] master 64ec0a2 14/49: Allow newline in globals declaration,
Dmitry Gutov <=
- [elpa] master 2801681 26/49: Fix "pos" argument in template node constructors, Dmitry Gutov, 2017/01/16
- [elpa] master 712dfb0 29/49: Merge pull request #384 from mishoo/master, Dmitry Gutov, 2017/01/16
- [elpa] master df06798 23/49: Merge pull request #378 from JulianKniephoff/include-externs-locally, Dmitry Gutov, 2017/01/16
- [elpa] master 2a79649 33/49: Fix indentation after regexp in js2-old-indent.el, Dmitry Gutov, 2017/01/16
- [elpa] master f450de0 34/49: Handle destructuring assignments when classifying variables, Dmitry Gutov, 2017/01/16
- [elpa] master 90e37cd 45/49: Merge pull request #397 from lelit/issue393, Dmitry Gutov, 2017/01/16
- [elpa] master 9b63a13 16/49: Special methods should allow keywords as names, Dmitry Gutov, 2017/01/16
- [elpa] master 672e2da 07/49: js2-parse-mul-expr: Parse the right operand as exponentiation too, Dmitry Gutov, 2017/01/16
- [elpa] master a91e357 40/49: Create a separate scope for switch statements, Dmitry Gutov, 2017/01/16
- [elpa] master 4d35da5 30/49: Fix the fix (error detection), Dmitry Gutov, 2017/01/16