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
Improve inlining #661
Improve inlining #661
Conversation
…t figure_out_scope information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall great job!
I really like how it's done!
@@ -3522,6 +3533,7 @@ const pure_prop_access_globals = new Set([ | |||
return true; | |||
} | |||
if (node instanceof AST_This && this instanceof AST_Arrow) { | |||
// TODO check arguments too! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you continue work on that in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, just a note for later. This is because arguments
can be used inside arrow functions and it uses the closest non-arrow arguments
just like it does with this
.
@fabiosantoscode what is status of this PR? :) |
* enable symbols to be created during compression while maintaining most figure_out_scope information * simplify reduce_vars inlining code * remove _ arguments in parse * add this._toplevel to Compressor * recompute scope when inlining a function * remove old TODO comment * deprecate var_names()
I believe I've improved some aspects of inlining. It became a bit simpler than before. Also, inlining something updates more scope of the parent scope's information than before, fixing #639.
My original goal was to make it so new, unique variable names were always created, and checking for collisions didn't need to happen, but it turns out that generating new names didn't fix all the problems, and people would probably be upset or confused if their variable names were changed without them using the mangle option.
Then I tacked on a change I was interested in, which was to start measuring symbols differently depending on whether mangling was enabled, fixing #321.