[Wasm] Support restricted version of js("code") (KT-56955)

This commit is contained in:
Svyatoslav Kuzmich
2023-01-14 14:24:47 +01:00
committed by Space Team
parent eb8c47343a
commit 71e6b19760
11 changed files with 184 additions and 12 deletions
+11
View File
@@ -0,0 +1,11 @@
fun foo(x: Int, y: Int, z: String): Int = js("x + y + Number(z)")
val x: String = js("typeof 10")
fun box(): String {
val res = foo(10, 20, z = "30")
if (res != 60) return "Wrong foo: $res"
if (x != "number") return "Wrong x: $x"
return "OK"
}