aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-04-18 01:44:23 +0800
committerGitHub <noreply@github.com>2017-04-18 01:44:23 +0800
commitd1aa09c5c7af14bf5f17cc7ea2ab5d6be20e3220 (patch)
tree3a7b07667a8edb552bfd2e4c7ec08b276365c396 /test
parent6d5f341999da7dfad708979151932fd9d8242ebd (diff)
downloadtracifyjs-d1aa09c5c7af14bf5f17cc7ea2ab5d6be20e3220.tar.gz
tracifyjs-d1aa09c5c7af14bf5f17cc7ea2ab5d6be20e3220.zip
fix `reduce_vars` on conditionals (#1822)
Diffstat (limited to 'test')
-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 94d37cb7..ad2c90bc 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -2240,3 +2240,26 @@ boolean_binary_assign: {
}
expect_stdout: "undefined"
}
+
+cond_assign: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ !function() {
+ var a;
+ void 0 ? (a = 1) : 0;
+ console.log(a);
+ }();
+ }
+ expect: {
+ !function() {
+ var a;
+ void 0 ? (a = 1) : 0;
+ console.log(a);
+ }();
+ }
+ expect_stdout: "undefined"
+}