diff --git a/js/js.libraries/src/core/collections/AbstractMutableList.kt b/js/js.libraries/src/core/collections/AbstractMutableList.kt index e2b0f2c74c5..69c75045dc6 100644 --- a/js/js.libraries/src/core/collections/AbstractMutableList.kt +++ b/js/js.libraries/src/core/collections/AbstractMutableList.kt @@ -115,7 +115,7 @@ public abstract class AbstractMutableList protected constructor() : AbstractM } override fun remove() { - check(last != -1) + check(last != -1) { "Call next() or previous() before removing element from the iterator."} removeAt(last) index = last @@ -153,7 +153,7 @@ public abstract class AbstractMutableList protected constructor() : AbstractM } override fun set(element: E) { - require(last != -1) + check(last != -1) { "Call next() or previous() before updating element value with the iterator."} this@AbstractMutableList[last] = element } }