fix corner case in inline (#4160)

fixes #4159
This commit is contained in:
Alex Lam S.L
2020-09-29 00:01:38 +01:00
committed by GitHub
parent 9e07ac4102
commit 1d835ac17d
2 changed files with 33 additions and 6 deletions

View File

@@ -4808,3 +4808,24 @@ issue_4155: {
"function",
]
}
issue_4159: {
options = {
collapse_vars: true,
inline: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = 42, c = function(b) {
(b = a) && console.log(a++, b);
}(c = a);
}
expect: {
var a = 42;
(b = a) && console.log(a++, b);
var b;
}
expect_stdout: "42 42"
}