fix corner case in hoist_props (#4024)

fixes #4023
This commit is contained in:
Alex Lam S.L
2020-07-26 02:27:34 +01:00
committed by GitHub
parent a98ba994bd
commit 1bc0df1569
2 changed files with 34 additions and 3 deletions

View File

@@ -1016,3 +1016,28 @@ issue_3945_2: {
}
expect_stdout: "undefined"
}
issue_4023: {
options = {
comparisons: true,
hoist_props: true,
inline: true,
reduce_vars: true,
toplevel: true,
typeofs: true,
unused: true,
}
input: {
function f() {
var a = function() {
return { p: 0 };
}();
return console.log("undefined" != typeof a);
}
f();
}
expect: {
console.log(void 0 !== {});
}
expect_stdout: "true"
}