Skip to content

Commit fe2c2e4

Browse files
committed
~ Fix JS and Native code
1 parent 861e425 commit fe2c2e4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

kotlinx-coroutines-core/js/src/JSDispatcher.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ internal sealed class SetTimeoutBasedDispatcher: CoroutineDispatcher(), Delay {
3535
messageQueue.enqueue(block)
3636
}
3737

38-
override fun invokeOnTimeout(timeMillis: Long, block: Runnable): DisposableHandle {
38+
override fun invokeOnTimeout(timeMillis: Long, block: Runnable, context: CoroutineContext): DisposableHandle {
3939
val handle = setTimeout({ block.run() }, delayToInt(timeMillis))
4040
return ClearTimeout(handle)
4141
}
@@ -81,7 +81,7 @@ internal class WindowDispatcher(private val window: Window) : CoroutineDispatche
8181
window.setTimeout({ with(continuation) { resumeUndispatched(Unit) } }, delayToInt(timeMillis))
8282
}
8383

84-
override fun invokeOnTimeout(timeMillis: Long, block: Runnable): DisposableHandle {
84+
override fun invokeOnTimeout(timeMillis: Long, block: Runnable, context: CoroutineContext): DisposableHandle {
8585
val handle = window.setTimeout({ block.run() }, delayToInt(timeMillis))
8686
return object : DisposableHandle {
8787
override fun dispose() {

kotlinx-coroutines-core/native/src/EventLoop.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
package kotlinx.coroutines
66

7+
import kotlin.coroutines.*
78
import kotlin.system.*
89

910
internal actual abstract class EventLoopImplPlatform: EventLoop() {
@@ -13,7 +14,7 @@ internal actual abstract class EventLoopImplPlatform: EventLoop() {
1314
}
1415

1516
internal class EventLoopImpl: EventLoopImplBase() {
16-
override fun invokeOnTimeout(timeMillis: Long, block: Runnable): DisposableHandle =
17+
override fun invokeOnTimeout(timeMillis: Long, block: Runnable, context: CoroutineContext): DisposableHandle =
1718
scheduleInvokeOnTimeout(timeMillis, block)
1819
}
1920

0 commit comments

Comments
 (0)