Closed plumlee closed 11 years ago
Far as I can tell, js3-mode fails to properly handle the :true or :false when applied to an item in the list of global variables. I'm far from a lisp expert, but the main code in question seems to be here:
(let ((btext (replace-regexp-in-string "[\n\t ]+" " " (buffer-substring-no-properties 1 (buffer-size)) t t))) (setq js3-additional-externs (nconc js3-additional-externs (split-string (if (string-match "/\\* *global \\(.*?\\)\\*/" btext) (match-string-no-properties 1 btext) "") "[ ,]+" t))))
Seems that the items in the /global / declaration are only correctly parsed w/o the :true or :false.
Example code that fails to detect 'define' as a pre-defined global:
/*global require, define:true */ require(['foo'], function() { define('bar', function () { return true; }); });
Let me know if that does it
Far as I can tell, js3-mode fails to properly handle the :true or :false when applied to an item in the list of global variables. I'm far from a lisp expert, but the main code in question seems to be here:
Seems that the items in the /global / declaration are only correctly parsed w/o the :true or :false.
Example code that fails to detect 'define' as a pre-defined global: