Array.copyOfRange: rename from, to to fromIndex, toIndex

This commit is contained in:
Ilya Gorbunov
2015-07-23 00:20:47 +03:00
parent aeb7666578
commit 877cb72ba1
4 changed files with 42 additions and 42 deletions
@@ -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)"
}
}