fix reduce_vars on boolean binary expressions (#1819)
Side effects of `&&` and `||` have not mattered until #1814, which takes assignment expressions into account.
This commit is contained in:
@@ -2217,3 +2217,26 @@ try_abort: {
|
||||
}
|
||||
expect_stdout: "1 undefined"
|
||||
}
|
||||
|
||||
boolean_binary_assign: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
reduce_vars: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
!function() {
|
||||
var a;
|
||||
void 0 && (a = 1);
|
||||
console.log(a);
|
||||
}();
|
||||
}
|
||||
expect: {
|
||||
!function() {
|
||||
var a;
|
||||
void 0;
|
||||
console.log(a);
|
||||
}();
|
||||
}
|
||||
expect_stdout: "undefined"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user