emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 173d1c8 101/110: Merge pull request #332 from bolivier/mas


From: Dmitry Gutov
Subject: [elpa] master 173d1c8 101/110: Merge pull request #332 from bolivier/master
Date: Thu, 23 Jun 2016 01:13:03 +0000 (UTC)

branch: master
commit 173d1c84078afa9d0ee72d2b641354860793905f
Merge: 910520e 12586e5
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Merge pull request #332 from bolivier/master
    
    Allow space before global declaration
---
 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 9515e27..238440c 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -7264,7 +7264,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 40957f6..09a60a9 100644
--- a/tests/externs.el
+++ b/tests/externs.el
@@ -42,6 +42,13 @@
     (should (equal (js2-get-jslint-globals)
                    '("quux" "tee" "$")))))
 
+(ert-deftest js2-finds-jslint-globals-with-space ()
+  (with-temp-buffer
+    (insert "/* global foo, bar:false, baz:true")
+    (js2-mode)
+    (should (equal (js2-get-jslint-globals)
+                   '("foo" "bar" "baz")))))
+
 ;;;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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]