diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-10 07:45:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-10 15:45:39 +0800 |
commit | a59593cac8b5acbefa07daf1fca3af6a72c9d262 (patch) | |
tree | 06c805beca2673bedad14c47f15190a08d8fd1a7 /test/compress | |
parent | 046bbde9d44a131ec60952e369ec4b22b9718def (diff) | |
download | tracifyjs-a59593cac8b5acbefa07daf1fca3af6a72c9d262.tar.gz tracifyjs-a59593cac8b5acbefa07daf1fca3af6a72c9d262.zip |
fix corner case in `loops` & `unused` (#4356)
fixes #4355
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/destructured.js | 29 |
1 files changed, 29 insertions, 0 deletions
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" +} |