Fix Char.toLowerCase/Char.toUpperCase extensions

This commit is contained in:
Roman Artemev
2018-10-18 15:13:09 +03:00
committed by romanart
parent 0260dc813f
commit c496d8ed50
+2 -2
View File
@@ -9,10 +9,10 @@ package kotlin.text
public actual fun Char.isWhitespace(): Boolean = toString().matches("[\\s\\xA0]")
@kotlin.internal.InlineOnly
public actual inline fun Char.toLowerCase(): Char = js("String.fromCharCode")(this).toLowerCase().charCodeAt(0)
public actual inline fun Char.toLowerCase(): Char = js("String.fromCharCode")(toInt()).toLowerCase().charCodeAt(0).unsafeCast<Int>().toChar()
@kotlin.internal.InlineOnly
public actual inline fun Char.toUpperCase(): Char = js("String.fromCharCode")(this).toUpperCase().charCodeAt(0)
public actual inline fun Char.toUpperCase(): Char = js("String.fromCharCode")(toInt()).toUpperCase().charCodeAt(0).unsafeCast<Int>().toChar()
/**
* Returns `true` if this character is a Unicode high-surrogate code unit (also known as leading-surrogate code unit).