summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/String/split-order.js
blob: b6583ed3289c34837e15b8a907dc46304922469e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var BUGNUMBER = 1287521;
var summary = 'String.prototype.split should call ToUint32(limit) before ToString(separator).';

print(BUGNUMBER + ": " + summary);

var log = [];
"abba".split({
  toString() {
    log.push("separator-tostring");
    return "b";
  }
}, {
  valueOf() {
    log.push("limit-valueOf");
    return 0;
  }
});

assertEq(log.join(","), "limit-valueOf,separator-tostring");

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