blob: 7e0bae7dae2fdf0513a1ce2d67bbffa564cd8d42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
function whoo() {
// Cause mjit to use the script's RegExpObject directly when it compiles this function.
assertEq(/foo.*baz/.test('foobarbaz'), true);
}
var orig_test = RegExp.prototype.test
for (var i = 0; i < 50; ++i)
whoo();
eval('RegExp.prototype.test = function(str) { return orig_test.call(this, str) }')
for (var i = 0; i < 50; ++i)
whoo();
RegExp.prototype.test = orig_test;
gc();
whoo();
|