From 1d835ac17de613093a538a4ab72160508197e08c Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 29 Sep 2020 00:01:38 +0100 Subject: fix corner case in `inline` (#4160) fixes #4159 --- test/compress/functions.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/compress/functions.js') diff --git a/test/compress/functions.js b/test/compress/functions.js index 1be01167..4d753469 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -4808,3 +4808,24 @@ issue_4155: { "function", ] } + +issue_4159: { + options = { + collapse_vars: true, + inline: true, + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + var a = 42, c = function(b) { + (b = a) && console.log(a++, b); + }(c = a); + } + expect: { + var a = 42; + (b = a) && console.log(a++, b); + var b; + } + expect_stdout: "42 42" +} -- cgit v1.2.3