JS backend: added jsCode test cases
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package foo
|
||||
|
||||
fun countKeys(a: Array<Int>): Int = js("""
|
||||
var result = 0;
|
||||
|
||||
for (var key in a) {
|
||||
result += 1;
|
||||
}
|
||||
|
||||
return result;
|
||||
""")
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(3, countKeys(array(1,2,3)))
|
||||
assertEquals(4, countKeys(array(1,2,3,4)))
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user