aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
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()
+ }
+ }
+ }
+}