summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/TypedArray/sort_compare_nan.js
blob: c9af7dff77178b23f93381dd095e71b87c3c0842 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Returning zero from the sort comparator...
let ta = new Int32Array([0, 1]).sort(() => 0);
assertEq(ta[0], 0);
assertEq(ta[1], 1);

// ... should give the same result as returning NaN.
let tb = new Int32Array([0, 1]).sort(() => NaN);
assertEq(tb[0], 0);
assertEq(tb[1], 1);

if (typeof reportCompare === "function")
    reportCompare(true, true);