enhance reduce_vars (#5636)

This commit is contained in:
Alex Lam S.L
2022-08-30 09:00:43 +01:00
committed by GitHub
parent 15b608f74c
commit 10bc86ba10
7 changed files with 109 additions and 40 deletions

View File

@@ -1834,6 +1834,33 @@ switch_return_5: {
]
}
merged_references: {
options = {
if_return: true,
reduce_vars: true,
unused: true,
}
input: {
var a, b = "PASS";
console.log(function(c) {
if (c = b)
return a || c;
c = FAIL;
return a || c;
}());
}
expect: {
var a, b = "PASS";
console.log(function(c) {
if (c = b);
else
c = FAIL;
return a || c;
}());
}
expect_stdout: "PASS"
}
issue_5583: {
options = {
conditionals: true,