aboutsummaryrefslogtreecommitdiff
path: root/test/compress/destructured.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-06-10 00:58:33 +0100
committerGitHub <noreply@github.com>2021-06-10 07:58:33 +0800
commite70b84895c3d3034b64372b77d343da0c4565c40 (patch)
tree896e7d5f0d5e2925685edf429696a44f748e8355 /test/compress/destructured.js
parent8dbf0b042e1dbef1c669411819d3cb9439cdf4b3 (diff)
downloadtracifyjs-e70b84895c3d3034b64372b77d343da0c4565c40.tar.gz
tracifyjs-e70b84895c3d3034b64372b77d343da0c4565c40.zip
fix corner cases in `loops` & `unused` (#4995)
fixes #4994
Diffstat (limited to 'test/compress/destructured.js')
-rw-r--r--test/compress/destructured.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js
index 78cd6863..41e337be 100644
--- a/test/compress/destructured.js
+++ b/test/compress/destructured.js
@@ -2592,3 +2592,36 @@ issue_4608_2: {
expect_stdout: "f"
node_version: ">=6"
}
+
+issue_4994: {
+ options = {
+ loops: true,
+ unused: true,
+ }
+ input: {
+ var a = "FAIL";
+ (function([
+ {
+ [function() {
+ for (a in { PASS: null });
+ }()]: b,
+ },
+ ]) {
+ var a;
+ })([ 42 ]);
+ console.log(a);
+ }
+ expect: {
+ var a = "FAIL";
+ (function([
+ {
+ [function() {
+ for (a in { PASS: null });
+ }()]: b,
+ },
+ ]) {})([ 42 ]);
+ console.log(a);
+ }
+ expect_stdout: "PASS"
+ node_version: ">=6"
+}