commit | 03a266a7e7cf51668d51686277e7ed605f346489 | [log] [tgz] |
---|---|---|
author | Roman Elizarov <elizarov@gmail.com> | Thu Jan 11 10:34:46 2018 +0300 |
committer | Roman Elizarov <elizarov@gmail.com> | Thu Jan 11 10:34:46 2018 +0300 |
tree | 14d006ebbd98b6f893ea09fd5ded50e316e835f2 | |
parent | e084cf7d24b651ecd5f0184e6c5aba1276f8a8dd [diff] [blame] |
Immediately install handlers in Promise.asDeferred
diff --git a/js/kotlinx-coroutines-core-js/src/main/kotlin/kotlinx/coroutines/experimental/Promise.kt b/js/kotlinx-coroutines-core-js/src/main/kotlin/kotlinx/coroutines/experimental/Promise.kt index c8d17f3..621a737 100644 --- a/js/kotlinx-coroutines-core-js/src/main/kotlin/kotlinx/coroutines/experimental/Promise.kt +++ b/js/kotlinx-coroutines-core-js/src/main/kotlin/kotlinx/coroutines/experimental/Promise.kt
@@ -71,7 +71,7 @@ public fun <T> Promise<T>.asDeferred(): Deferred<T> { val deferred = asDynamic().deferred @Suppress("UnsafeCastFromDynamic") - return deferred ?: async { await() } + return deferred ?: async(start = CoroutineStart.UNDISPATCHED) { await() } } /**