-
Notifications
You must be signed in to change notification settings - Fork 510
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 window
instead of this
in closures to improve obfuscation.
#2413
Comments
Tested this idea on a branch in my repo and then minified it with grunt-uglify.
The original minified file (before this change) was I don't say this is a bad idea but got the idea that code source is already well written and that the occurrences of the Should I send a PR with this changes or should we close this issue? |
I don't like the idea of using |
Also, gzip. It's not that big of a deal iiuc. |
Well if the work has been done than go ahead. On Sunday, July 6, 2014, Arian Stolwijk [email protected] wrote:
|
I actually like the improved readability with explicitly stating what |
One more advantage of using |
It was just my intention to state that the reference of |
I don't understand why the global object is still referenced by using the keyword
this
inside the closures since it won't be obfuscated/minimized. As an example, the following...... will be minimized as ...
... while the now following ...
... will be minimized this way:
(Note: Negating the self invoking function [unless there is no returning value needed] saves the parentheses.)
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/55865-use-window-instead-of-this-in-closures-to-improve-obfuscation?utm_campaign=plugin&utm_content=tracker%2F22067&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F22067&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: