[K/JS] Process JS-specific returnable blocks before the state machine building
^KT-60785 Fixed ^KT-63207 Fixed
This commit is contained in:
-2
@@ -1,8 +1,6 @@
|
||||
// WITH_STDLIB
|
||||
// EXPECTED_REACHABLE_NODES: 1292
|
||||
// KT-60785
|
||||
// Ignored until the rr/vgrechko/accidental-reification-2 will be merged
|
||||
// IGNORE_BACKEND: JS_IR, JS_IR_ES6
|
||||
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
// WITH_STDLIB
|
||||
// WITH_COROUTINES
|
||||
// IGNORE_BACKEND: JS
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object : Continuation<Unit> {
|
||||
override val context = EmptyCoroutineContext
|
||||
override fun resumeWith(result: Result<Unit>) {
|
||||
result.getOrThrow()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a: suspend () -> Unit = {
|
||||
mapOf(
|
||||
0x0000000000000000UL to 0x0000000000000000UL
|
||||
).forEach { (base: ULong) ->
|
||||
0x0000000000000000UL.ror(2)
|
||||
base.ror(1)
|
||||
}
|
||||
}
|
||||
|
||||
val b: () -> Unit = {
|
||||
mapOf(
|
||||
0x0000000000000000UL to 0x0000000000000000UL
|
||||
).forEach { (base: ULong) ->
|
||||
0x0000000000000000UL.ror(2)
|
||||
base.ror(1)
|
||||
}
|
||||
}
|
||||
|
||||
builder {
|
||||
a()
|
||||
b()
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
infix fun ULong.ror(shift: Int): ULong = this shr shift
|
||||
+1
-2
@@ -15,5 +15,4 @@ suspend fun bar(): Unit {
|
||||
}
|
||||
|
||||
// LINES(JS): 39 4 4 4 7 5 5 45 45 5 93 45 5 5 6 4 4 4 9 15 9 9 9 * 9 15 10 10 11 11 11 11 11 * 11 12 12 13 13 13 13 13 13 13 14 14 * 9 15 9 9 9 9
|
||||
// LINES(JS_IR): 4 4 * 93 3 45 45 7 7 6 9 9 * 9 * 9 * 10 10 * 11 * 11 12 12 * 13 * 13 14 14 15 15
|
||||
|
||||
// LINES(JS_IR): 4 4 * 9 9 * 4 * 4 * 19 5 5 * 19 * 19 19 * 19 19 * 6 6 * 19 * 19 * 4 * 9 * 9 * 10 10 * 11 * 11 12 12 * 13 * 13 14 14 15 15
|
||||
|
||||
Reference in New Issue
Block a user