improve transversal efficiency in collapse_vars (#2611)

fixes #2603
This commit is contained in:
Alex Lam S.L
2017-12-18 03:00:05 +08:00
committed by GitHub
parent 5de369fa67
commit b29fc8b27c
2 changed files with 62 additions and 21 deletions

View File

@@ -3990,3 +3990,25 @@ cascade_call: {
}
}
}
replace_all_var: {
options = {
collapse_vars: true,
unused: true,
}
input: {
var a = "PASS";
(function() {
var b = b || c && c[a = "FAIL"], c = a;
})();
console.log(a);
}
expect: {
var a = "PASS";
(function() {
var b = b || c && c[a = "FAIL"], c = a;
})();
console.log(a);
}
expect_stdout: "PASS"
}