added a native array() function for the JS generation; also refactored the code generated collection APIs so that most of them can be used with JavaScript and included more array based APIs into the JS generation

This commit is contained in:
James Strachan
2012-07-05 15:49:10 +01:00
parent bea649bf87
commit b4dace2c29
59 changed files with 744 additions and 602 deletions
+22
View File
@@ -0,0 +1,22 @@
package testPackage
import org.junit.Test as test
import kotlin.test.*
class JsArrayTest {
test fun arrays() {
val a1 = array<String>()
val a2 = array("foo")
val a3 = array("foo", "bar")
assertEquals(0, a1.size)
assertEquals(1, a2.size)
assertEquals(2, a3.size)
assertEquals("[]", a1.toList().toString())
assertEquals("[foo]", a2.toList().toString())
assertEquals("[foo, bar]", a3.toList().toString())
}
}