File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
js/kotlinx-coroutines-core-js/src/main/kotlin/kotlinx/coroutines/experimental Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,10 @@ public actual object Unconfined : CoroutineDispatcher() {
4040 * This is the default [CoroutineDispatcher] that is used by all standard builders like
4141 * [launch], [async], etc if no dispatcher nor any other [ContinuationInterceptor] is specified in their context.
4242 */
43- @Suppress(" PropertyName" )
43+ @Suppress(" PropertyName" , " UnsafeCastFromDynamic " )
4444public actual val DefaultDispatcher : CoroutineDispatcher = when {
4545 // Check if we are in the browser and must use window.postMessage to avoid setTimeout throttling
46- jsTypeOf(window) != " undefined" -> window.asCoroutineDispatcher()
46+ jsTypeOf(window) != " undefined" && jsTypeOf(window.asDynamic().addEventListener) != " undefined " -> window.asCoroutineDispatcher()
4747 else -> NodeDispatcher ()
4848}
4949
You can’t perform that action at this time.
0 commit comments