[JS IR BE] Add JsExport annotations
This commit is contained in:
+4
-4
@@ -6,10 +6,10 @@ object A {
|
||||
@JsName("js_property") val f: String get() = "property"
|
||||
}
|
||||
|
||||
fun test() = js("""
|
||||
var a = JS_TESTS.A;
|
||||
return a.js_method() + ";" + a.js_property;
|
||||
""")
|
||||
fun test(): dynamic {
|
||||
val a = A.asDynamic()
|
||||
return a.js_method() + ";" + a.js_property
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = test()
|
||||
|
||||
@@ -8,10 +8,9 @@ class B : A() {
|
||||
override fun f(x: Int) = "B.f($x)"
|
||||
}
|
||||
|
||||
fun test() = js("""
|
||||
var module = JS_TESTS;
|
||||
return new (module.A)().js_f(23) + ";" + new (module.B)().js_f(42);
|
||||
""")
|
||||
fun test(): dynamic {
|
||||
return A().asDynamic().js_f(23) + ";" + B().asDynamic().js_f(42)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = test()
|
||||
|
||||
@@ -8,10 +8,9 @@ class B : A {
|
||||
override fun f(x: Int) = "B.f($x)"
|
||||
}
|
||||
|
||||
fun test() = js("""
|
||||
var module = JS_TESTS;
|
||||
return new (module.B)().js_f(23);
|
||||
""")
|
||||
fun test(): dynamic {
|
||||
return B().asDynamic().js_f(23)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = test()
|
||||
|
||||
+4
-4
@@ -10,10 +10,10 @@ object A {
|
||||
@JsName("js_q") val q: String get() = "q"
|
||||
}
|
||||
|
||||
fun test() = js("""
|
||||
var a = JS_TESTS.A;
|
||||
return a.js_f(23) + ";" + a.js_g(42) + ";" + a.js_p + ";" + a.js_q;
|
||||
""")
|
||||
fun test(): dynamic {
|
||||
var a = A.asDynamic()
|
||||
return a.js_f(23) + ";" + a.js_g(42) + ";" + a.js_p + ";" + a.js_q
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = test()
|
||||
|
||||
Reference in New Issue
Block a user