From a8957027309f926a519e7cda70fd96ac4d551fd1 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Sat, 1 Oct 2016 01:51:44 +0300 Subject: [PATCH] Remove js classes that should not be there --- compiler/testData/codegen/box/classes/kt1157.kt | 4 ++++ .../testData/codegen/box/classes/privateOuterFunctions.kt | 4 ++++ .../testData/codegen/box/classes/privateOuterProperty.kt | 4 ++++ js/js.libraries/src/core/core.kt | 2 -- js/js.libraries/src/core/javaio.kt | 5 +---- js/js.libraries/src/core/javalang.kt | 8 -------- js/js.libraries/src/core/javautil.kt | 2 ++ js/js.translator/testData/kotlin_lib.js | 5 ----- 8 files changed, 15 insertions(+), 19 deletions(-) diff --git a/compiler/testData/codegen/box/classes/kt1157.kt b/compiler/testData/codegen/box/classes/kt1157.kt index 2bf146c508e..126889d5110 100644 --- a/compiler/testData/codegen/box/classes/kt1157.kt +++ b/compiler/testData/codegen/box/classes/kt1157.kt @@ -11,6 +11,10 @@ public object SomeClass { public fun run(): Unit = work.run() } +interface Runnable { + fun run(): Unit +} + fun box(): String { SomeClass.run() return "OK" diff --git a/compiler/testData/codegen/box/classes/privateOuterFunctions.kt b/compiler/testData/codegen/box/classes/privateOuterFunctions.kt index d65a5a112e8..ceeb4ff69ce 100644 --- a/compiler/testData/codegen/box/classes/privateOuterFunctions.kt +++ b/compiler/testData/codegen/box/classes/privateOuterFunctions.kt @@ -28,4 +28,8 @@ class C { } } +interface Runnable { + fun run(): Unit +} + fun box() = C().foo() diff --git a/compiler/testData/codegen/box/classes/privateOuterProperty.kt b/compiler/testData/codegen/box/classes/privateOuterProperty.kt index 9596e1cb5b2..0f0bc3e452f 100644 --- a/compiler/testData/codegen/box/classes/privateOuterProperty.kt +++ b/compiler/testData/codegen/box/classes/privateOuterProperty.kt @@ -24,4 +24,8 @@ class C{ } } +interface Runnable { + fun run(): Unit +} + fun box() = if (C().foo() == 3) "OK" else "NOT OK" diff --git a/js/js.libraries/src/core/core.kt b/js/js.libraries/src/core/core.kt index 4eafffa68d7..ca949bf13bd 100644 --- a/js/js.libraries/src/core/core.kt +++ b/js/js.libraries/src/core/core.kt @@ -1,7 +1,5 @@ package kotlin.js -import java.util.* - @native public val noImpl: Nothing get() = throw Exception() diff --git a/js/js.libraries/src/core/javaio.kt b/js/js.libraries/src/core/javaio.kt index 7fc83c39bd0..d4cf53ac236 100644 --- a/js/js.libraries/src/core/javaio.kt +++ b/js/js.libraries/src/core/javaio.kt @@ -1,11 +1,8 @@ package java.io -@library -public class IOException(message: String = "") : Exception() {} - @library public interface Closeable { public fun close(): Unit } -interface Serializable +internal interface Serializable \ No newline at end of file diff --git a/js/js.libraries/src/core/javalang.kt b/js/js.libraries/src/core/javalang.kt index e00278d70a3..7445d8df3ef 100644 --- a/js/js.libraries/src/core/javalang.kt +++ b/js/js.libraries/src/core/javalang.kt @@ -16,14 +16,6 @@ package java.lang -@library -public interface Runnable { - public fun run(): Unit -} - -public fun Runnable(action: () -> Unit): Runnable = object : Runnable { - override fun run() = action() -} @library public interface Appendable { diff --git a/js/js.libraries/src/core/javautil.kt b/js/js.libraries/src/core/javautil.kt index 1e4c3b9ab27..2fa0fd8d849 100644 --- a/js/js.libraries/src/core/javautil.kt +++ b/js/js.libraries/src/core/javautil.kt @@ -26,6 +26,8 @@ public inline fun Comparator(crossinline comparison: (T, T) -> Int): Compara } +// TODO: Not supported +// typealias Date = kotlin.js.Date @native public class Date() { diff --git a/js/js.translator/testData/kotlin_lib.js b/js/js.translator/testData/kotlin_lib.js index 443251c6f0a..daae1656b63 100644 --- a/js/js.translator/testData/kotlin_lib.js +++ b/js/js.translator/testData/kotlin_lib.js @@ -212,7 +212,6 @@ Kotlin.IndexOutOfBoundsException = createClassNowWithMessage(Kotlin.RuntimeException); Kotlin.ConcurrentModificationException = createClassNowWithMessage(Kotlin.RuntimeException); Kotlin.ClassCastException = createClassNowWithMessage(Kotlin.RuntimeException); - Kotlin.IOException = createClassNowWithMessage(Kotlin.Exception); Kotlin.AssertionError = createClassNowWithMessage(Kotlin.Error); Kotlin.throwNPE = function (message) { @@ -333,10 +332,6 @@ ); - Kotlin.Runnable = Kotlin.createTraitNow(null, null, { - run: throwAbstractFunctionInvocationError("Runnable#run") - }); - Kotlin.Comparable = Kotlin.createTraitNow(null, null, { compareTo: throwAbstractFunctionInvocationError("Comparable#compareTo") });