aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-01-01 04:56:13 +0000
committerGitHub <noreply@github.com>2021-01-01 12:56:13 +0800
commit2dbafbb4ee9c5cb82665299ee9343c80e96daad4 (patch)
tree5b66f7838396dc84fd73c18fdfea66f41b9a921a /test/compress
parent311c074622e0aabbd79b0d701c19f21b8b093b77 (diff)
downloadtracifyjs-2dbafbb4ee9c5cb82665299ee9343c80e96daad4.tar.gz
tracifyjs-2dbafbb4ee9c5cb82665299ee9343c80e96daad4.zip
fix corner case in `reduce_vars` (#4490)
fixes #4489
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/hoist_vars.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/compress/hoist_vars.js b/test/compress/hoist_vars.js
index 173aaeaf..82f8ede6 100644
--- a/test/compress/hoist_vars.js
+++ b/test/compress/hoist_vars.js
@@ -158,3 +158,22 @@ issue_4487: {
}
expect_stdout: "undefined"
}
+
+issue_4489: {
+ options = {
+ collapse_vars: true,
+ evaluate: true,
+ hoist_vars: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ A = 0;
+ var o = !0 || null;
+ for (var k in o);
+ }
+ expect: {
+ for (var k in !(A = 0));
+ }
+}