JS: char boxing

This commit is contained in:
Anton Bannykh
2016-12-27 16:11:14 +03:00
parent 55eeb74c08
commit 77aa685496
33 changed files with 438 additions and 59 deletions
@@ -12944,7 +12944,7 @@ public inline fun BooleanArray.asList(): List<Boolean> {
* Returns a [List] that wraps the original array.
*/
public inline fun CharArray.asList(): List<Char> {
return this.unsafeCast<Array<Char>>().asList()
return this.toTypedArray().asList()
}
/**
@@ -13072,7 +13072,7 @@ public fun BooleanArray.copyOf(newSize: Int): BooleanArray {
* Returns new array which is a copy of the original array, resized to the given [newSize].
*/
public fun CharArray.copyOf(newSize: Int): CharArray {
return arrayCopyResize(this, newSize, '\u0000')
return arrayCopyResize(this, newSize, 0)
}
/**
@@ -13494,7 +13494,7 @@ public fun BooleanArray.toTypedArray(): Array<Boolean> {
* Returns a *typed* object array containing all of the elements of this primitive array.
*/
public fun CharArray.toTypedArray(): Array<Char> {
return copyOf().unsafeCast<Array<Char>>()
return Array<Char>(size, { i -> this[i] })
}
/**