summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/extensions/String-match-flags.js
blob: b1a382fdfef0b812c3caa0857b06e2e82d3faec5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var BUGNUMBER = 1263139;
var summary = "String.prototype.match with non-string non-standard flags argument.";

print(BUGNUMBER + ": " + summary);

var called;
var flags = {
  toString() {
    called = true;
    return "";
  }
};

called = false;
"a".match("a", flags);
assertEq(called, false);

called = false;
"a".search("a", flags);
assertEq(called, false);

called = false;
"a".replace("a", "b", flags);
assertEq(called, false);

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