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

"use strict" in most (if not all) our javascript #3969

Merged
merged 1 commit into from Aug 19, 2013

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Aug 9, 2013

  • fix one variable leaking in global nameespace

For more about "strict mode" read this.

TL DR, It's faster, less error prone and more secure.

I made it at "function level" instead of "script level" to allow concatenation with unstrict script.
But I wouldn't mind having it at script level.

+ fix one variable leaking in global nameespace
@Carreau
Copy link
Member Author

Carreau commented Aug 16, 2013

Any comment on this one ? anyone ?

@jakobgager
Copy link
Contributor

If havve no realy clue what strict mode does, however following your given site Browsers don't reliably implement strict mode yet, so don't blindly depend on it
it may be worth testing this thoroughly.
On the other hand, looking at a compatibility table (http://kangax.github.io/es5-compat-table/) I suggest it should be enough if someone with Konqueror 4.9 could test this (Konq 4.9 seems to be the current release in Kubuntu 12.10).

@Carreau
Copy link
Member Author

Carreau commented Aug 16, 2013

Browsers don't reliably implement strict mode yet, so don't blindly depend on it

We don't plan on relying on any feature of strict mode. It will mainly be usefull in development to throw on errors like assigning to global variable (forgotten var keyword) or things like that.

@jakobgager
Copy link
Contributor

The Converting mistakes into errors section sounds helpful.
And if the other changes does not introduce problems I'm +1 on this.

@minrk
Copy link
Member

minrk commented Aug 16, 2013

I think this is a good idea, and the change is quite straightforward.

@Carreau
Copy link
Member Author

Carreau commented Aug 19, 2013

Merging this.

Carreau added a commit that referenced this pull request Aug 19, 2013
"use strict" in most (if not all) our javascript

plus fix one variable leaking in global namespace
@Carreau Carreau merged commit d572404 into ipython:master Aug 19, 2013
@Carreau Carreau deleted the usestrict branch August 19, 2013 11:26
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
"use strict" in most (if not all) our javascript

plus fix one variable leaking in global namespace
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

3 participants