[Wasm] Boolean boxed instances are the same
Fixed #KT-65411
This commit is contained in:
committed by
Space Team
parent
a171f774be
commit
a5ef668e3c
@@ -63,6 +63,20 @@ internal fun nullableDoubleIeee754Equals(lhs: Double?, rhs: Double?): Boolean {
|
||||
return wasm_f64_eq(lhs, rhs)
|
||||
}
|
||||
|
||||
private var TRUE: Boolean? = null
|
||||
private var FALSE: Boolean? = null
|
||||
|
||||
internal fun getBoxedBoolean(x: Boolean): Boolean? =
|
||||
if (x) {
|
||||
TRUE ?: boxBoolean(true).also { TRUE = it }
|
||||
} else {
|
||||
FALSE ?: boxBoolean(false).also { FALSE = it }
|
||||
}
|
||||
|
||||
@ExcludedFromCodegen
|
||||
internal fun boxBoolean(x: Boolean): Boolean? =
|
||||
implementedAsIntrinsic
|
||||
|
||||
@ExcludedFromCodegen
|
||||
internal fun <T, R> boxIntrinsic(x: T): R =
|
||||
implementedAsIntrinsic
|
||||
|
||||
Reference in New Issue
Block a user