Sign in
webkit
/
WebKit
/
53593e9541a2df2f62253c48cfc36324561ef5c4
/
.
/
JSTests
/
stress
/
sort-null-comparator.js
blob: 47398f08caa800c7df9178dc6e6424a14631ac86 [
file
] [
log
] [
blame
]
// While this is not required by the spec. It looks like some websites rely on the comparator being null.
function
assertEq
(
a
,
b
)
{
if
(
a
!==
b
)
throw
new
Error
();
}
let array
=
[
2
,
1
].
sort
(
null
);
assertEq
(
array
[
0
],
1
);
assertEq
(
array
[
1
],
2
);