summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Tuple/prototype/toSorted/toSortedcompare-with-no-tostring.js
blob: 68b5774d6116434ae66211a66ccb00d93f7d3c4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// |reftest| skip-if(!this.hasOwnProperty("Tuple"))
/* description: Tuple toSorted does cast values to String */

var toStringCalled = false;
Number.prototype.toString = function() {
  toStringCalled = true;
}

let sample = #[20, 100, 3];
let result = sample.toSorted();
assertEq(toStringCalled, false);
assertEq(result, #[100, 20, 3]);

reportCompare(0, 0);