JS backend: added more tests for closures.

This commit is contained in:
Zalim Bashorov
2014-02-26 16:04:33 +04:00
parent ec71a90394
commit a48dc25c46
18 changed files with 518 additions and 5 deletions
@@ -0,0 +1,25 @@
package foo
fun run<T>(f: ()->T) = f()
fun box(): String {
val t = run {
object {
fun foo() = "3"
fun boo(param: String): String {
val a = object {
fun bar() = "57"
fun b(): String = run { param + bar() + foo() }
}
return a.b()
}
}
}
val r = t.boo("OK")
if (r != "OK573") return "r != \"OK573\", r = \"$r\""
return "OK"
}