changed js tests/library after collections mapping

This commit is contained in:
Svetlana Isakova
2012-09-05 12:36:52 +04:00
parent 8bbb61a98c
commit e622be8a2d
7 changed files with 10 additions and 14 deletions
@@ -126,7 +126,7 @@ fun <T> Array<T>.toList() : List<T> = this.to(ArrayList<T>())
val String?.size : Int
get() = if (this != null) this.length else 0;
fun <T, C: Collection<T>> Array<T>.to(result: C) : C {
fun <T, C: MutableCollection<T>> Array<T>.to(result: C) : C {
for (elem in this)
result.add(elem)
return result
@@ -162,6 +162,6 @@ fun makeField(s : String) : Field {
// An excerpt from the Standard Library
val String?.indices : IntRange get() = IntRange(0, this.sure().size)
fun <K, V> Map<K, V>.set(k : K, v : V) { put(k, v) }
fun <K, V> MutableMap<K, V>.set(k : K, v : V) { put(k, v) }
val <T> Array<T>.isEmpty : Boolean get() = size == 0