From 1ba6594f62fae2f77aef96d086ad6902cd926ef3 Mon Sep 17 00:00:00 2001 From: Tal Ater Date: Tue, 13 Jan 2015 18:46:19 +0200 Subject: [PATCH] Added 3 tests proving that new ternary improvement only affects real booleans --- test/compress/conditionals.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js index 2b927250..9af1630a 100644 --- a/test/compress/conditionals.js +++ b/test/compress/conditionals.js @@ -343,6 +343,14 @@ cond_8: { } else { a = true; } + + // don't compress these + a = condition ? 1 : false; + + a = !condition ? true : 0; + + a = condition ? 1 : 0; + } expect: { a = !!condition; @@ -353,5 +361,8 @@ cond_8: { a = !!condition; a = !condition(); a = !condition; + a = condition ? 1 : false; + a = condition ? 0 : true; + a = condition ? 1 : 0; } } \ No newline at end of file