mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 15:53:55 +00:00
20 lines
329 B
Kotlin
Vendored
20 lines
329 B
Kotlin
Vendored
// KJS_WITH_FULL_RUNTIME
|
|
// WITH_RUNTIME
|
|
fun box(): String {
|
|
val a = arrayListOf<String>()
|
|
|
|
while (true) {
|
|
if (a.size == 0) {
|
|
break
|
|
}
|
|
}
|
|
|
|
for (i in 1..2) {
|
|
a.add(try { foo() } catch (e: Throwable) { "OK" })
|
|
}
|
|
|
|
return a[0]
|
|
}
|
|
|
|
fun foo(): String = throw RuntimeException()
|