Revert "[JS IR] [runtime] Remove valueOf method from Long"

This reverts commit e13b6b2a90.

The significance of the breakage caused by the removal of `valueOf`
was underestimated.

#KT-50202 Open
This commit is contained in:
Sergej Jaskiewicz
2022-01-14 20:10:08 +03:00
committed by Space
parent bc3157162d
commit ceb744b53b
9 changed files with 184 additions and 51 deletions
+16
View File
@@ -0,0 +1,16 @@
// EXPECTED_REACHABLE_NODES: 1273
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: UNSUPPORTED_JS_INTEROP
// KJS_WITH_FULL_RUNTIME
// Test that APIs expecting Number behave correctly with Long values.
import kotlin.js.Date
fun box(): String {
assertEquals("1970-01-01T00:00:00.000Z", Date(0L).toISOString())
assertEquals("10/4/1995, 12:00:00 AM", Date(1995, 9, 4, 0, 0, 0, 0L).toLocaleString("en-US"))
assertEquals(812764800000.0, Date.UTC(1995, 9, 4, 0, 0, 0, 0L))
return "OK"
}