JS backend: tests for reflection support

This commit is contained in:
Michael Nedzelsky
2014-07-22 15:21:35 +04:00
parent cc98664832
commit 145aa5a276
70 changed files with 1464 additions and 0 deletions
@@ -0,0 +1,28 @@
package foo
native
class A(val v: String) {
fun m(i:Int, s:String): String = js.noImpl
}
native
fun A.nativeExt(i:Int, s:String): String = js.noImpl
native("nativeExt2AnotherName")
fun A.nativeExt2(i:Int, s:String): String = js.noImpl
fun bar(a: A, extLambda: A.(Int, String) -> String): String = a.(extLambda)(4, "boo")
fun box(): String {
val a = A("test")
assertEquals("A.m test 4 boo", a.m(4, "boo"))
assertEquals("A.m test 4 boo", bar(a, A::m))
assertEquals("nativeExt test 4 boo", a.nativeExt(4, "boo"))
assertEquals("nativeExt test 4 boo", bar(a, A::nativeExt))
assertEquals("nativeExt2 test 4 boo", a.nativeExt2(4, "boo"))
assertEquals("nativeExt2 test 4 boo", bar(a, A::nativeExt2))
return "OK"
}