aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-09-12 16:29:20 +0300
committerMihai Bazon <mihai@bazon.net>2012-09-12 16:29:20 +0300
commitf5027ec1fc67d6daeb51714eeddd06350cae00d6 (patch)
tree62a05c30c8c5107e92b9c28e8fe0794ccc77bd26 /test/compress
parenta132841fb920f6815eb6d153f4329242354f1cae (diff)
downloadtracifyjs-f5027ec1fc67d6daeb51714eeddd06350cae00d6.tar.gz
tracifyjs-f5027ec1fc67d6daeb51714eeddd06350cae00d6.zip
minor
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/conditionals.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js
index b9c348a0..54c0751d 100644
--- a/test/compress/conditionals.js
+++ b/test/compress/conditionals.js
@@ -87,3 +87,38 @@ ifs_4: {
x(foo)[10].bar.baz = (foo && bar) ? something() : something_else();
}
}
+
+ifs_5: {
+ options = {
+ conditionals: true
+ };
+ input: {
+ function f() {
+ if (foo) return;
+ bar();
+ baz();
+ }
+ function g() {
+ if (foo) return;
+ if (bar) return;
+ if (baz) return;
+ if (baa) return;
+ a();
+ b()
+ }
+ }
+ expect: {
+ function f() {
+ if (!foo) {
+ bar();
+ baz();
+ }
+ }
+ function g() {
+ if (!(foo || bar || baz || baa)) {
+ a();
+ b()
+ }
+ }
+ }
+}