summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Array/sort_native_string_nan.js
blob: 67ec08a0151f89e24dc0957970287e76573ec0e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var array = ["not-a-number", "also-not-a-number"];
var copy = [...array];

// The sort comparator must be exactly equal to the bytecode pattern:
//
// JSOp::GetArg 0/1
// JSOp::GetArg 1/0
// JSOp::Sub
// JSOp::Return
array.sort(function(a, b) { return a - b; });

assertEqArray(array, copy);

if (typeof reportCompare === 'function')
  reportCompare(0, 0);