Fix additional let/var init bugs#4177
Merged
lukastaegert merged 4 commits intorollup:masterfrom Jul 15, 2021
kzc:additional-variable-init-fixes
Merged
Fix additional let/var init bugs#4177lukastaegert merged 4 commits intorollup:masterfrom kzc:additional-variable-init-fixes
lukastaegert merged 4 commits intorollup:masterfrom
kzc:additional-variable-init-fixes
Conversation
including blockless if statement `var` declarations and let/var use before declaration within same function
Codecov Report
@@ Coverage Diff @@
## master #4177 +/- ##
==========================================
+ Coverage 91.27% 98.33% +7.06%
==========================================
Files 170 202 +32
Lines 5923 7227 +1304
Branches 1794 2114 +320
==========================================
+ Hits 5406 7107 +1701
+ Misses 311 58 -253
+ Partials 206 62 -144
Continue to review full report at Codecov.
|
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via npm install kzc/rollup#additional-variable-init-fixesor load it into the REPL: |
lukastaegert
approved these changes
Jul 14, 2021
Member
lukastaegert
left a comment
There was a problem hiding this comment.
I took the liberty of replacing the removed example in the docs with one that is still failing, otherwise we can merge this for now.
Contributor
Author
|
Works for me. |
kzc
commented
Jul 14, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix additional variable state change bugs including blockless
ifstatementvardeclarations andlet/varuse before declaration within same function that do not cross function scopes.This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
Fixes several outstanding var/let init issues mentioned in #4148 without any code pessimization other than for previously incorrect rollup output, and with minimal overhead.