From 938368ba219f29703b9f9e67c6fb0d1c0723220a Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 14 May 2020 00:52:42 +0100 Subject: enhance `collapse_vars` (#3896) --- test/compress/collapse_vars.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'test/compress/collapse_vars.js') diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index dee370cf..0dd8754d 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -8015,3 +8015,38 @@ issue_3891: { } expect_stdout: "function" } + +issue_3894: { + options = { + collapse_vars: true, + inline: true, + reduce_vars: true, + unused: true, + } + input: { + function log(msg) { + console.log(msg ? "FAIL" : "PASS"); + } + var a, c; + (function(b) { + a = c = 0, + log(b); + })(-0); + log(a); + log(c); + } + expect: { + function log(msg) { + console.log(msg ? "FAIL" : "PASS"); + } + var a, c; + void log(-(a = c = 0)); + log(a); + log(c); + } + expect_stdout: [ + "PASS", + "PASS", + "PASS", + ] +} -- cgit v1.2.3