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

Re: [jslint] Strict mode

Expand Messages
  • Dominic Mitchell
    ... You can add it on a per-function basis: function foo() { use strict ; // ... } You can also wrap parts of your code in an anonymous function in order to
    Message 1 of 2 , Jan 10, 2011
      On Mon, Jan 10, 2011 at 2:12 PM, roman_lcf <roman.lcf@...> wrote:

      > We want to not add "use strict" to every our js-file for now, but still
      > take advantage of the strictest JSLint code quality setting.
      > I see 'strict_mode' variable in JSLint source code, but how to set it? Is
      > able to set it through options?
      >
      >
      You can add it on a per-function basis:

      function foo() {
      "use strict";
      // ...
      }

      You can also wrap parts of your code in an anonymous function in order to
      isolate it.

      (function() {
      "use strict";

      function foo() {
      // …
      }
      }());

      -Dom


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