Improve Number.hashCode implementation in JavaScript

Fix KT-13577
This commit is contained in:
Alexey Andreev
2017-04-13 15:25:02 +03:00
parent c0542f7dc0
commit 38aecb14a2
3 changed files with 67 additions and 7 deletions
+20
View File
@@ -0,0 +1,20 @@
fun box(): String {
var value = (3).hashCode()
if (value != 3) return "fail1: $value"
value = (3.14).hashCode()
if (value != 319176039) return "fail2: $value"
value = (3.14159).hashCode()
if (value != -1321819243) return "fail3: $value"
value = (1e80).hashCode()
if (value != 314940496) return "fail4: $value"
value = (1e81).hashCode()
if (value != 1519485350) return "fail5: $value"
return "OK"
}