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 entirely move else branch if another else branch might accidentally be referenced. #3725
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 #3725 +/- ##
=======================================
Coverage 96.97% 96.97%
=======================================
Files 184 184
Lines 6409 6419 +10
Branches 1856 1859 +3
=======================================
+ Hits 6215 6225 +10
Misses 103 103
Partials 91 91
Continue to review full report at Codecov.
|
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.
Thanks!
} else throw new Error("Shouldn't be reached"); | ||
|
||
if (unknown) | ||
for (var x = 1; x--; x > 0) |
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.
Not that it matters, but the x > 0
expressions in the 4 loops are superfluous. Perhaps you intended to swap the for loops' test with update.
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.
Makes sense
…tally be referenced.
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Resolves #3716
Description
In case an if statement is nested within another if statement with no block statement in between and the outer if statement has an
else
branch, then any else branch of the inner if statement will not be entirely removed to avoid accidentally catching theelse
branch of the outer if statement.