Skip to content

Commit 03a266a

Browse files
committed
Immediately install handlers in Promise.asDeferred
1 parent e084cf7 commit 03a266a

File tree

1 file changed

+1
-1
lines changed
  • js/kotlinx-coroutines-core-js/src/main/kotlin/kotlinx/coroutines/experimental

1 file changed

+1
-1
lines changed

js/kotlinx-coroutines-core-js/src/main/kotlin/kotlinx/coroutines/experimental/Promise.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public fun <T> Deferred<T>.asPromise(): Promise<T> {
7171
public fun <T> Promise<T>.asDeferred(): Deferred<T> {
7272
val deferred = asDynamic().deferred
7373
@Suppress("UnsafeCastFromDynamic")
74-
return deferred ?: async { await() }
74+
return deferred ?: async(start = CoroutineStart.UNDISPATCHED) { await() }
7575
}
7676

7777
/**

0 commit comments

Comments
 (0)