enhance collapse_vars (#3602)

This commit is contained in:
Alex Lam S.L
2019-11-20 12:54:49 +08:00
committed by GitHub
parent d959e0b86f
commit 81caadb709
2 changed files with 42 additions and 10 deletions

View File

@@ -3852,10 +3852,9 @@ issue_2436_9: {
expect: {
var o = console;
console.log({
x: (c = o).a,
y: c.b,
x: o.a,
y: o.b,
});
var c;
}
expect_stdout: true
}
@@ -6567,3 +6566,29 @@ issue_3596: {
}
expect_stdout: "42"
}
local_value_replacement: {
options = {
collapse_vars: true,
unused: true,
}
input: {
function f(a, b) {
(a = b) && g(a);
}
function g(c) {
console.log(c);
}
f("FAIL", "PASS");
}
expect: {
function f(a, b) {
(a = b) && g(a);
}
function g(c) {
console.log(c);
}
f("FAIL", "PASS");
}
expect_stdout: "PASS"
}