blob: 63660de6432eff7ca8d375acce319c5bb0508c53 (
plain)
1
2
3
4
5
6
7
|
var g = newGlobal({newCompartment: true});
g.evaluate(`RegExp.prototype.exec = {};`);
var wrapper = g.evaluate(`/abc.+def/`);
assertEq(RegExp.prototype.test.call(wrapper, "abc"), false);
assertEq(RegExp.prototype.test.call(wrapper, "abcXdef"), true);
assertEq(RegExp.prototype[Symbol.match].call(wrapper, "abc"), null);
assertEq(RegExp.prototype[Symbol.match].call(wrapper, "abcXdef")[0], "abcXdef");
|