[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:
Sergej Jaskiewicz
2021-11-30 18:14:44 +03:00
committed by Space
parent 3b98c330fd
commit e13b6b2a90
5 changed files with 85 additions and 104 deletions
+1 -5
View File
@@ -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)
}
}