Skip to content

Commit 40b7c79

Browse files
skuzmichqurbonzoda
authored andcommitted
[Wasm] Avoid using Any in JS interop due to KT-57136
1 parent 36dbc0e commit 40b7c79

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

runtime/wasmMain/src/kotlinx/benchmark/wasm/WasmBuiltInExecutor.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@ package kotlinx.benchmark.wasm
22

33
import kotlinx.benchmark.*
44

5+
6+
private external interface JsAny
7+
58
@JsFun("(p) => p")
6-
private external fun id(p: Any): Any
9+
private external fun jsId(p: JsAny): JsAny
10+
11+
private fun id(p: Any): Any {
12+
// TODO: Use dedicated type for passing Kotlin references to JS when it is available
13+
@Suppress("UNCHECKED_CAST_TO_EXTERNAL_INTERFACE")
14+
return jsId(p as JsAny)
15+
}
716

817
class WasmBuiltInExecutor(
918
name: String,

0 commit comments

Comments
 (0)