String.compareTo: SinceKotlin in JS and common, restore default parameter value in JVM

Default parameter is required to generate docs with Dokka for now.

#KT-18067
This commit is contained in:
Ilya Gorbunov
2018-08-12 03:18:19 +03:00
parent f05a19aafb
commit 27dde5f730
3 changed files with 12 additions and 7 deletions
+3 -1
View File
@@ -74,7 +74,9 @@ public inline val CharSequence.size: Int get() = length
@kotlin.internal.InlineOnly
internal inline fun String.nativeReplace(pattern: RegExp, replacement: String): String = asDynamic().replace(pattern, replacement)
public actual fun String.compareTo(other: String, ignoreCase: Boolean): Int {
@SinceKotlin("1.2")
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
public actual fun String.compareTo(other: String, ignoreCase: Boolean = false): Int {
if (ignoreCase) {
val n1 = this.length
val n2 = other.length