aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-23 01:04:00 +0800
committerGitHub <noreply@github.com>2019-10-23 01:04:00 +0800
commita53ab9937835f795c4714e981d10249e7829d2d4 (patch)
treea65b27d0c5255643fa0fecdd59a8cba86f1455f1 /test
parent02308a7b5651ce04703fafc43887636642c5e888 (diff)
downloadtracifyjs-a53ab9937835f795c4714e981d10249e7829d2d4.tar.gz
tracifyjs-a53ab9937835f795c4714e981d10249e7829d2d4.zip
fix corner case in `side_effects` (#3514)
fixes #3512
Diffstat (limited to 'test')
-rw-r--r--test/compress/functions.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index 5c8533de..0607e85c 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -3340,3 +3340,33 @@ issue_3506_3: {
}
expect_stdout: "PASS"
}
+
+issue_3512: {
+ options = {
+ collapse_vars: true,
+ pure_getters: "strict",
+ sequences: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ var a = "PASS";
+ (function(b) {
+ (function() {
+ b <<= this || 1;
+ b.a = "FAIL";
+ })();
+ })();
+ console.log(a);
+ }
+ expect: {
+ var a = "PASS";
+ (function(b) {
+ (function() {
+ (b <<= this || 1).a = "FAIL";
+ })();
+ })(),
+ console.log(a);
+ }
+ expect_stdout: "PASS"
+}