Files
kotlin-fork/js/js.translator/testFiles/native/cases/undefined.kt
T
2012-03-02 20:05:16 +04:00

22 lines
389 B
Kotlin

package foo
import js.*
/*function g should return 0 if a parameter is undefined 1 if parameter is 1 and 3 if parameter is 3*/
native
fun f(g : (Int?)-> Int) : Boolean = js.noImpl
fun box() : Boolean {
val b = {
(a : Int?) ->
if (a == null) {
0
} else if (a == 1) {
1
} else {
3
}
}
return f(b)
}