fix corner case in collapse_vars (#4445)

fixes #4444
This commit is contained in:
Alex Lam S.L
2020-12-24 02:56:22 +00:00
committed by GitHub
parent 6988cd9558
commit 5f269cd573
3 changed files with 36 additions and 4 deletions

View File

@@ -950,3 +950,27 @@ mangle_arrow_2_toplevel: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4444: {
options = {
collapse_vars: true,
}
input: {
var a = "PASS";
console.log(function(b) {
b = a;
(function(c = b.p) {})();
return a;
}());
}
expect: {
var a = "PASS";
console.log(function(b) {
b = a;
(function(c = b.p) {})();
return a;
}());
}
expect_stdout: "PASS"
node_version: ">=6"
}