Files
kotlin-fork/compiler/testData/codegen/boxWasmJsInterop/jsExport.kt
T
2021-09-16 14:20:35 +03:00

19 lines
267 B
Kotlin
Vendored

// MODULE: main
// FILE: externals.kt
class C(val x: Int)
@JsExport
fun makeC(x: Int): C = C(x)
@JsExport
fun getX(c: C): Int = c.x
fun box(): String = "OK"
// FILE: jsExport__after.js
const c = main.makeC(300);
if (main.getX(c) !== 300) {
throw "Fail 1";
}