aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-09-20 16:21:59 +0100
committerGitHub <noreply@github.com>2020-09-20 23:21:59 +0800
commit90410f9fc3538a5f267c38470490b83086d71b85 (patch)
tree5063448f09c1fb33e7839f66855632069978e381 /test
parentef3831437d830714178b7342a120ee6c8bf082c4 (diff)
downloadtracifyjs-90410f9fc3538a5f267c38470490b83086d71b85.tar.gz
tracifyjs-90410f9fc3538a5f267c38470490b83086d71b85.zip
fix corner case in `unused` (#4134)
fixes #4133
Diffstat (limited to 'test')
-rw-r--r--test/compress/drop-unused.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index 46f273e9..eadf279a 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -2924,3 +2924,24 @@ forin_var_2: {
}
expect_stdout: "undefined"
}
+
+issue_4133: {
+ options = {
+ evaluate: true,
+ merge_vars: true,
+ pure_getters: "strict",
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = 1;
+ var b = [ a-- ], c = b && b[c];
+ console.log(a);
+ }
+ expect: {
+ var b = 1;
+ console.log(0);
+ }
+ expect_stdout: "0"
+}