JS backend: added jsCode test cases

This commit is contained in:
Alexey Tsvetkov
2014-12-09 13:46:01 +03:00
parent 97bbcab77d
commit c3f67c54bd
32 changed files with 657 additions and 0 deletions
@@ -0,0 +1,13 @@
package foo
fun callWithArgs(sumFunc: (Int, Int) -> Int, a: Int, b: Int): Int {
return sumFunc(a, b)
}
fun box(): String {
val kotlinSum: (Int, Int) -> Int = {(a, b) -> a + b}
val jsSum: (Int, Int) -> Int = js("function (a, b) { return a + b; }")
assertEquals(callWithArgs(kotlinSum, 1, 2), callWithArgs(jsSum, 1, 2))
return "OK"
}