Use package property COROUTINE_SUSPENDED instead of enum entry
For sake of encapsulation: actual property content might be different from the entry
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
package kotlin.coroutines
|
||||
|
||||
import kotlin.coroutines.intrinsics.CoroutineSingletons.*
|
||||
import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED
|
||||
|
||||
@PublishedApi
|
||||
@SinceKotlin("1.3")
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
package kotlin.coroutines
|
||||
|
||||
import kotlin.coroutines.intrinsics.CoroutineSingletons
|
||||
import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED
|
||||
|
||||
@SinceKotlin("1.3")
|
||||
@JsName("CoroutineImpl")
|
||||
@@ -45,7 +45,7 @@ internal abstract class CoroutineImpl(private val resultContinuation: Continuati
|
||||
|
||||
try {
|
||||
val outcome = doResume()
|
||||
if (outcome === CoroutineSingletons.COROUTINE_SUSPENDED) return
|
||||
if (outcome === COROUTINE_SUSPENDED) return
|
||||
currentResult = outcome
|
||||
currentException = null
|
||||
} catch (exception: dynamic) { // Catch all exceptions
|
||||
@@ -89,4 +89,4 @@ internal object CompletedContinuation : Continuation<Any?> {
|
||||
}
|
||||
|
||||
override fun toString(): String = "This continuation is already complete"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ package kotlin.coroutines
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater
|
||||
import kotlin.*
|
||||
import kotlin.coroutines.intrinsics.CoroutineSingletons.*
|
||||
import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED
|
||||
|
||||
@PublishedApi
|
||||
@SinceKotlin("1.3")
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ package kotlin.coroutines.jvm.internal
|
||||
|
||||
import java.io.Serializable
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.CoroutineSingletons
|
||||
import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED
|
||||
import kotlin.jvm.internal.FunctionBase
|
||||
import kotlin.jvm.internal.Reflection
|
||||
|
||||
@@ -30,7 +30,7 @@ internal abstract class BaseContinuationImpl(
|
||||
val outcome: SuccessOrFailure<Any?> =
|
||||
try {
|
||||
val outcome = invokeSuspend(param)
|
||||
if (outcome === CoroutineSingletons.COROUTINE_SUSPENDED) return
|
||||
if (outcome === COROUTINE_SUSPENDED) return
|
||||
SuccessOrFailure.success(outcome)
|
||||
} catch (exception: Throwable) {
|
||||
SuccessOrFailure.failure(exception)
|
||||
|
||||
Reference in New Issue
Block a user