Input Code
if (false) {
var bar = true;
}
if (bar) {
alert('bug!');
}
Actual Output
Expected Output
var bar;bar&&alert('bug!');
Details
The if condition is incorrectly removed. The logic is changed.
I know that putting var inside a block scope is definitely a bad practice. I've just tried to minify some legacy codes and encountered this critical issue.
Example: See it here in repl
Input Code
Actual Output
Expected Output
Details
The if condition is incorrectly removed. The logic is changed.
I know that putting var inside a block scope is definitely a bad practice. I've just tried to minify some legacy codes and encountered this critical issue.
Example: See it here in repl