Files
kotlin-fork/js/js.translator/testData/box/native/long.kt
T
Svyatoslav Kuzmich 9bc6b420a9 [Wasm][Stdlib] Add public APIs for linear memory access
Needed for interop with APIs that use linear memory.
2022-12-29 19:25:23 +00:00

20 lines
587 B
Kotlin
Vendored
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// EXPECTED_REACHABLE_NODES: 1490
// 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())
assertTrue(Date(1995, 9, 4, 0, 0, 0, 0L).toLocaleString("en-US") in listOf(
"10/4/1995, 12:00:00 AM",
"10/4/1995, 12:00:00AM" // New v8 uses NNBSP
))
assertEquals(812764800000.0, Date.UTC(1995, 9, 4, 0, 0, 0, 0L))
return "OK"
}