My-Library
My-Library copied to clipboard
My-Library needs to "use strict"
Not using strict is contrary to best practice advice by Douglas Crockford and other people that seem to know JavaScript well.
:jack_o_lantern:
although "use strict" is known to have undesired side effects such as slowing down parsing and in some case execution. It was stated in es-discuss that this directive wasn't created to improve performance. #justmy2cents
@WebReflection I think the directive can be useful though for avoiding malicious code that rely on eval or similar to override the Object or the Function constructor and act as a rootkit basically stealing informations, this applies only to a very little cases, when one can run js before your script (well actually even after in some cases), passing codes as a string.
Obviously this sort of protection applies only on browser which supports the use strict directive. http://caniuse.com/#feat=use-strict.
And that mean that your server is still compromise at that point.
if it's about security, use strict removes the possibility to obtain the real window through function(){return this}() too but the bug was opened just because Mr. D Crock thinks is something everyone should use.
All I was trying to say is that, performance a part that could be slightly compromised and AFAIK this library is famous for being the fastest out there, there might be reasons to not use that directive.
JSLint ain't a good reason to put everything under use strict. Then it's not my business, so I just read the tweet and commented as I felt ;-)
Off this thread now, all the best
Is there a jQuery plugin for use strict?
Dimitar: Crockford knows JS, but not cross-browser scripting. Common sense says that the library does not need "use strict". And thanks WebReflection. I agree with you on this one. zivc: No.