Do not entirely move else branch if another else branch might accidentally be referenced.#3725
Merged
lukastaegert merged 2 commits intomasterfrom Aug 15, 2020
Merged
Do not entirely move else branch if another else branch might accidentally be referenced.#3725lukastaegert merged 2 commits intomasterfrom
lukastaegert merged 2 commits intomasterfrom
Conversation
Collaborator
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.
|
kzc
reviewed
Aug 14, 2020
| } else throw new Error("Shouldn't be reached"); | ||
|
|
||
| if (unknown) | ||
| for (var x = 1; x--; x > 0) |
Contributor
There was a problem hiding this comment.
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.
…tally be referenced.
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.
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
elsebranch, then any else branch of the inner if statement will not be entirely removed to avoid accidentally catching theelsebranch of the outer if statement.