JS: decomposition of ternary operator

This commit is contained in:
Alexey Tsvetkov
2015-04-10 18:09:51 +03:00
parent 3782b9d382
commit fd844ad6e3
7 changed files with 137 additions and 0 deletions
@@ -0,0 +1,13 @@
package foo
fun test(x: Boolean): Boolean =
if (buzz(x)) buzz(true) else fizz(false)
fun box(): String {
assertEquals(true, test(true))
assertEquals("buzz(true);buzz(true);", pullLog())
assertEquals(false, test(false))
assertEquals("buzz(false);fizz(false);", pullLog())
return "OK"
}