aboutsummaryrefslogtreecommitdiff
path: root/test/compress/varify.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-18 00:22:54 +0000
committerGitHub <noreply@github.com>2020-11-18 08:22:54 +0800
commit0bedd031da4fa8f0eef0fbe6737aa3a4c156a61e (patch)
tree196ab67544889fefdec66c861b61a64bc944b998 /test/compress/varify.js
parentcaa92aea5d6ff4f0ac053df3163a6bc2266002ec (diff)
downloadtracifyjs-0bedd031da4fa8f0eef0fbe6737aa3a4c156a61e.tar.gz
tracifyjs-0bedd031da4fa8f0eef0fbe6737aa3a4c156a61e.zip
fix corner cases in `collapse_vars`, `unused` & `varify` (#4292)
fixes #4290
Diffstat (limited to 'test/compress/varify.js')
-rw-r--r--test/compress/varify.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/compress/varify.js b/test/compress/varify.js
index d4894d2d..95acd032 100644
--- a/test/compress/varify.js
+++ b/test/compress/varify.js
@@ -353,3 +353,40 @@ forin_let_2: {
]
node_version: ">=6"
}
+
+issue_4290_1_const: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ varify: true,
+ }
+ input: {
+ const a = 0;
+ var a;
+ }
+ expect: {
+ const a = 0;
+ var a;
+ }
+ expect_stdout: true
+}
+
+issue_4290_1_let: {
+ options = {
+ reduce_vars: true,
+ toplevel: true,
+ varify: true,
+ }
+ input: {
+ "use strict";
+ let a = 0;
+ var a;
+ }
+ expect: {
+ "use strict";
+ let a = 0;
+ var a;
+ }
+ expect_stdout: true
+ node_version: ">=4"
+}