File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
runtime/suspend-transform-runtime/src/jsMain/kotlin/love.forte.plugin.suspendtrans/runtime Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 11package love.forte.plugin.suspendtrans.runtime
22
33import kotlinx.coroutines.CoroutineScope
4+ import kotlinx.coroutines.Dispatchers
45import kotlinx.coroutines.promise
56import kotlin.coroutines.CoroutineContext
6- import kotlin.coroutines.EmptyCoroutineContext
77import kotlin.js.Promise
88
9- private val CoroutineContext4Js : CoroutineContext = EmptyCoroutineContext
9+ private val CoroutineContext4Js : CoroutineContext = Dispatchers . Default
1010
1111private val CoroutineScope4Js : CoroutineScope = CoroutineScope (CoroutineContext4Js )
1212
1313
1414@Suppress(" FunctionName" )
15- // @Deprecated("Just for generate .", level = DeprecationLevel.HIDDEN)
15+ @Deprecated(" Just for compile plugin ." , level = DeprecationLevel .HIDDEN )
1616public fun <T , F : suspend () - > T > `$runInAsync$` (
1717 block : F ,
1818 scope : CoroutineScope ? = null
1919): Promise <T > {
20- println (" block: $block " )
21- println (" block.asDynamic().invoke: " + block.asDynamic().invoke)
22- println (" block::class: " + block::class )
2320 return (scope ? : CoroutineScope4Js ).promise { block.invoke() }
2421}
You can’t perform that action at this time.
0 commit comments