diff --git a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp index 96a33aef50..832f1df2f4 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArray.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArray.cpp @@ -412,6 +412,10 @@ ThrowCompletionOr compare_typed_array_elements(GlobalObject& global_obje : (x.as_double() > y.as_double())) return 1; + // 8. If x is -0𝔽 and y is +0𝔽, return -1𝔽. + if (x.is_negative_zero() && y.is_positive_zero()) + return -1; + // 9. If x is +0𝔽 and y is -0𝔽, return 1𝔽. if (x.is_positive_zero() && y.is_negative_zero()) return 1;