From 6a8aed20496cde3b22cad7c9309ec804c71e5c84 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 27 Dec 2020 12:06:50 +0000 Subject: fix corner case in `unused` (#4469) fixes #4468 --- test/compress/default-values.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test/compress') diff --git a/test/compress/default-values.js b/test/compress/default-values.js index 0e05d37d..acd285f4 100644 --- a/test/compress/default-values.js +++ b/test/compress/default-values.js @@ -1160,3 +1160,31 @@ issue_4461_2: { expect_stdout: "PASS" node_version: ">=6" } + +issue_4468: { + options = { + evaluate: true, + keep_fargs: false, + pure_getters: "strict", + reduce_vars: true, + side_effects: true, + unused: true, + } + input: { + (function(a) { + var { + [console.log("PASS")]: b = a && (a.p = 0), + } = 0; + a; + })(1234); + } + expect: { + (function() { + var { + [console.log("PASS")]: b = 0, + } = 0; + })(); + } + expect_stdout: "PASS" + node_version: ">=6" +} -- cgit v1.2.3