From c6cb389591b9027c6722fb76d7a79c93c117c43b Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 9 Feb 2017 18:20:52 +0300 Subject: [PATCH] JS kotlin.dom: deprecate asElementList harder. Minor: correct exception message. --- js/js.libraries/src/dom/Dom.kt | 2 +- js/js.libraries/src/dom/ItemArrayLike.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/js.libraries/src/dom/Dom.kt b/js/js.libraries/src/dom/Dom.kt index a0e96448c57..34995260063 100644 --- a/js/js.libraries/src/dom/Dom.kt +++ b/js/js.libraries/src/dom/Dom.kt @@ -70,7 +70,7 @@ fun Document?.elements(namespaceUri: String, localName: String): List { * * If you want to get a snapshot filtered to contain elements only it's better to use [filterElements] function. */ -@Deprecated("This API is going to be removed", level = DeprecationLevel.WARNING) +@Deprecated("This API is going to be removed, use asList() as a close replacement instead.", ReplaceWith("asList() as List", "org.w3c.dom.asList"), level = DeprecationLevel.ERROR) public fun NodeList.asElementList(): List = ElementListAsList(this) /** diff --git a/js/js.libraries/src/dom/ItemArrayLike.kt b/js/js.libraries/src/dom/ItemArrayLike.kt index 531d5904810..82ae7e21591 100644 --- a/js/js.libraries/src/dom/ItemArrayLike.kt +++ b/js/js.libraries/src/dom/ItemArrayLike.kt @@ -29,6 +29,6 @@ public fun ItemArrayLike.asList(): List = object : AbstractList() { override fun get(index: Int): T = when { index in 0..lastIndex -> this@asList.item(index) as T - else -> throw IndexOutOfBoundsException("index $index is not in range [0..$lastIndex)") + else -> throw IndexOutOfBoundsException("index $index is not in range [0..$lastIndex]") } } \ No newline at end of file