@@ -8506,7 +8506,7 @@ merge(Compressor.prototype, {
|
|||||||
}));
|
}));
|
||||||
return make_node(AST_BlockStatement, self, { body: decl }).optimize(compressor);
|
return make_node(AST_BlockStatement, self, { body: decl }).optimize(compressor);
|
||||||
}
|
}
|
||||||
if (exact_match ? !branch.expression.has_side_effects(compressor) : branch === default_branch) {
|
if (branch === default_branch || branch === exact_match && !branch.expression.has_side_effects(compressor)) {
|
||||||
while (branch = body[body.length - 2]) {
|
while (branch = body[body.length - 2]) {
|
||||||
if (branch instanceof AST_Default) break;
|
if (branch instanceof AST_Default) break;
|
||||||
if (!has_declarations_only(branch)) break;
|
if (!has_declarations_only(branch)) break;
|
||||||
|
|||||||
@@ -1556,3 +1556,29 @@ issue_5008_4: {
|
|||||||
}
|
}
|
||||||
expect_stdout: "PASS"
|
expect_stdout: "PASS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5010: {
|
||||||
|
options = {
|
||||||
|
dead_code: true,
|
||||||
|
evaluate: true,
|
||||||
|
switches: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a;
|
||||||
|
switch (42) {
|
||||||
|
case console.log("PASS"):
|
||||||
|
case a:
|
||||||
|
console.log("FAIL");
|
||||||
|
case 42:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a;
|
||||||
|
switch (42) {
|
||||||
|
case console.log("PASS"):
|
||||||
|
case a:
|
||||||
|
console.log("FAIL");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
expect_stdout: "PASS"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user