fix corner case in collapse_vars (#4946)

This commit is contained in:
Alex Lam S.L
2021-05-19 22:11:39 +01:00
committed by GitHub
parent d930c705f6
commit d6152e6a76
3 changed files with 37 additions and 2 deletions

View File

@@ -9245,3 +9245,37 @@ issue_4935: {
}
expect_stdout: "1 0"
}
inline_throw: {
options = {
collapse_vars: true,
inline: true,
keep_fargs: false,
unused: true,
}
input: {
try {
(function() {
return function(a) {
return function(b) {
throw b;
}(a);
};
})()("PASS");
} catch (e) {
console.log(e);
}
}
expect: {
try {
(function(a) {
return function() {
throw a;
}();
})("PASS");
} catch (e) {
console.log(e);
}
}
expect_stdout: "PASS"
}