]> code.delx.au - gnu-emacs-elpa/commitdiff
Allow space before global declaration
authorBrandon Olivier <brandon.olivier42@gmail.com>
Mon, 2 May 2016 19:14:06 +0000 (14:14 -0500)
committerBrandon Olivier <brandon.olivier42@gmail.com>
Tue, 3 May 2016 16:40:07 +0000 (11:40 -0500)
js2-mode.el
tests/externs.el

index b2efce007d3d0f5590596e28a470874a26d07b12..e804fbbb1c0f1c3a3c640f02857d6bb8631db085 100644 (file)
@@ -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))))
index 40957f600cf85fa3636fb23573562c0a36b9d274..09a60a9d3f9e89cc817696fecae9415316871c45 100644 (file)
     (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