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
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package foo
|
||||
|
||||
native
|
||||
class A(val v: String)
|
||||
|
||||
class B {
|
||||
fun bar(a: A, extLambda: A.(Int, String) -> String): String = a.extLambda(7, "_rr_")
|
||||
}
|
||||
|
||||
native
|
||||
fun nativeBox(b: B): String = noImpl
|
||||
|
||||
fun box(): String {
|
||||
val r = nativeBox(B())
|
||||
if (r != "foo_rr_7") return r
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user