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

2251Re: function_strict warning and CommonJS modules

Expand Messages
  • Douglas Crockford
    Jun 3, 2011
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "mariuszn3" <medikoo.yahxo.com@...> wrote:
      > Sorry, if I wasn't clear enough.
      > It's about this warning:
      > "Use the function form of 'use strict'."
      > I use JSLint against modules I write for Node.js (modules according to CommonJS spec).
      > Module is file that is handled in Node.js differently than file in browser.
      > Each module is executed in it's own sandbox (as if it was anonymous function instantly executed).
      > So what I meant is that in that case, when I put 'use strict' at begin of file, this warning doesn't make sense. Implications of using 'use strict' in global mode doesn't apply to this case, as it doesn't invoke strict mode in global mode.
      > It would be good to have an option to turn off this warning and make it by default off for node mode, with current version of JSLint I cannot turn off this warning.

      When using the Assume node.js option, JSLint will now tolerate the file level use strict pragma.

      I think you would be smarter to use the function use strict pragma.
    • Show all 9 messages in this topic