Skip to content

Commit c430e07

Browse files
committed
Invoke handler using invokeIt to avoid JS bugs
1 parent 5758a77 commit c430e07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/kotlinx-coroutines-core-common/src/JobSupport.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ internal open class JobSupport constructor(active: Boolean) : Job, SelectClause0
456456
} else {
457457
if (state is Finishing && state.cancelled != null && onCancelling) {
458458
// installing cancellation handler on job that is being cancelled
459-
if (invokeImmediately) handler(state.cancelled.cause)
459+
if (invokeImmediately) handler.invokeIt(state.cancelled.cause)
460460
return NonDisposableHandle
461461
}
462462
val node = nodeCache ?: makeNode(handler, onCancelling).also { nodeCache = it }

0 commit comments

Comments
 (0)