fix corner case in ie8

fixes #3825
This commit is contained in:
alexlamsl 2020-04-27 16:11:58 +08:00
parent bc2a4a3bb8
commit 4d7b66e1d2
2 changed files with 16 additions and 1 deletions

View File

@ -4938,7 +4938,7 @@ merge(Compressor.prototype, {
}
if (!compressor.option("ie8")) return node;
if (node) exprs.push(node);
return make_sequence(this, exprs);
return exprs.length == 0 ? null : make_sequence(this, exprs);
});
def(AST_Constant, return_null);
def(AST_Dot, function(compressor, first_in_statement) {

View File

@ -2445,3 +2445,18 @@ issue_3823: {
}
expect_stdout: "PASS undefined"
}
issue_3825: {
options = {
ie8: true,
pure_getters: "strict",
side_effects: true,
}
input: {
console.log({}[void (0..length ? 1 : 2)]);
}
expect: {
console.log({}[void 0]);
}
expect_stdout: "undefined"
}