fix corner case in reduce_vars (#4796)

This commit is contained in:
Alex Lam S.L
2021-03-17 21:14:14 +00:00
committed by GitHub
parent d4303b62cc
commit d837a46ebd
2 changed files with 26 additions and 0 deletions

View File

@@ -294,6 +294,31 @@ reduce_vars_2: {
node_version: ">=6"
}
reduce_vars_3: {
options = {
reduce_funcs: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
function f() {}
function g() {
return (a => a)(...[ f ]);
}
console.log(g() === g() ? "PASS" : "FAIL");
}
expect: {
function f() {}
function g() {
return (a => a)(...[ f ]);
}
console.log(g() === g() ? "PASS" : "FAIL");
}
expect_stdout: "PASS"
node_version: ">=6"
}
convert_setter: {
options = {
objects: true,