[JS IR] [runtime] Remove valueOf method from Long
This method was used for coercing `Long` values to JavaScript `number`. However, it caused issues when `Long` values were concatenated to a string (see KT-8666, KT-26706).
This commit is contained in:
@@ -279,13 +279,9 @@ public class Long internal constructor(
|
||||
public override fun toFloat(): Float = toDouble().toFloat()
|
||||
public override fun toDouble(): Double = toNumber()
|
||||
|
||||
// This method is used by `toString()`
|
||||
@JsName("valueOf")
|
||||
internal fun valueOf() = toDouble()
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is Long && equalsLong(other)
|
||||
|
||||
override fun hashCode(): Int = hashCode(this)
|
||||
|
||||
override fun toString(): String = this.toStringImpl(radix = 10)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user