Sign in
webkit
/
WebKit
/
6372d18ed2fb0e5306b33bd85febb537c2fcf56a
/
.
/
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
);