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

Re: [jslint] use strict

Expand Messages
  • Joshua Bell
    ... This post has a reasonable summary: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ In browsers today, the use strict directive does nothing.
    Message 1 of 7 , Nov 3, 2010
    • 0 Attachment
      On Wed, Nov 3, 2010 at 6:34 AM, James <jacob@...> wrote:

      > Yes, I understand. But why should I? If I always drive the speed limit,
      > why should I put a speed regulator on my car? There may very well be a
      > reason, I just want to know what advantage there is for me.


      This post has a reasonable summary:

      http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/

      In browsers today, the use strict directive does nothing.

      In future browsers, the use strict directive will cause subtly different
      behavior in parts of ECMAScript you probably shouldn't be using anyway.
      JSLint attempts to warn you about some of those. Tracking es-discuss, it
      does not appear that there are any fully conforming ES5 implementations, so
      it is not possible to verify that your scripts are, in fact, strict-mode
      compliant. (That is, that they behave as you would expect.)

      IMHO, unless you are aware of the differences to the language that strict
      mode introduces, the safest thing to do at this point is to ask JSLint (or
      similar tools) to look for strict mode violations, but not deploy with a
      "use strict" directive.

      -- Josh


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