JS kotlin.dom: deprecate asElementList harder.

Minor: correct exception message.
This commit is contained in:
Ilya Gorbunov
2017-02-09 18:20:52 +03:00
parent 9a7405adc6
commit c6cb389591
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ fun Document?.elements(namespaceUri: String, localName: String): List<Element> {
*
* 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<Element>", "org.w3c.dom.asList"), level = DeprecationLevel.ERROR)
public fun NodeList.asElementList(): List<Element> = ElementListAsList(this)
/**
+1 -1
View File
@@ -29,6 +29,6 @@ public fun <T> ItemArrayLike<T>.asList(): List<T> = object : AbstractList<T>() {
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]")
}
}