summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/String/replace-flags.js
blob: 34b9475a33fe2f015e53fdea63bf1ca89c54f5ef (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
var BUGNUMBER = 1108382;
var summary = 'Remove non-standard flag argument from String.prototype.{search,match,replace}.';

printBugNumber(BUGNUMBER);
printStatus (summary);

var result = "bbbAa".match("a", "i");
assertEq(result.index, 4);
assertEq(result.length, 1);
assertEq(result[0], "a");

result = "bbbA".match("a", "i");
assertEq(result, null);

result = "bbbAa".search("a", "i");
assertEq(result, 4);

result = "bbbA".search("a", "i");
assertEq(result, -1);

result = "bbbAaa".replace("a", "b", "g");
assertEq(result, "bbbAba");

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