Permalink
Browse files

Make global declarations compatible with JSLint and JSHint

Some JavaScript linters doesn't expect whitespace before the global directive.
  • Loading branch information...
1 parent 967e2d9 commit 2d58d135dff021dc5bd2b7e07ea86f5f28abcd9c @osener osener committed Oct 4, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 js3.el
  2. +2 −2 lib/js3-foot.el
View
4 js3.el
@@ -11943,10 +11943,10 @@ it marks the next defun after the ones already marked."
(when (not (member var js3-additional-externs))
(save-excursion
(goto-char 0)
- (when (not (looking-at "^/\\* global "))
+ (when (not (looking-at "^/\\*global "))
(newline 1)
(forward-line -1)
- (insert "/* global */")
+ (insert "/*global*/")
(goto-char 0))
(if (not (re-search-forward "[*]/" nil t))
(message "Invalid global declaration")
View
@@ -1298,10 +1298,10 @@ it marks the next defun after the ones already marked."
(when (not (member var js3-additional-externs))
(save-excursion
(goto-char 0)
- (when (not (looking-at "^/\\* global "))
+ (when (not (looking-at "^/\\*global "))
(newline 1)
(forward-line -1)
- (insert "/* global */")
+ (insert "/*global*/")
(goto-char 0))
(if (not (re-search-forward "[*]/" nil t))
(message "Invalid global declaration")

0 comments on commit 2d58d13

Please sign in to comment.