Bug 694752: Test JSOP_REGEXP inline path on recompilation. (test only)

--HG--
extra : rebase_source : 16c8cbb20b028af184114c2dcdf288209f94755d
This commit is contained in:
Chris Leary 2011-10-15 20:57:08 -07:00
parent 9d86c5cff9
commit 700d60d62e

View File

@ -0,0 +1,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();