aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-30 14:21:22 +0800
committerGitHub <noreply@github.com>2019-10-30 14:21:22 +0800
commitec7f071272384db82dff0f8fb6629f4f6fee43a5 (patch)
tree90db03a953fcaa6f85702951b66b6ba2a715ab6e /test/compress
parentf1eb03f2c0f860a963b2f61c5f8565d8703a18cb (diff)
downloadtracifyjs-ec7f071272384db82dff0f8fb6629f4f6fee43a5.tar.gz
tracifyjs-ec7f071272384db82dff0f8fb6629f4f6fee43a5.zip
fix corner case in `dead_code` (#3553)
fixes #3552
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/dead-code.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index 501d55ec..93fc9f41 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -1042,3 +1042,25 @@ function_assign: {
}
expect_stdout: "PASS"
}
+
+issue_3552: {
+ options = {
+ dead_code: true,
+ pure_getters: "strict",
+ }
+ input: {
+ var a = "PASS";
+ (function() {
+ (1..p += 42) && (a = "FAIL");
+ })();
+ console.log(a);
+ }
+ expect: {
+ var a = "PASS";
+ (function() {
+ (1..p += 42) && (a = "FAIL");
+ })();
+ console.log(a);
+ }
+ expect_stdout: "PASS"
+}