fix corner case in reduce_vars (#4203)

fixes #4198
This commit is contained in:
Alex Lam S.L
2020-10-12 12:02:44 +01:00
committed by GitHub
parent b512726cf3
commit 1cdf810f0b
2 changed files with 42 additions and 1 deletions

View File

@@ -805,3 +805,38 @@ issue_4197: {
}
expect_stdout: "1"
}
issue_4198: {
options = {
reduce_vars: true,
}
input: {
console.log(function() {
try {
throw "PASS";
} catch (e) {
{
const e = "FAIL";
}
return function() {
return e;
}();
}
}());
}
expect: {
console.log(function() {
try {
throw "PASS";
} catch (e) {
{
const e = "FAIL";
}
return function() {
return e;
}();
}
}());
}
expect_stdout: "PASS"
}