Remove exceptions from js.* package. Move them to java.lang . Import java.lang by default
This commit is contained in:
@@ -21,10 +21,4 @@ fun parseInt(s : String) : Int = js.noImpl
|
|||||||
library
|
library
|
||||||
fun safeParseInt(s : String) : Int? = js.noImpl
|
fun safeParseInt(s : String) : Int? = js.noImpl
|
||||||
library
|
library
|
||||||
fun safeParseDouble(s : String) : Double? = js.noImpl
|
fun safeParseDouble(s : String) : Double? = js.noImpl
|
||||||
library
|
|
||||||
open class Exception() : Throwable() {}
|
|
||||||
library
|
|
||||||
open class RuntimeException() : Exception() {}
|
|
||||||
library
|
|
||||||
class NumberFormatException() : Exception() {}
|
|
||||||
@@ -8,6 +8,9 @@ trait Iterable<T> {
|
|||||||
fun iterator() : java.util.Iterator<T> = js.noImpl
|
fun iterator() : java.util.Iterator<T> = js.noImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
library
|
||||||
|
open class Exception() : Throwable() {}
|
||||||
|
|
||||||
library("splitString")
|
library("splitString")
|
||||||
public fun String.split(regex : String) : Array<String> = js.noImpl
|
public fun String.split(regex : String) : Array<String> = js.noImpl
|
||||||
|
|
||||||
@@ -19,6 +22,9 @@ class IllegalStateException(message: String = "") : Exception() {}
|
|||||||
|
|
||||||
library
|
library
|
||||||
class IndexOutOfBoundsException(message: String = "") : Exception() {}
|
class IndexOutOfBoundsException(message: String = "") : Exception() {}
|
||||||
|
s
|
||||||
library
|
library
|
||||||
class UnsupportedOperationException(message: String = "") : Exception() {}
|
class UnsupportedOperationException(message: String = "") : Exception() {}
|
||||||
|
|
||||||
|
library
|
||||||
|
class NumberFormatException(message: String = "") : Exception() {}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package java.util
|
package java.util
|
||||||
|
|
||||||
import js.*;
|
import java.lang.*
|
||||||
|
|
||||||
|
|
||||||
library("collectionsMax")
|
library("collectionsMax")
|
||||||
public fun max<T>(col : Collection<T>, comp : Comparator<T>) : T = js.noImpl
|
public fun max<T>(col : Collection<T>, comp : Comparator<T>) : T = js.noImpl
|
||||||
|
|||||||
@@ -174,8 +174,9 @@ public final class AnalyzerFacadeForJS {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addDefaultImports(@NotNull Collection<JetImportDirective> directives) {
|
public void addDefaultImports(@NotNull Collection<JetImportDirective> directives) {
|
||||||
//TODO: these thing should not be hard-coded like that
|
//TODO: these things should not be hard-coded like that
|
||||||
directives.add(JetPsiFactory.createImportDirective(project, new ImportPath("js.*")));
|
directives.add(JetPsiFactory.createImportDirective(project, new ImportPath("js.*")));
|
||||||
|
directives.add(JetPsiFactory.createImportDirective(project, new ImportPath("java.lang.*")));
|
||||||
directives.add(JetPsiFactory.createImportDirective(project, new ImportPath(JetStandardClasses.STANDARD_CLASSES_FQNAME, true)));
|
directives.add(JetPsiFactory.createImportDirective(project, new ImportPath(JetStandardClasses.STANDARD_CLASSES_FQNAME, true)));
|
||||||
directives.add(JetPsiFactory.createImportDirective(project, new ImportPath("kotlin.*")));
|
directives.add(JetPsiFactory.createImportDirective(project, new ImportPath("kotlin.*")));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user