From: Alex Lam S.L Date: Mon, 27 Apr 2020 08:51:21 +0000 (+0100) Subject: fix corner case in `ie8` (#3826) X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=818738beec9f49f864407c68fa26cc022c88815f;p=UglifyJS.git fix corner case in `ie8` (#3826) fixes #3825 --- diff --git a/lib/compress.js b/lib/compress.js index a42095cf..8eb684d3 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -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) { diff --git a/test/compress/ie8.js b/test/compress/ie8.js index 8f81b01b..0c79ece0 100644 --- a/test/compress/ie8.js +++ b/test/compress/ie8.js @@ -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" +}