Skip to content

Commit f6d00e9

Browse files
authored
Merge pull request #42 from ForteScarlet/clear-code
清理部分遗留的测试代码;修改JS runInAsync 内默认调度器
2 parents b7f7bde + 2386667 commit f6d00e9

File tree

1 file changed

+3
-6
lines changed
  • runtime/suspend-transform-runtime/src/jsMain/kotlin/love.forte.plugin.suspendtrans/runtime

1 file changed

+3
-6
lines changed
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
package love.forte.plugin.suspendtrans.runtime
22

33
import kotlinx.coroutines.CoroutineScope
4+
import kotlinx.coroutines.Dispatchers
45
import kotlinx.coroutines.promise
56
import kotlin.coroutines.CoroutineContext
6-
import kotlin.coroutines.EmptyCoroutineContext
77
import kotlin.js.Promise
88

9-
private val CoroutineContext4Js: CoroutineContext = EmptyCoroutineContext
9+
private val CoroutineContext4Js: CoroutineContext = Dispatchers.Default
1010

1111
private 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)
1616
public 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
}

0 commit comments

Comments
 (0)