Skip to content

fix(minifier): drop unused call args for known function bindings#11578

Draft
kdy1 wants to merge 4 commits intomainfrom
kdy1/fix-11089-drop-unused-call-args
Draft

fix(minifier): drop unused call args for known function bindings#11578
kdy1 wants to merge 4 commits intomainfrom
kdy1/fix-11089-drop-unused-call-args

Conversation

@kdy1
Copy link
Member

@kdy1 kdy1 commented Feb 23, 2026

Summary

  • fix issue minifier doesn't remove unused arguments #11089 by dropping trailing call arguments when callee is a known local function/arrow binding and those args are guaranteed unused
  • keep safety checks: bail out for reassigned callees, rest params, arguments usage, and spread call args
  • add regression fixture under terser drop_unused for issue_11089
  • update libs size snapshot (victory.js gzip: 154.19 KiB -> 154.18 KiB)

Testing

  • ./scripts/exec.sh (in crates/swc_ecma_minifier)
  • cargo fmt --all
  • cargo clippy -p swc_ecma_minifier --all-targets -- -D warnings
  • cargo test -p swc_ecma_minifier
  • cargo test -p swc_ecma_minifier --test compress -- --ignored issue_11089
  • cargo test -p swc_ecma_minifier --test size

Fixes #11089

@changeset-bot
Copy link

changeset-bot bot commented Feb 23, 2026

⚠️ No Changeset found

Latest commit: 4aeb368

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

Binary Sizes

File Size
swc.linux-x64-gnu.node 28M (28585288 bytes)

Commit: 55e3c39

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 23, 2026

Merging this PR will not alter performance

✅ 184 untouched benchmarks


Comparing kdy1/fix-11089-drop-unused-call-args (4aeb368) with main (81b22c3)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

minifier doesn't remove unused arguments

1 participant