KJS: check hashCode property only for objects to avoid extra boxing for primitive values
Also in Nashorn everything has hashCode including primitive types, so the result can be different at Nashorn and at other engines.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
data class A(val a: Boolean)
|
||||
|
||||
fun box() : String {
|
||||
return if( A(true).hashCode()==1 && A(false).hashCode()==0 ) "OK" else "fail"
|
||||
if (A(true).hashCode() != 1) return "fail1"
|
||||
if (A(false).hashCode() !=0) return "fail2"
|
||||
return "OK"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user