JS: translate when to JsSwitch when possible

See KT-21160
This commit is contained in:
Alexey Andreev
2017-11-09 19:14:01 +03:00
parent 7b403211dd
commit 678b4c67c1
21 changed files with 250 additions and 24 deletions
@@ -1,4 +1,6 @@
// WITH_RUNTIME
// CHECK_CASES_COUNT: function=sparse count=3
// CHECK_IF_COUNT: function=sparse count=0
fun sparse(x: Int): Int {
return when ((x % 4) * 100) {