- fix side effects in switch condition for singular blocks - fix `undefined` confusion with local variable - gate `OPT(AST_Switch)` with `switches` fixes #1758 fixes #1759
27 lines
471 B
JavaScript
27 lines
471 B
JavaScript
case_1: {
|
|
options = {
|
|
dead_code: true,
|
|
evaluate: true,
|
|
switches: 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"
|
|
}
|