From 5f269cd57356fc4dbe7486dca22902d22695d499 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 24 Dec 2020 02:56:22 +0000 Subject: fix corner case in `collapse_vars` (#4445) fixes #4444 --- test/compress/default-values.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'test/compress/default-values.js') diff --git a/test/compress/default-values.js b/test/compress/default-values.js index 2e046444..64dad3cf 100644 --- a/test/compress/default-values.js +++ b/test/compress/default-values.js @@ -950,3 +950,27 @@ mangle_arrow_2_toplevel: { expect_stdout: "PASS" node_version: ">=6" } + +issue_4444: { + options = { + collapse_vars: true, + } + input: { + var a = "PASS"; + console.log(function(b) { + b = a; + (function(c = b.p) {})(); + return a; + }()); + } + expect: { + var a = "PASS"; + console.log(function(b) { + b = a; + (function(c = b.p) {})(); + return a; + }()); + } + expect_stdout: "PASS" + node_version: ">=6" +} -- cgit v1.2.3