enhance reduce_vars (#5171)

This commit is contained in:
Alex Lam S.L
2021-11-13 14:18:56 +00:00
committed by GitHub
parent e9932e1314
commit f97e107c09
4 changed files with 74 additions and 7 deletions

View File

@@ -7340,6 +7340,24 @@ local_assignment_modified: {
expect_stdout: "42"
}
local_declaration: {
options = {
evaluate: true,
reduce_vars: true,
side_effects: true,
toplevel: true,
}
input: {
var a;
a || console.log(a = "PASS");
}
expect: {
var a;
console.log("PASS");
}
expect_stdout: "PASS"
}
local_definition_modified: {
options = {
evaluate: true,