Re: [jslint] Re: /*global */
- While in general I approve of being able to turn off warnings, why do you have "possibly several hundred "var $;" statements"? You would need at most one per file and you only have "several" files.
An alternative to turning off the warning would be to mark every such declaration (e.g. "var $; /* extern */") and then during the minification process, deleting all those lines. You'd get the advantage of being warned about accidental globals without the slow-down in loading.
From: Jakob Kruse <kruse@...>
Sent: Monday, June 1, 2009 10:23:35 AM
Subject: Re: [jslint] Re: /*global */
I also find removing the support for /*global */ to be a major setback.
Please keep support for /*global */.
Just my two cents.
From: pauanyu [mailto:pcxunlimited@...]
Sent: Mon, 01 Jun 2009 18:39:57 +0200
Subject: [jslint] Re: /*global */
--- In firstname.lastname@example.org, "Douglas Crockford" <douglas@...> wrote:
> I will be removing the /*global */ declarative comment. I am persuaded that it is best to explicitly use var to declare all global variables, even when accessing variables created by other compilation units.
> /*global */ will just be a comment.
In answer to people's concerns: I believe the primary reason for this change is that "use strict" mode does not allow implied globals:
Now, rather than writing:
/*global varName */
You simply write:
Disclaimer: I am not Douglas Crockford, so this is merely my own personal speculation on the subject.
Yahoo! Groups Links
[Non-text portions of this message have been removed]
- --- In email@example.com, "pauanyu" <pcxunlimited@...> wrote:
> "name" needs to be writable. It has no value by default,Which do you think is more likely, that a program wants to change the global name, or that a var name declaration in a function was forgotten? We won't get an implied global warning, but at least we can get a read only warning. I think that is the more useful default.
> but you can assign a string to it, indicating the name of
> the window/tab.