summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/RegExp/split-limit.js
blob: 5fa194b90bc67a079d22e93851333be81998ad09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var BUGNUMBER = 1287525;
var summary = "RegExp.prototype[@@split] shouldn't use optimized path if limit is not number.";

print(BUGNUMBER + ": " + summary);

var rx = /a/;
var r = rx[Symbol.split]("abba", {valueOf() {
  RegExp.prototype.exec = () => null;
  return 100;
}});
assertEq(r.length, 1);

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