Latest Results
fix(es/minifier): Drop unused callbacks passed to empty functions (#12684)
**Description:**
Calls to known empty functions in comma expressions can retain unused
callback bodies. For the reproduction in #12683, enabling `toplevel`
should produce `console.log(42);`, matching Terser, but currently leaves
the empty calls and their callbacks in the output.
Reduce calls in non-final sequence positions when the callee is an
identifier and every argument is a function expression, arrow function,
or literal, without spreads. Require both `reduce_vars` and
`side_effects`, reuse the existing function analysis, and preserve
reference-sensitive sequence behavior.
Add six focused fixture groups covering the exact issue reproduction,
annotated wrappers, argument effects, reference semantics, and each
disabled optimization option. Three fixtures also check execution before
and after two minifications.
Validation:
- `cargo test -p swc_ecma_minifier --no-fail-fast`: 8,099 passed.
- `./scripts/exec.sh` in `crates/swc_ecma_minifier`: 2,620 passed.
- `cargo clippy --all --all-targets -- -D warnings`, `cargo fmt --all`,
and `git diff --check` passed.
**Related issue (if exists):**
Fixes #12683
Downstream report: https://github.com/web-infra-dev/rspack/issues/16445
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
Co-authored-by: Donny/강동윤 <kdy.1997.dev@gmail.com> Latest Branches
0%
0%
0%
kdy1/apply-ai-issue-rules © 2026 CodSpeed Technology