fix corner case with destructuring catch (#4426)

fixes #4425
This commit is contained in:
Alex Lam S.L
2020-12-20 02:31:32 +00:00
committed by GitHub
parent b7c49b72b3
commit f5224ca1f5
2 changed files with 39 additions and 1 deletions

View File

@@ -2001,3 +2001,39 @@ issue_4420: {
expect_stdout: "PASS"
node_version: ">=8"
}
issue_4425: {
rename = true
input: {
var a;
console.log(function() {
try {
try {
throw 42;
} catch ({
[a]: a,
}) {}
return "FAIL";
} catch (e) {
return "PASS";
}
}());
}
expect: {
var a;
console.log(function() {
try {
try {
throw 42;
} catch ({
[b]: b,
}) {}
return "FAIL";
} catch (c) {
return "PASS";
}
}());
}
expect_stdout: "PASS"
node_version: ">=8"
}