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
fix(es/minifier): Don't remove used var decl #7200
Conversation
@Austaras Can you take a look? |
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.
swc-bump:
- swc_ecma_minifier
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.
swc-bump:
- swc_ecma_minifier
I believe a more fine grained solution would be most optimal -- the pure mark only marks the function call, but not the call arguments, but here we ignore usage in arguments as well. |
e.init.visit_with(&mut *self.with_ctx(ctx)); | ||
self.used_recursively.remove(&id); | ||
|
||
match init { |
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.
@Austaras Did you mean something like this?
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.
I can't see changes, seems like they're force pushed.
But these won't really make any real difference, self references are very rarely used. |
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.
Automated review comment generated by auto-rebase script
Description:
Related issue:
Uncaught ReferenceError
with default minify/compress settings #7194.Invesitgation:
The problematic code is
swc/crates/swc_ecma_usage_analyzer/src/analyzer/mod.rs
Lines 1217 to 1218 in 610e1bb