Loading ...
Sorry, an error occurred while loading the content.

[jslint] Re: /*global */

Expand Messages
  • pauanyu
    ... I seem to be missing something here. Why are people okay with writing: /*global $ */ But not: var $; This is very perplexing to me. Why would you choose a
    Message 1 of 34 , Jun 1, 2009
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Jakob Kruse" <kruse@...> wrote:
      >
      > I also find removing the support for /*global */ to be a major setback.
      >
      > Combining several JavaScript files into one for deployment is somewhat a must. In most of the applications I work on such a file would include possibly several hundred "var $;" statements. That's obviously unacceptable, so we would effectively have to stop using JSLint if this was enforced. If it was an option we would always turn it off, regardless of the reasoning behind it.
      >
      > Please keep support for /*global */.
      >
      > Just my two cents.
      >
      > /Jakob
      >

      I seem to be missing something here. Why are people okay with writing:
      /*global $ */

      But not:
      var $;

      This is very perplexing to me. Why would you choose a more verbose and unnecessary syntax that is unsupported by ES5 strict-mode?
    • Douglas Crockford
      ... 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
      Message 34 of 34 , Jun 12, 2009
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "pauanyu" <pcxunlimited@...> wrote:
        > "name" needs to be writable. It has no value by default,
        > but you can assign a string to it, indicating the name of
        > the window/tab.

        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.
      Your message has been successfully submitted and would be delivered to recipients shortly.