fix(minifier): collapse variables when `join_vars` option is `true`
The variable collapse AST pass was only collapsing declarations when CompressOptions::join_vars was true, and skipping when false. This does not follow the behavior documented for this option. This PR fixes this.
This stack of pull requests is managed by Graphite. Learn more about stacking.
Join @DonIsaac and the rest of your teammates on
Graphite
Your org has enabled the Graphite merge queue for merging into main
Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.
You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.
CodSpeed Performance Report
Merging #6226 will not alter performance
Comparing don/10-01-fix_minifier_collapse_variables_when_join_vars_option_is_true (ea896ec) with main (4b42047)
Summary
✅ 29 untouched benchmarks
I don't know the minifier at all, so I think best leave Boshen to review this.
It appears that the test262 breakage is caused by the void x declaration. However, surprisingly, this pass does not address the void x issue at all!
closed by https://github.com/oxc-project/oxc/pull/6464