-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(es/minifier): Drop redundant function parameters #9636
base: main
Are you sure you want to change the base?
Conversation
|
This might break TypeScript interfaces, will have to test |
CodSpeed Performance ReportMerging #9636 will not alter performanceComparing Summary
|
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 think this should check for option about function.length
I think this should be a config option if that's what you're referring to, but I'm not sure what you're referring to regarding |
It's the |
anything blocking this? <3 |
Not at the moment. I should be able to get around to finishing this some time this week. |
Description:
Trailing parameters in functions/arrow expressions can be dropped if they're not referenced inside the function body without introducing side effects. e.g.
function f(a, b, c) {f(a);}
->function f(a) {f(a);}
.This simply iterates (reverse) through the parameters and once it encounters a parameter that is used, it stops and drops the ones it found. If no referenced parameters are found then all parameters can be dropped.
BREAKING CHANGE:
Related issue (if exists):