summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/String/split.js
blob: 1cce47f2883f1ff88558ae30fb6b1bff0a4d43d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var BUGNUMBER = 887016;
var summary = "Call RegExp.prototype[@@split] from String.prototype.split.";

print(BUGNUMBER + ": " + summary);

var called = 0;
var myRegExp = {
  [Symbol.split](S, limit) {
    assertEq(S, "abcAbcABC");
    assertEq(limit, 10);
    called++;
    return ["X", "Y", "Z"];
  }
};
assertEq("abcAbcABC".split(myRegExp, 10).join(","), "X,Y,Z");
assertEq(called, 1);

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