got the kotlin/Dom.kt, Preconditions.kt and AbstractIterator.kt compiling as JS; needs more testing of using these APIs from JS though...
This commit is contained in:
@@ -10,3 +10,15 @@ trait Iterable<T> {
|
||||
|
||||
library("splitString")
|
||||
public fun String.split(regex : String) : Array<String> = js.noImpl
|
||||
|
||||
library
|
||||
class IllegalArgumentException(message: String = "") : Exception() {}
|
||||
|
||||
library
|
||||
class IllegalStateException(message: String = "") : Exception() {}
|
||||
|
||||
library
|
||||
class IndexOutOfBoundsException(message: String = "") : Exception() {}
|
||||
|
||||
library
|
||||
class UnsupportedOperationException(message: String = "") : Exception() {}
|
||||
|
||||
@@ -73,6 +73,22 @@ public abstract open class AbstractCollection<erased E> : Collection<E> {
|
||||
|
||||
library
|
||||
public abstract open class AbstractList<erased E> : AbstractCollection<E>, List<E> {
|
||||
public override fun isEmpty() : Boolean = js.noImpl
|
||||
public override fun contains(o : Any?) : Boolean = js.noImpl
|
||||
public override fun iterator() : Iterator<E> = js.noImpl
|
||||
// public override fun indexOf(o : Any?) : Int = js.noImpl
|
||||
// public override fun lastIndexOf(o : Any?) : Int = js.noImpl
|
||||
// public override fun toArray() : Array<Any?> = js.noImpl
|
||||
// public override fun toArray<erased T>(a : Array<out T>) : Array<T> = js.noImpl
|
||||
public override fun set(index : Int, element : E) : E = js.noImpl
|
||||
public override fun add(e : E) : Boolean = js.noImpl
|
||||
public override fun add(index : Int, element : E) : Unit = js.noImpl
|
||||
library("removeByIndex")
|
||||
public override fun remove(index : Int) : E = js.noImpl
|
||||
public override fun remove(o : Any?) : Boolean = js.noImpl
|
||||
public override fun clear() : Unit = js.noImpl
|
||||
public override fun addAll(c : java.util.Collection<out E>) : Boolean = js.noImpl
|
||||
// public override fun addAll(index : Int, c : java.util.Collection<out E>) : Boolean = js.noImpl
|
||||
}
|
||||
|
||||
library
|
||||
|
||||
@@ -44,12 +44,10 @@ public final class StdLibToJSTest extends SingleFileTranslationTest {
|
||||
super("stdlib/");
|
||||
}
|
||||
|
||||
public void testDummy() {
|
||||
}
|
||||
|
||||
public void TODO_testCompileStandardLibraryFiles() throws Exception {
|
||||
public void testCompileStandardLibraryFiles() throws Exception {
|
||||
|
||||
generateJavaScriptFiles(MainCallParameters.noCall(), EcmaVersion.all(),
|
||||
"kotlin/Preconditions.kt",
|
||||
"kotlin/dom/Dom.kt",
|
||||
"kotlin/support/AbstractIterator.kt"
|
||||
);
|
||||
|
||||
@@ -289,8 +289,11 @@ var Kotlin;
|
||||
Kotlin.RuntimeException = Kotlin.Class.create(Kotlin.Exception);
|
||||
Kotlin.Exceptions.IndexOutOfBounds = Kotlin.Class.create(Kotlin.Exception);
|
||||
Kotlin.Exceptions.NullPointerException = Kotlin.Class.create(Kotlin.Exception);
|
||||
Kotlin.Exceptions.UnsupportedOperationException = Kotlin.Class.create(Kotlin.Exception);
|
||||
Kotlin.Exceptions.NoSuchElementException = Kotlin.Class.create(Kotlin.Exception);
|
||||
Kotlin.Exceptions.IllegalArgumentException = Kotlin.Class.create(Kotlin.Exception);
|
||||
Kotlin.Exceptions.IllegalStateException = Kotlin.Class.create(Kotlin.Exception);
|
||||
Kotlin.Exceptions.IndexOutOfBoundsException = Kotlin.Class.create(Kotlin.Exception);
|
||||
Kotlin.Exceptions.UnsupportedOperationException = Kotlin.Class.create(Kotlin.Exception);
|
||||
|
||||
Kotlin.throwNPE = function() {
|
||||
throw new Kotlin.Exceptions.NullPointerException();
|
||||
|
||||
Reference in New Issue
Block a user