fix corner case in mangle (#4174)

This commit is contained in:
Alex Lam S.L
2020-10-04 01:24:41 +01:00
committed by GitHub
parent 04017215cc
commit 95ef4d5377
3 changed files with 88 additions and 38 deletions

View File

@@ -4960,3 +4960,30 @@ issue_4171_2: {
}
expect_stdout: "undefined"
}
catch_defun: {
mangle = {
toplevel: true,
}
input: {
try {
throw 42;
} catch (a) {
function f() {
return typeof a;
}
}
console.log(f());
}
expect: {
try {
throw 42;
} catch (o) {
function t() {
return typeof o;
}
}
console.log(t());
}
expect_stdout: true
}