fix corner case in merge_vars (#5661)

fixes #5660
This commit is contained in:
Alex Lam S.L
2022-09-14 16:36:54 +01:00
committed by GitHub
parent fa2511f71c
commit e0b302d651
2 changed files with 58 additions and 14 deletions

View File

@@ -2169,3 +2169,38 @@ issue_5656: {
}
expect_stdout: true
}
issue_5660: {
options = {
merge_vars: true,
side_effects: true,
}
input: {
function f() {
try {
a;
var b;
return b;
} catch (e) {
var a = "FAIL";
const b = null;
return a;
}
}
console.log(f());
}
expect: {
function f() {
try {
var b;
return b;
} catch (e) {
var a = "FAIL";
const b = null;
return a;
}
}
console.log(f());
}
expect_stdout: true
}