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,27 @@
package foo
class Counter {
var count: Int = 0
public fun inc() {
count++
}
}
fun test(c: Counter, ex: Exception): Unit = js("""
try {
throw ex;
} catch (e) {
c.inc()
} finally {
c.inc()
}
""")
fun box(): String {
val c = Counter()
test(c, NullPointerException())
assertEquals(2, c.count)
return "OK"
}