[Wasm] Add interop annotation @JsFun

This commit is contained in:
Svyatoslav Kuzmich
2020-10-20 11:36:43 +03:00
parent e51a76bc4e
commit 4d59a58291
11 changed files with 59 additions and 18 deletions
@@ -51,11 +51,11 @@ public class String constructor(public val string: String) : Comparable<String>,
public override fun hashCode(): Int = 10
}
@WasmImport("runtime", "String_plus")
@JsFun("(it, other) => it + String(other)")
private fun stringPlusImpl(it: String, other: String): String =
implementedAsIntrinsic
@WasmImport("runtime", "String_getLength")
@JsFun("(it) => it.length")
private fun stringLengthImpl(it: String): Int =
implementedAsIntrinsic