KT-15363 Fix failing test: missing capacity parameter check in JS
Partially restore JVM map capacity implementation
This commit is contained in:
@@ -187,5 +187,15 @@ internal actual fun checkCountOverflow(count: Int): Int {
|
||||
* JS map and set implementations do not make use of capacities or load factors.
|
||||
*/
|
||||
@PublishedApi
|
||||
@kotlin.internal.InlineOnly
|
||||
internal actual inline fun mapCapacity(expectedSize: Int) = expectedSize
|
||||
internal actual fun mapCapacity(expectedSize: Int) = expectedSize
|
||||
|
||||
/**
|
||||
* Checks a collection builder function capacity argument.
|
||||
* In JS no validation is made in Map/Set constructor yet.
|
||||
*/
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalStdlibApi
|
||||
@PublishedApi
|
||||
internal actual fun checkBuilderCapacity(capacity: Int) {
|
||||
require(capacity >= 0) { "capacity must be non-negative." }
|
||||
}
|
||||
Reference in New Issue
Block a user