fix corner case in merge_vars (#4113)

fixes #4112
This commit is contained in:
Alex Lam S.L
2020-09-16 15:18:28 +01:00
committed by GitHub
parent 2039185051
commit 219aac6a84
2 changed files with 42 additions and 3 deletions

View File

@@ -450,3 +450,39 @@ issue_4111: {
}
expect_stdout: "2"
}
issue_4112: {
options = {
functions: true,
merge_vars: true,
reduce_vars: true,
unused: true,
}
input: {
console.log(typeof function() {
try {
throw 42;
} catch (e) {
var o = e;
for (e in o);
var a = function() {};
console.log;
return a;
}
}());
}
expect: {
console.log(typeof function() {
try {
throw 42;
} catch (e) {
var a = e;
for (e in a);
a = function() {};
console.log;
return a;
}
}());
}
expect_stdout: "function"
}