aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-02-27 20:41:21 +0000
committerGitHub <noreply@github.com>2021-02-28 04:41:21 +0800
commitc549ee89b9a0641ea78f57472168963811c7e111 (patch)
tree8dc88b6d278e2f49c01ed6532dca0ff417bab9be /test/compress
parent7924a3ae8b7bb69c246215618768eda04987b91d (diff)
downloadtracifyjs-c549ee89b9a0641ea78f57472168963811c7e111.tar.gz
tracifyjs-c549ee89b9a0641ea78f57472168963811c7e111.zip
fix corner case `reduce_vars` (#4706)
fixes #4705
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/classes.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/classes.js b/test/compress/classes.js
index ab2652c8..dea0d5b0 100644
--- a/test/compress/classes.js
+++ b/test/compress/classes.js
@@ -747,3 +747,24 @@ issue_4687_2: {
expect_stdout: "PASS"
node_version: ">=4"
}
+
+issue_4705: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = "PASS";
+ class A {
+ p = a = "FAIL";
+ [console.log(a)];
+ }
+ }
+ expect: {
+ console.log("PASS");
+ }
+ expect_stdout: "PASS"
+ node_version: ">=12"
+}