aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-10 07:45:39 +0000
committerGitHub <noreply@github.com>2020-12-10 15:45:39 +0800
commita59593cac8b5acbefa07daf1fca3af6a72c9d262 (patch)
tree06c805beca2673bedad14c47f15190a08d8fd1a7 /test/compress
parent046bbde9d44a131ec60952e369ec4b22b9718def (diff)
downloadtracifyjs-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.js29
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"
+}