summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/RegExp/replace-global-unicode.js
blob: 80b3ea19962fcc69fb49b38a115ddc3dda900d92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var BUGNUMBER = 1287524;
var summary = 'RegExp.prototype[@@replace] should not use optimized path if RegExp.prototype.unicode is modified.';

print(BUGNUMBER + ": " + summary);

Object.defineProperty(RegExp.prototype, "unicode", {
  get() {
    RegExp.prototype.exec = () => null;
  }
});

var rx = RegExp("a", "g");
var s = "abba";
var r = rx[Symbol.replace](s, "c");
assertEq(r, "abba");

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