Files
kotlin-fork/js/js.translator/testData/native/cases/passExtLambdaToNative.kt
T
Zalim Bashorov 206be96509 JS backend: added tests which pass an extension lambda to native code and visa versa.
Added workarounds in some tests because Rhino wrongly implicitly converts first parameter of `Function.call` to `Object`. But it's contradicts to ES5 specification(par. 15.3.4.4).

(#KT-4238, #KT-4345) In progress
2014-03-13 14:17:09 +04:00

16 lines
266 B
Kotlin

package foo
native
class A(val v: String)
native
fun bar(a: A, extLambda: A.(Int, String) -> String): String = noImpl
fun box(): String {
val a = A("test")
val r = bar(a) { i, s -> "${this.v} $i $s"}
if (r != "test 4 boo") return r
return "OK"
}