aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-10-13 00:32:17 +0100
committerGitHub <noreply@github.com>2020-10-13 07:32:17 +0800
commit176c09c6a5408ef0a8ddca8da7eb930c9d5e2745 (patch)
tree46f7b9e1821b3a0ab5a15106075fb574ae5c36f2 /test
parent9272f662c0c89387a2bc9e7a47024ccc9d0c09a4 (diff)
downloadtracifyjs-176c09c6a5408ef0a8ddca8da7eb930c9d5e2745.tar.gz
tracifyjs-176c09c6a5408ef0a8ddca8da7eb930c9d5e2745.zip
fix corner case in `reduce_vars` & `unused` (#4208)
fixes #4207
Diffstat (limited to 'test')
-rw-r--r--test/compress/const.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/const.js b/test/compress/const.js
index d1164cc1..aedfdbc3 100644
--- a/test/compress/const.js
+++ b/test/compress/const.js
@@ -909,3 +909,24 @@ issue_4205: {
}
expect_stdout: true
}
+
+issue_4207: {
+ options = {
+ reduce_funcs: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ {
+ const a = function() {};
+ console.log(a.length);
+ }
+ }
+ expect: {
+ {
+ const a = function() {};
+ console.log(a.length);
+ }
+ }
+ expect_stdout: "0"
+}