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

remove strict mode #5259

Closed
wants to merge 1 commit into from
Closed

remove strict mode #5259

wants to merge 1 commit into from

Conversation

zeke
Copy link
Contributor

@zeke zeke commented Apr 22, 2016

As of Chromium 49, use strict is no longer required for const and let.

@miniak
Copy link
Contributor

miniak commented Apr 22, 2016

Why would you want to remove strict mode? It's not just about let/const.

@zeke
Copy link
Contributor Author

zeke commented Apr 23, 2016

Good question, @miniak. I've always seen 'use strict' as a cumbersome way to access newer JavaScript features, but you're absolutely right that it could be providing some protection against erroneous code.

I think most of the protections we get from use strict are covered by standard's eslint config.

There is a fork of standard called strict-standard that I found via standard/standard#382. I tried to run it on this branch but I couldn't get it to work.

@anaisbetts
Copy link
Contributor

I would like to remove this from the documentation at least for sure, it's just clutter

@zcbenz
Copy link
Member

zcbenz commented Apr 24, 2016

The usages of use strict was only introduced in Electron recently when converting CoffeeScript files to JavaScript while trying to use some syntactic sugar, so currently not all files have it, and it has been there for only a very short time. Using strict mode has other benefits though, like it allows V8 to do better optimizations.

I'm good with either keeping use strict or removing it, as long as we are consistent in all files.

@miniak
Copy link
Contributor

miniak commented Apr 24, 2016

I vote for adding use strict everywhere consistently

@zeke
Copy link
Contributor Author

zeke commented Apr 25, 2016

I don't feel strongly about this, so I'm happy to close given the downvotes, but I'd like to defer to @kevinsawicki and @jlord for any feedback they may have first.

@kevinsawicki
Copy link
Contributor

I'm good with either keeping use strict or removing it, as long as we are consistent in all files.

Yeah, I'd prefer to either completely remove it or use it in all files.

like it allows V8 to do better optimizations.

This sways me to say we should use it everywhere to make Electron as fast as possible 🐎 💨

@anaisbetts
Copy link
Contributor

If it makes Electron faster, I'm 👍 for the Electron source code (though tbh I'm not convinced it'll make any difference since Electron code is almost solely trampolines into native code), but the docs should remove it

@zeke zeke closed this Apr 25, 2016
@zeke zeke deleted the remove-strict-mode branch April 25, 2016 18:22
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

Successfully merging this pull request may close these issues.

None yet

5 participants