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
}

View File

@@ -5374,11 +5374,11 @@ defun_catch_4: {
try {
throw 42;
} catch (a) {
function a() {}
console.log(a);
}
}
expect_stdout: "42"
node_version: "<=4"
expect_stdout: true
}
defun_catch_5: {
@@ -5400,10 +5400,10 @@ defun_catch_5: {
throw 42;
} catch (a) {
console.log(a);
function a() {}
}
}
expect_stdout: "42"
node_version: "<=4"
expect_stdout: true
}
defun_catch_6: {