aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-02-24 18:17:28 +0000
committerGitHub <noreply@github.com>2021-02-25 02:17:28 +0800
commitb8672b55b25b3333188724a5c20588db96ccd0dc (patch)
treeaebbef363562062fa002a108b2a2db81a19438f5 /test/compress
parenta5a958beda5e0e7daedd5bd0cb4c72a81aade19b (diff)
downloadtracifyjs-b8672b55b25b3333188724a5c20588db96ccd0dc.tar.gz
tracifyjs-b8672b55b25b3333188724a5c20588db96ccd0dc.zip
fix corner case in `unused` (#4682)
fixes #4681
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/classes.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/classes.js b/test/compress/classes.js
index 390ae525..78536094 100644
--- a/test/compress/classes.js
+++ b/test/compress/classes.js
@@ -572,3 +572,27 @@ computed_key_generator: {
expect_stdout: "PASS"
node_version: ">=4"
}
+
+issue_4681: {
+ options = {
+ unused: true,
+ }
+ input: {
+ console.log(function(a) {
+ class A {
+ static p = a = this;
+ }
+ return typeof a;
+ }());
+ }
+ expect: {
+ console.log(function(a) {
+ class A {
+ static p = a = this;
+ }
+ return typeof a;
+ }());
+ }
+ expect_stdout: "function"
+ node_version: ">=12"
+}