michael@0: function whoo() { michael@0: // Cause mjit to use the script's RegExpObject directly when it compiles this function. michael@0: assertEq(/foo.*baz/.test('foobarbaz'), true); michael@0: } michael@0: michael@0: var orig_test = RegExp.prototype.test michael@0: for (var i = 0; i < 50; ++i) michael@0: whoo(); michael@0: eval('RegExp.prototype.test = function(str) { return orig_test.call(this, str) }') michael@0: for (var i = 0; i < 50; ++i) michael@0: whoo(); michael@0: RegExp.prototype.test = orig_test; michael@0: gc(); michael@0: whoo(); michael@0: