blob: beaeaa1644072eecb7cc85ca39ac8d5726fe8626 [file] [log] [blame]
var re = /a(b)c/;
for (var i = 0; i < 10; i++) {
// These two are of a form where we can convert exec() to test().
if (!re.exec("abc")) print("huh?");
re.exec("abc");
}
RegExp.prototype.test = 1;
for (var i = 0; i < 10; i++) {
// These two are the same form, but we've replaced test(), so we must
// not convert.
if (!re.exec("abc")) print("huh?"); // don't crash/assert
re.exec("abc"); // don't crash/assert
}