aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-04-18 15:32:22 +0100
committerGitHub <noreply@github.com>2020-04-18 22:32:22 +0800
commitfd6144d95baebb9eaa75b5695bd75a492479c691 (patch)
tree061c6e21d2be74f1e431218bdeae1daf4829c082 /test/compress
parent60d4e7b09fb962598a9f9f0fb64f92416a9f7e9c (diff)
downloadtracifyjs-fd6144d95baebb9eaa75b5695bd75a492479c691.tar.gz
tracifyjs-fd6144d95baebb9eaa75b5695bd75a492479c691.zip
enhance `conditionals` (#3798)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/conditionals.js2
-rw-r--r--test/compress/drop-unused.js1
-rw-r--r--test/compress/issue-1639.js6
3 files changed, 6 insertions, 3 deletions
diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js
index c4ae9095..b78f7267 100644
--- a/test/compress/conditionals.js
+++ b/test/compress/conditionals.js
@@ -1384,7 +1384,7 @@ hoist_decl: {
}
expect: {
var a, b;
- x() ? y() : z();
+ (x() ? y : z)();
}
}
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index 0f4c6dc6..38f132bf 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -1173,6 +1173,7 @@ var_catch_toplevel: {
x();
} catch (a) {
var a;
+ var a;
}
}();
}
diff --git a/test/compress/issue-1639.js b/test/compress/issue-1639.js
index 1579e06e..6633eb2d 100644
--- a/test/compress/issue-1639.js
+++ b/test/compress/issue-1639.js
@@ -22,8 +22,10 @@ issue_1639_1: {
console.log(a, b);
}
expect: {
- for (var a = 100, b = 10, L1 = 5; --L1 > 0;)
- if (--b, 0) var ignore = 0;
+ for (var a = 100, b = 10, L1 = 5; --L1 > 0;) {
+ var ignore;
+ --b;
+ }
console.log(a, b);
}
expect_stdout: "100 6"