From a59593cac8b5acbefa07daf1fca3af6a72c9d262 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 10 Dec 2020 07:45:39 +0000 Subject: fix corner case in `loops` & `unused` (#4356) fixes #4355 --- test/compress/destructured.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'test/compress') diff --git a/test/compress/destructured.js b/test/compress/destructured.js index eb6834a4..82d02172 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -1777,3 +1777,32 @@ issue_4323: { expect_stdout: "function" node_version: ">=6" } + +issue_4355: { + options = { + loops: true, + unused: true, + } + input: { + var a; + (function({ + [function() { + for (a in "foo"); + }()]: b, + }) { + var a; + })(0); + console.log(a); + } + expect: { + var a; + (function({ + [function() { + for (a in "foo"); + }()]: b, + }) {})(0); + console.log(a); + } + expect_stdout: "2" + node_version: ">=6" +} -- cgit v1.2.3