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

Re: node:true masks 'use strict' outside function

Expand Messages
  • mariuszn3
    As Douglas said, if you turn on node option it means that you re validating file which is CommonJS module, which will not be run in global scope but in it s
    Message 1 of 4 , Jul 14, 2011
    • 0 Attachment
      As Douglas said, if you turn on 'node' option it means that you're validating file which is CommonJS module, which will not be run in global scope but in it's own sandbox (same if it was wrapped with anonymous function) that's why this warning shouldn't appear.

      Anyway it'll be good to have separate 'module' option for that, as CommonJS modules are not specific only to Node.js, but I'll brag about it later in another post :)

      --- In jslint_com@yahoogroups.com, Marcos Zanona <marcos@...> wrote:
      >
      > 'use strict';
      > function test() {
      > return 2 + 2;}
      >
      > with node: false
      >
      > Error: Problem at line 1 character 1: Use the function form of 'use strict'.
      > 'use strict';
      >
      > with node: true
      >
      > ok
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • Marcos Zanona
      that was a good explanation, thanks so much it makes a lot of sense :) [Non-text portions of this message have been removed]
      Message 2 of 4 , Jul 14, 2011
      • 0 Attachment
        that was a good explanation, thanks so much it makes a lot of sense :)


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.