From d1c6bb8c7c4cc491c4bb52e14ac2127a2496fbb8 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Fri, 23 Mar 2018 02:31:59 +0800 Subject: fix nested `inline` within loop (#3019) fixes #3018 --- test/compress/functions.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'test') diff --git a/test/compress/functions.js b/test/compress/functions.js index bbe94ebf..ceaf0643 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -2208,3 +2208,32 @@ issue_3016_3_ie8: { "PASS", ] } + +issue_3018: { + options = { + inline: true, + side_effects: true, + toplevel: true, + } + input: { + var b = 1, c = "PASS"; + do { + (function() { + (function(a) { + a = 0 != (a && (c = "FAIL")); + })(); + })(); + } while (b--); + console.log(c); + } + expect: { + var b = 1, c = "PASS"; + do { + a = void 0, + a = 0 != (a && (c = "FAIL")); + } while (b--); + var a; + console.log(c); + } + expect_stdout: "PASS" +} -- cgit v1.2.3