-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Do not create invalid code if a function argument is an empty object pattern #3998
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via
or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #3998 +/- ##
=======================================
Coverage 97.22% 97.22%
=======================================
Files 191 191
Lines 6743 6745 +2
Branches 1969 1970 +1
=======================================
+ Hits 6556 6558 +2
Misses 99 99
Partials 88 88
Continue to review full report at Codecov.
|
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #3997
Description
When a function argument is an empty object pattern, Rollup would see that no variables are declared and falsely assume that it is not necessary. This fix adds special handling for that case (note that when even a single, even unused, variable was declared in the pattern, it was retained correctly).