Deprecate js Math.random and provide replacement with Random.nextDouble
#KT-23564 Fixed
This commit is contained in:
@@ -12,6 +12,7 @@ package kotlin.js
|
||||
public external object Math {
|
||||
@Deprecated("Use kotlin.math.PI instead.", ReplaceWith("PI", "kotlin.math.PI"))
|
||||
public val PI: Double
|
||||
@Deprecated("Use Random.nextDouble instead", ReplaceWith("kotlin.random.Random.nextDouble()", "kotlin.random.Random"))
|
||||
public fun random(): Double
|
||||
@Deprecated("Use kotlin.math.abs instead.", ReplaceWith("abs(value)", "kotlin.math.abs"))
|
||||
public fun abs(value: Double): Double
|
||||
|
||||
@@ -11,8 +11,5 @@ public actual fun assertTypeEquals(expected: Any?, actual: Any?) {
|
||||
assertEquals(expected?.let { it::class.js }, actual?.let { it::class.js })
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
public actual fun randomInt(limit: Int): Int = (kotlin.js.Math.random() * limit).toInt()
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
internal actual inline fun String.removeLeadingPlusOnJava6(): String = this
|
||||
|
||||
Reference in New Issue
Block a user