Fix tests failing after stdlib generation refactoring
This commit is contained in:
@@ -6,6 +6,9 @@ import js.library
|
||||
library
|
||||
open public class Exception(message: String? = null) : Throwable() {}
|
||||
|
||||
library
|
||||
open public class RuntimeException(message: String? = null) : Exception(message) {}
|
||||
|
||||
library("splitString")
|
||||
public fun String.split(regex : String) : Array<String> = js.noImpl
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public abstract class AbstractList<E>(): AbstractCollection<E>(), MutableList<E>
|
||||
}
|
||||
|
||||
library
|
||||
public open class ArrayList<E>() : AbstractList<E>() {
|
||||
public open class ArrayList<E>(capacity:Int=0) : AbstractList<E>() {
|
||||
}
|
||||
|
||||
library
|
||||
@@ -64,7 +64,19 @@ public open class HashSet<E>(): AbstractCollection<E>(), MutableSet<E> {
|
||||
}
|
||||
|
||||
library
|
||||
public open class HashMap<K, V>() : MutableMap<K, V> {
|
||||
public trait SortedSet<E> : Set<E> {
|
||||
}
|
||||
|
||||
library
|
||||
public open class TreeSet<E>() : AbstractCollection<E>(), MutableSet<E>, SortedSet<E> {
|
||||
}
|
||||
|
||||
library
|
||||
public open class LinkedHashSet<E>(): AbstractCollection<E>(), MutableSet<E> {
|
||||
}
|
||||
|
||||
library
|
||||
public open class HashMap<K, V>(capacity:Int=0) : MutableMap<K, V> {
|
||||
public override fun size() : Int = js.noImpl
|
||||
public override fun isEmpty() : Boolean = js.noImpl
|
||||
public override fun get(key : Any?) : V? = js.noImpl
|
||||
@@ -110,4 +122,4 @@ public trait Enumeration<E> {
|
||||
native
|
||||
public class Date() {
|
||||
public fun getTime() : Int = js.noImpl
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,12 +59,3 @@ public inline fun <K,V,R> MutableMap<K,V>.mapValues(transform : (Map.Entry<K,V>)
|
||||
return mapValuesTo(HashMap<K,R>(), transform)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a new List containing the results of applying the given *transform* function to each element in this collection
|
||||
*
|
||||
* @includeFunctionBody ../../test/CollectionTest.kt map
|
||||
*/
|
||||
public inline fun <T, R> Collection<T>.map(transform : (T) -> R) : List<R> {
|
||||
return mapTo(java.util.ArrayList<R>(), transform)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user