fix corner case in ie8 (#4187)

fixes #4186
This commit is contained in:
Alex Lam S.L
2020-10-06 02:20:41 +01:00
committed by GitHub
parent b91a2459c0
commit bc6e105174
5 changed files with 129 additions and 37 deletions

View File

@@ -5025,3 +5025,54 @@ catch_no_argname: {
]
node_version: ">=10"
}
issue_4186: {
options = {
conditionals: true,
inline: true,
reduce_funcs: true,
reduce_vars: true,
sequences: true,
unused: true,
}
input: {
console.log(typeof function() {
return function() {
function f() {
if (1)
g();
else
(function() {
return f;
});
}
return f;
function g() {
if (1) {
if (0)
h;
else
h();
var key = 0;
}
}
function h() {
return factory;
}
};
}()());
}
expect: {
console.log(typeof function() {
return function f() {
1 ? void (1 && (0 ? h : h(), 0)) : function() {
return f;
};
};
function h() {
return factory;
}
}());
}
expect_stdout: "function"
}