swc icon indicating copy to clipboard operation
swc copied to clipboard

minifier doesn't remove unused parameters

Open aquapi opened this issue 5 months ago • 0 comments

Describe the bug

I'm not sure it is a bug or not but terser seems to work with this pattern.

Input code


Config


Link to the code that reproduces this issue

https://play.swc.rs/?version=1.13.5&code=H4sIAAAAAAAAA8tJLVHIVrBVMLDmSs7PKy5RSMsD8jQ0FWztFEAC%2BTmpejn56RrZ2tqa1lxpeRrqHpnqyCwA%2BYBrAkEAAAA%3D&config=H4sIAAAAAAAAA32US47bMAyG93OKwOsuikHRRQ%2FQXc8gKBblKJVEQ6QyMQa5e2nZeXRCZ2fz409KJMXPt92uO1Lf%2Fdp9yqf8jLYQlNu%2FWGjKbM9i6aBPlvoSRu6%2BXemRZuRtJGimy0I6tmUAbip6%2F%2F7%2BY1V0EZHgqlhtKeTgp8ecPaaxANGDTawSsibITP%2FrV1bwYwZc6qN9jxjB5hfEWDIhMwxQtMA9xmhHAnOyRYkyn9SWQKilmGFlcGYsOKo8u8ABs%2BR8pg6sMz06UFAo0HM4gSaTXCLLJNdT7tOwg30dhtbnL2o42VgtKznh3Foip1WiHjAQG1%2BzVsIFbtRggWtxvyqDNwW4lvysO2LIGz35CyAViJYo2wRa3ObhZZ621P6lMmQvI8uTwmW%2BtVtmGKSoJgSvVHauDBQOWjcLuNrDXNleO86KN8pHwYEB72VWlND0Ebg%2FaEl5GgG9AqS%2F1mtTtQBze4UbfH4QL%2FBvuSXrA7Z6JMuHbUpT2mN8kSABH9C9cJBWMG7jIlviPG7zmh3IaIBTXSo18LwE5AEwmtj25dNsyPOQiGaIuL%2BvidXhctvDyebh%2Ft6XVfy2OnQJXW1wXfJzf5fV%2FLO7O1238O3gXaA%2FV2VLevkHTP0r1zAGAAA%3D

SWC Info output

No response

Expected behavior

Like terser produces:

// terser option: { module: true, compress: { passes: 3 } }
let k=0;const fn=()=>console.log(k++);fn(),fn();

Actual behavior

let k = 0;
const fn = ()=>console.log(k++);
fn('Hi'), fn('Hi');

Version

1.13.5

Additional context

No response

aquapi avatar Sep 14 '25 02:09 aquapi