rra/ilgonmic/exported-bridges-2
[JS IR] Use js name for signature [JS] bridgeSavingExport only for JS IR [JS IR] Fix test [JS IR] Stable and non stable signatures [JS IR] Consider return type in js signature and erase for JS name signature [JS IR] Copy signature from wasm to JS and export bridge, not original Merge-request: KT-MR-5174
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// TARGET_BACKEND: JS_IR
|
||||
// RUN_PLAIN_BOX_FUNCTION
|
||||
// INFER_MAIN_MODULE
|
||||
|
||||
// MODULE: bridge_saving_after_export
|
||||
// FILE: lib.kt
|
||||
|
||||
@JsExport
|
||||
open class A<T> {
|
||||
open fun foo(value: T): T = value
|
||||
}
|
||||
|
||||
@JsExport
|
||||
class B: A<String>() {
|
||||
override fun foo(value: String): String = value
|
||||
}
|
||||
|
||||
// FILE: test.js
|
||||
function box() {
|
||||
var a = new this["bridge_saving_after_export"].A()
|
||||
var aFoo = a.foo("ok")
|
||||
if (aFoo != "ok") return "fail 1"
|
||||
|
||||
var b = new this["bridge_saving_after_export"].B()
|
||||
var bFoo = b.foo("ok")
|
||||
if (bFoo != "ok") return "fail 2"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user