-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(es/minifier): Reuse variable names #4475
Conversation
2734608
to
2abe295
Compare
@Austaras Can you describe more about reusing variable names in #2934 (comment) ? One thing I found from diffing is reuse of variables in non-first statements, like // lots of code
var a = b + b;
for (var d = init;) {
use(d)
} became // lots of code
var a = b + b;
for (b = init;) {
use(b)
} but, I'm curious if there was more renaming. (I didn't analyze fully yet) |
Seems like it's not really about initializer, but about reference function hello(name) {
console.log('Hello, ' + name);
var b = window.a
console.log(b === b)
} be turned into function hello(a) {
console.log("Hello, " + a);
a = window.a;
console.log(a === a);
} so |
Thank you! |
68a194e
to
c0055c1
Compare
Closing in favor of #5781 |
Description:
Node
APIs (from google closure compiler)Control flow graph
DataFlow analyzer
This has some TODOs left
Liveness analyzer
Coalesce variable names pass
Related issue (if exists):