Remove exceptions from js.* package. Move them to java.lang . Import java.lang by default

This commit is contained in:
pTalanov
2012-06-13 18:13:44 +04:00
parent 2f0278d63b
commit 7c1f670942
4 changed files with 11 additions and 11 deletions
+1 -7
View File
@@ -21,10 +21,4 @@ fun parseInt(s : String) : Int = js.noImpl
library
fun safeParseInt(s : String) : Int? = js.noImpl
library
fun safeParseDouble(s : String) : Double? = js.noImpl
library
open class Exception() : Throwable() {}
library
open class RuntimeException() : Exception() {}
library
class NumberFormatException() : Exception() {}
fun safeParseDouble(s : String) : Double? = js.noImpl
+7 -1
View File
@@ -8,6 +8,9 @@ trait Iterable<T> {
fun iterator() : java.util.Iterator<T> = js.noImpl
}
library
open class Exception() : Throwable() {}
library("splitString")
public fun String.split(regex : String) : Array<String> = js.noImpl
@@ -19,6 +22,9 @@ class IllegalStateException(message: String = "") : Exception() {}
library
class IndexOutOfBoundsException(message: String = "") : Exception() {}
s
library
class UnsupportedOperationException(message: String = "") : Exception() {}
library
class NumberFormatException(message: String = "") : Exception() {}
+1 -2
View File
@@ -1,7 +1,6 @@
package java.util
import js.*;
import java.lang.*
library("collectionsMax")
public fun max<T>(col : Collection<T>, comp : Comparator<T>) : T = js.noImpl
@@ -174,8 +174,9 @@ public final class AnalyzerFacadeForJS {
@Override
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("java.lang.*")));
directives.add(JetPsiFactory.createImportDirective(project, new ImportPath(JetStandardClasses.STANDARD_CLASSES_FQNAME, true)));
directives.add(JetPsiFactory.createImportDirective(project, new ImportPath("kotlin.*")));
}