fix corner case in reduce_vars (#3124)
This commit is contained in:
@@ -5999,7 +5999,7 @@ issue_3113_5: {
|
||||
]
|
||||
}
|
||||
|
||||
conditional_nested: {
|
||||
conditional_nested_1: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
reduce_vars: true,
|
||||
@@ -6030,3 +6030,31 @@ conditional_nested: {
|
||||
}
|
||||
expect_stdout: "2"
|
||||
}
|
||||
|
||||
conditional_nested_2: {
|
||||
options = {
|
||||
evaluate: true,
|
||||
reduce_vars: true,
|
||||
}
|
||||
input: {
|
||||
var c = 0;
|
||||
(function(a) {
|
||||
function f() {
|
||||
a && c++;
|
||||
}
|
||||
f(!c && f(), a = 1);
|
||||
})();
|
||||
console.log(c);
|
||||
}
|
||||
expect: {
|
||||
var c = 0;
|
||||
(function(a) {
|
||||
function f() {
|
||||
a && c++;
|
||||
}
|
||||
f(!c && f(), a = 1);
|
||||
})();
|
||||
console.log(c);
|
||||
}
|
||||
expect_stdout: "1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user