aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/conditionals.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js
index c5639836..e7ea2bb2 100644
--- a/test/compress/conditionals.js
+++ b/test/compress/conditionals.js
@@ -933,3 +933,32 @@ issue_1645_2: {
}
expect_stdout: true
}
+
+condition_symbol_matches_consequent: {
+ options = {
+ conditionals: true,
+ }
+ input: {
+ function foo(x, y) {
+ return x ? x : y;
+ }
+ function bar() {
+ return g ? g : h;
+ }
+ var g = 4;
+ var h = 5;
+ console.log(foo(3, null), foo(0, 7), foo(true, false), bar());
+ }
+ expect: {
+ function foo(x, y) {
+ return x || y;
+ }
+ function bar() {
+ return g || h;
+ }
+ var g = 4;
+ var h = 5;
+ console.log(foo(3, null), foo(0, 7), foo(true, false), bar());
+ }
+ expect_stdout: "3 7 true 4"
+}