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,20 @@
package foo
native trait Summizer {
fun sum(a: Int, b: Int): Int
}
fun getSummizer(): Summizer = js("""
var summizer = {
sum: function(a, b) { return a + b;}
};
return summizer;
""");
fun box(): String {
val summizer = getSummizer()
assertEquals(3, summizer.sum(1, 2))
return "OK"
}