fix switch branch elimination (#1752)
Merge unreachable case body with previous fallthrough case fixes #1750
This commit is contained in:
25
test/compress/issue-1750.js
Normal file
25
test/compress/issue-1750.js
Normal file
@@ -0,0 +1,25 @@
|
||||
case_1: {
|
||||
options = {
|
||||
dead_code: true,
|
||||
evaluate: true,
|
||||
}
|
||||
input: {
|
||||
var a = 0, b = 1;
|
||||
switch (true) {
|
||||
case a, true:
|
||||
default:
|
||||
b = 2;
|
||||
case true:
|
||||
}
|
||||
console.log(a, b);
|
||||
}
|
||||
expect: {
|
||||
var a = 0, b = 1;
|
||||
switch (true) {
|
||||
case a, true:
|
||||
b = 2;
|
||||
}
|
||||
console.log(a, b);
|
||||
}
|
||||
expect_stdout: "0 2"
|
||||
}
|
||||
Reference in New Issue
Block a user