JS: fix issues with js() usage in inline functions

This commit is contained in:
Alexey Tsvetkov
2015-03-13 14:51:38 +03:00
parent 5ff5cea17a
commit 1557111277
11 changed files with 151 additions and 21 deletions
@@ -0,0 +1,14 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test
inline fun sum(x: Int, y: Int): Int = js("x + y")
fun test(x: Int, y: Int): Int = sum(sum(x, x), sum(y, y))
fun box(): String {
assertEquals(4, test(1, 1))
assertEquals(8, test(1, 3))
return "OK"
}