diff --git a/js/js.libraries/src/core/kotlin_special.kt b/js/js.libraries/src/core/kotlin_special.kt index a26fc5bd68d..4e0757ee5a9 100644 --- a/js/js.libraries/src/core/kotlin_special.kt +++ b/js/js.libraries/src/core/kotlin_special.kt @@ -214,72 +214,72 @@ public fun Array.copyOf(newSize: Int): Array { * Returns new array which is a copy of range of original array. */ suppress("NOTHING_TO_INLINE") -public inline fun Array.copyOfRange(from: Int, to: Int): Array { - return (this: dynamic).slice(from, to) +public inline fun Array.copyOfRange(fromIndex: Int, toIndex: Int): Array { + return (this: dynamic).slice(fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ suppress("NOTHING_TO_INLINE") -public inline fun BooleanArray.copyOfRange(from: Int, to: Int): BooleanArray { - return (this: dynamic).slice(from, to) +public inline fun BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray { + return (this: dynamic).slice(fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ suppress("NOTHING_TO_INLINE") -public inline fun ByteArray.copyOfRange(from: Int, to: Int): ByteArray { - return (this: dynamic).slice(from, to) +public inline fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray { + return (this: dynamic).slice(fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ suppress("NOTHING_TO_INLINE") -public inline fun CharArray.copyOfRange(from: Int, to: Int): CharArray { - return (this: dynamic).slice(from, to) +public inline fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray { + return (this: dynamic).slice(fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ suppress("NOTHING_TO_INLINE") -public inline fun DoubleArray.copyOfRange(from: Int, to: Int): DoubleArray { - return (this: dynamic).slice(from, to) +public inline fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray { + return (this: dynamic).slice(fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ suppress("NOTHING_TO_INLINE") -public inline fun FloatArray.copyOfRange(from: Int, to: Int): FloatArray { - return (this: dynamic).slice(from, to) +public inline fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray { + return (this: dynamic).slice(fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ suppress("NOTHING_TO_INLINE") -public inline fun IntArray.copyOfRange(from: Int, to: Int): IntArray { - return (this: dynamic).slice(from, to) +public inline fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray { + return (this: dynamic).slice(fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ suppress("NOTHING_TO_INLINE") -public inline fun LongArray.copyOfRange(from: Int, to: Int): LongArray { - return (this: dynamic).slice(from, to) +public inline fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray { + return (this: dynamic).slice(fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ suppress("NOTHING_TO_INLINE") -public inline fun ShortArray.copyOfRange(from: Int, to: Int): ShortArray { - return (this: dynamic).slice(from, to) +public inline fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray { + return (this: dynamic).slice(fromIndex, toIndex) } /** diff --git a/libraries/stdlib/src/generated/_SpecialJVM.kt b/libraries/stdlib/src/generated/_SpecialJVM.kt index 28ee4314768..a48abe04611 100644 --- a/libraries/stdlib/src/generated/_SpecialJVM.kt +++ b/libraries/stdlib/src/generated/_SpecialJVM.kt @@ -345,72 +345,72 @@ public fun Array.copyOf(newSize: Int): Array { /** * Returns new array which is a copy of range of original array. */ -public fun Array.copyOfRange(from: Int, to: Int): Array { - return Arrays.copyOfRange(this, from, to) +public fun Array.copyOfRange(fromIndex: Int, toIndex: Int): Array { + return Arrays.copyOfRange(this, fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ -public fun BooleanArray.copyOfRange(from: Int, to: Int): BooleanArray { - return Arrays.copyOfRange(this, from, to) +public fun BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray { + return Arrays.copyOfRange(this, fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ -public fun ByteArray.copyOfRange(from: Int, to: Int): ByteArray { - return Arrays.copyOfRange(this, from, to) +public fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray { + return Arrays.copyOfRange(this, fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ -public fun CharArray.copyOfRange(from: Int, to: Int): CharArray { - return Arrays.copyOfRange(this, from, to) +public fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray { + return Arrays.copyOfRange(this, fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ -public fun DoubleArray.copyOfRange(from: Int, to: Int): DoubleArray { - return Arrays.copyOfRange(this, from, to) +public fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray { + return Arrays.copyOfRange(this, fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ -public fun FloatArray.copyOfRange(from: Int, to: Int): FloatArray { - return Arrays.copyOfRange(this, from, to) +public fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray { + return Arrays.copyOfRange(this, fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ -public fun IntArray.copyOfRange(from: Int, to: Int): IntArray { - return Arrays.copyOfRange(this, from, to) +public fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray { + return Arrays.copyOfRange(this, fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ -public fun LongArray.copyOfRange(from: Int, to: Int): LongArray { - return Arrays.copyOfRange(this, from, to) +public fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray { + return Arrays.copyOfRange(this, fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ -public fun ShortArray.copyOfRange(from: Int, to: Int): ShortArray { - return Arrays.copyOfRange(this, from, to) +public fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray { + return Arrays.copyOfRange(this, fromIndex, toIndex) } /** * Returns new array which is a copy of range of original array. */ platformName("mutableCopyOfRange") -public fun Array.copyOfRange(from: Int, to: Int): Array { - return Arrays.copyOfRange(this, from, to) +public fun Array.copyOfRange(fromIndex: Int, toIndex: Int): Array { + return Arrays.copyOfRange(this, fromIndex, toIndex) } /** diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJS.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJS.kt index 401dc8a65e8..82abed760c3 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJS.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJS.kt @@ -37,7 +37,7 @@ fun specialJS(): List { } } - templates add f("copyOfRange(from: Int, to: Int)") { + templates add f("copyOfRange(fromIndex: Int, toIndex: Int)") { // TODO: Arguments checking as in java? only(ArraysOfObjects, ArraysOfPrimitives) doc { "Returns new array which is a copy of range of original array." } @@ -46,7 +46,7 @@ fun specialJS(): List { returns("SELF") returns(ArraysOfObjects) { "Array" } body { - "return (this: dynamic).slice(from, to)" + "return (this: dynamic).slice(fromIndex, toIndex)" } } diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt index e20926b59c7..ceec51f09a2 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt @@ -50,13 +50,13 @@ fun specialJVM(): List { } - templates add f("copyOfRange(from: Int, to: Int)") { + templates add f("copyOfRange(fromIndex: Int, toIndex: Int)") { only(ArraysOfObjects, InvariantArraysOfObjects, ArraysOfPrimitives) doc { "Returns new array which is a copy of range of original array." } returns("SELF") annotations(InvariantArraysOfObjects) { """platformName("mutableCopyOfRange")"""} body { - "return Arrays.copyOfRange(this, from, to)" + "return Arrays.copyOfRange(this, fromIndex, toIndex)" } }