fix corner cases of catch variable inlining (#4169)

This commit is contained in:
Alex Lam S.L
2020-10-03 00:02:28 +01:00
committed by GitHub
parent 35465d590e
commit baf4903aa7
5 changed files with 193 additions and 26 deletions

View File

@@ -2992,3 +2992,34 @@ issue_4146: {
}
expect_stdout: "function"
}
single_use_catch_redefined: {
options = {
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = 1;
try {
throw 2;
} catch (a) {
function g() {
return a;
}
}
console.log(g());
}
expect: {
var a = 1;
try {
throw 2;
} catch (a) {
function g() {
return a;
}
}
console.log(g());
}
expect_stdout: true
}