JS: support [suspend] fun main([args: Array<String>]) (KT-26628, KT-26572 fixed)
This commit is contained in:
committed by
Denis Zharkov
parent
7e9704e50d
commit
ead9b31e03
@@ -0,0 +1,30 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1299
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// CALL_MAIN
|
||||
|
||||
import kotlin.coroutines.*
|
||||
|
||||
var callback: () -> Unit = {}
|
||||
|
||||
val exception = Exception()
|
||||
|
||||
suspend fun main() {
|
||||
|
||||
suspendCoroutine<Unit> { cont ->
|
||||
callback = {
|
||||
cont.resume(Unit)
|
||||
}
|
||||
}
|
||||
|
||||
throw exception
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
callback()
|
||||
} catch (e: Exception) {
|
||||
assertTrue(e === exception)
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user