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() {
40
40
* This is the default [CoroutineDispatcher] that is used by all standard builders like
41
41
* [launch], [async], etc if no dispatcher nor any other [ContinuationInterceptor] is specified in their context.
42
42
*/
43
- @Suppress(" PropertyName" )
43
+ @Suppress(" PropertyName" , " UnsafeCastFromDynamic " )
44
44
public actual val DefaultDispatcher : CoroutineDispatcher = when {
45
45
// 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()
47
47
else -> NodeDispatcher ()
48
48
}
49
49
You can’t perform that action at this time.
0 commit comments