Array.copyOfRange: rename from, to to fromIndex, toIndex
This commit is contained in:
@@ -37,7 +37,7 @@ fun specialJS(): List<GenericFunction> {
|
||||
}
|
||||
}
|
||||
|
||||
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<GenericFunction> {
|
||||
returns("SELF")
|
||||
returns(ArraysOfObjects) { "Array<T>" }
|
||||
body {
|
||||
"return (this: dynamic).slice(from, to)"
|
||||
"return (this: dynamic).slice(fromIndex, toIndex)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,13 +50,13 @@ fun specialJVM(): List<GenericFunction> {
|
||||
}
|
||||
|
||||
|
||||
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)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user