Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My-Library needs to "use strict" #8

Open
DimitarChristoff opened this issue Oct 30, 2013 · 5 comments
Open

My-Library needs to "use strict" #8

DimitarChristoff opened this issue Oct 30, 2013 · 5 comments

Comments

@DimitarChristoff
Copy link

Not using strict is contrary to best practice advice by Douglas Crockford and other people that seem to know JavaScript well.

🎃

@WebReflection
Copy link

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

@kentaromiura
Copy link

@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.

@WebReflection
Copy link

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

@zivc
Copy link

zivc commented Oct 30, 2013

Is there a jQuery plugin for use strict?

@david-mark
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants