Add informative NoSuchElementException message
This commit is contained in:
parent
3cd00b9df6
commit
95701bec1b
@ -70,9 +70,8 @@ internal class JSBuilder<T>(val bodyCallback: JSBuilder<T>.() -> BaseExpression)
|
|||||||
val k = key
|
val k = key
|
||||||
val o = `object`
|
val o = `object`
|
||||||
|
|
||||||
if (!(js("k in o") as Boolean)) {
|
if (!(js("k in o") as Boolean))
|
||||||
throw NoSuchElementException()
|
throw NoSuchElementException("Key $key is missing in the map.")
|
||||||
}
|
|
||||||
|
|
||||||
js("o[k]")
|
js("o[k]")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user