Align the Boolean.hashCode() value across platforms
Boolean.hashCode() should return 1231/1237 for true/false correspondingly. As a part of efforts to stabilize Native stdlib.
This commit is contained in:
committed by
Space Team
parent
668157eb41
commit
193aa0f935
@@ -146,6 +146,7 @@ class JsIntrinsics(private val irBuiltIns: IrBuiltIns, val context: JsIrBackendC
|
||||
|
||||
val jsCode = getInternalFunction("js") // js("<code>")
|
||||
val jsHashCode = getInternalFunction("hashCode")
|
||||
val jsGetBooleanHashCode = getInternalFunction("getBooleanHashCode")
|
||||
val jsGetNumberHashCode = getInternalFunction("getNumberHashCode")
|
||||
val jsGetObjectHashCode = getInternalFunction("getObjectHashCode")
|
||||
val jsGetStringHashCode = getInternalFunction("getStringHashCode")
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ class NumberOperatorCallsTransformer(context: JsIrBackendContext) : CallsTransfo
|
||||
|
||||
add(it, OperatorNames.NOT, intrinsics.jsNot)
|
||||
|
||||
add(it, HASH_CODE_NAME) { call -> toInt32(call.dispatchReceiver!!) }
|
||||
add(it, HASH_CODE_NAME, intrinsics.jsGetBooleanHashCode)
|
||||
}
|
||||
|
||||
for (type in primitiveNumbers) {
|
||||
|
||||
Reference in New Issue
Block a user