fix corner cases in functions & merge_vars (#4156)

fixes #4155
This commit is contained in:
Alex Lam S.L
2020-09-26 08:31:33 +01:00
committed by GitHub
parent 9882a9f4af
commit b4ff6d0f2d
3 changed files with 75 additions and 2 deletions

View File

@@ -2822,3 +2822,41 @@ conditional_write: {
}
expect_stdout: "PASS,42"
}
issue_4155: {
options = {
inline: true,
merge_vars: true,
}
input: {
(function() {
try {
throw "PASS";
} catch (e) {
var a;
(function() {
console.log(e, a);
})(a = NaN);
}
var e = function() {};
e && console.log(typeof e);
})();
}
expect: {
(function() {
try {
throw "PASS";
} catch (e) {
var a;
a = NaN,
void console.log(e, a);
}
var e = function() {};
e && console.log(typeof e);
})();
}
expect_stdout: [
"PASS NaN",
"function",
]
}