diff --git a/js/js.libraries/src/core/javautilCollections.kt b/js/js.libraries/src/core/javautilCollections.kt index e2d6059a220..d86414f30a4 100644 --- a/js/js.libraries/src/core/javautilCollections.kt +++ b/js/js.libraries/src/core/javautilCollections.kt @@ -1,13 +1,6 @@ package java.util -import java.lang.* -import java.util.* -import kotlin.comparisons.* - public object Collections { - @Deprecated("Use collection.maxWith(comparator) instead.", ReplaceWith("col.maxWith(comp)")) - public fun max(col: Collection, comp: Comparator): T = java.util.max(col, comp) - @Deprecated("Use list.reverse() instead.", ReplaceWith("list.reverse()")) public fun reverse(list: MutableList): Unit { val size = list.size @@ -19,6 +12,3 @@ public object Collections { } } } - -@library("collectionsMax") -private fun max(col: Collection, comp: Comparator): T = noImpl diff --git a/js/js.translator/testData/kotlin_lib.js b/js/js.translator/testData/kotlin_lib.js index e5d13e14da8..443251c6f0a 100644 --- a/js/js.translator/testData/kotlin_lib.js +++ b/js/js.translator/testData/kotlin_lib.js @@ -759,22 +759,6 @@ compare: throwAbstractFunctionInvocationError("Comparator#compare") }); - Kotlin.collectionsMax = function (c, comp) { - if (c.isEmpty()) { - //TODO: which exception? - throw new Error(); - } - var it = c.iterator(); - var max = it.next(); - while (it.hasNext()) { - var el = it.next(); - if (comp.compare(max, el) < 0) { - max = el; - } - } - return max; - }; - Kotlin.collectionsSort = function (mutableList, comparator) { var boundComparator = void 0; if (comparator !== void 0) { diff --git a/libraries/stdlib/test/js/JsCollectionsTest.kt b/libraries/stdlib/test/js/JsCollectionsTest.kt index 4e56f6cca56..fdf935b8009 100644 --- a/libraries/stdlib/test/js/JsCollectionsTest.kt +++ b/libraries/stdlib/test/js/JsCollectionsTest.kt @@ -1,19 +1,11 @@ package test.collections.js -import java.util.* - import kotlin.test.* -import org.junit.Test as test import kotlin.comparisons.* +import org.junit.Test as test class JsCollectionsTest { val TEST_LIST = arrayOf(2, 0, 9, 7, 1).toList() - val MAX_ELEMENT = 9 - val COMPARATOR = Comparator { x: Int, y: Int -> if (x > y) 1 else if (x < y) -1 else 0 } - - @test fun maxWithComparator() { - assertEquals(MAX_ELEMENT, Collections.max(TEST_LIST, COMPARATOR)) - } @test fun collectionToArray() { val array = TEST_LIST.toTypedArray()