Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not truncate after switch-statement with removed case (#3241)
- Loading branch information
1 parent
3885a7f
commit 690d388
Showing
3 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
3 changes: 3 additions & 0 deletions
3
test/function/samples/switch-statements-removed-default/_config.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
description: 'does not remove code after a switch statement that should be retained' | ||
}; |
10 changes: 10 additions & 0 deletions
10
test/function/samples/switch-statements-removed-default/main.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function performSwitch(value) { | ||
switch (value) { | ||
case 'foo': | ||
return false; | ||
default: | ||
} | ||
return true; | ||
} | ||
|
||
assert.ok(performSwitch('baz')); |