Re: [jslint] use strict
- 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,This post has a reasonable summary:
> 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.
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.
[Non-text portions of this message have been removed]