aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-07-31 01:05:09 +0100
committerGitHub <noreply@github.com>2020-07-31 08:05:09 +0800
commitee632a5519078ac3fe97d0864731bea4bdad9365 (patch)
treee6b8469bcec072d98849c2dca8ce3545011db2db /test/compress
parentdfe47bcc42d0385577ecffa7fe312025e1369e7b (diff)
downloadtracifyjs-ee632a5519078ac3fe97d0864731bea4bdad9365.tar.gz
tracifyjs-ee632a5519078ac3fe97d0864731bea4bdad9365.zip
fix corner case in `reduce_vars` (#4031)
fixes #4030
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/reduce_vars.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 9010fb1e..85969f90 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -7383,3 +7383,26 @@ issue_3974: {
}
expect_stdout: "PASS"
}
+
+issue_4030: {
+ options = {
+ collapse_vars: true,
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a;
+ {
+ delete (a = "PASS");
+ A = "PASS";
+ }
+ console.log(A);
+ }
+ expect: {
+ A = "PASS";
+ console.log("PASS");
+ }
+ expect_stdout: "PASS"
+}