js.stdlib: native replace made private.
This commit is contained in:
@@ -50,6 +50,16 @@ public val CharSequence.size: Int get() = noImpl
|
||||
library
|
||||
public fun CharSequence.isEmpty(): Boolean = noImpl
|
||||
|
||||
|
||||
|
||||
// native because we need to escape newValue
|
||||
native("replace")
|
||||
private fun String.nativeReplace(oldValue: String, newValue: String): String = noImpl
|
||||
|
||||
native("replace")
|
||||
private fun String.nativeReplace(pattern: RegExp, replacement: String): String = noImpl
|
||||
|
||||
|
||||
/*
|
||||
|
||||
native public fun String.equalsIgnoreCase(anotherString: String) : Boolean = (this as java.lang.String).equalsIgnoreCase(anotherString)
|
||||
|
||||
@@ -78,3 +78,7 @@ public inline fun String.capitalize(): String {
|
||||
public inline fun String.decapitalize(): String {
|
||||
return if (isNotEmpty()) substring(0, 1).toLowerCase() + substring(1) else this
|
||||
}
|
||||
|
||||
|
||||
public fun String.replace(oldValue: String, newValue: String): String = nativeReplace(oldValue, newValue.nativeReplace("$", "$$"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user