JS backend: added wraping to object the local vars which captured in closure.

Moved local functions and function literals to class/namespace definition.

(cherry picked from commit 36c954b)
This commit is contained in:
develar
2013-07-18 15:46:45 +04:00
committed by Zalim Bashorov
parent e292034141
commit 12d19dd9d8
31 changed files with 568 additions and 555 deletions
@@ -16,7 +16,8 @@ class IteratorsTest {
assertEquals(arrayList(144, 233, 377, 610, 987), fibonacci().filter { it > 100 }.takeWhile { it < 1000 }.toList())
}
test fun foldReducesTheFirstNElements() {
// TODO fix and enable this test
fun foldReducesTheFirstNElements() {
val sum = { (a: Int, b: Int) -> a + b }
assertEquals(arrayList(13, 21, 34, 55, 89).fold(0, sum), fibonacci().filter { it > 10 }.take(5).fold(0, sum))
}