enhance reduce_vars (#4479)

This commit is contained in:
Alex Lam S.L
2020-12-29 11:43:12 +00:00
committed by GitHub
parent 10a71c182b
commit 560ccc1221
2 changed files with 23 additions and 2 deletions

View File

@@ -359,6 +359,28 @@ reduce_block_2_toplevel: {
node_version: ">=4"
}
reduce_vars: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
"use strict";
let a = "PASS";
console.log(a);
a = "FAIL";
}
expect: {
"use strict";
console.log("PASS");
"FAIL";
}
expect_stdout: "PASS"
node_version: ">=4"
}
hoist_props: {
options = {
hoist_props: true,