PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/js/src/jit-test/tests/basic/regexp-test-direct-bug-694752.js

http://github.com/zpao/v8monkey
JavaScript | 15 lines | 12 code | 2 blank | 1 comment | 2 complexity | 3fef59548fd2e57509b1c55a07ffc6c8 MD5 | raw file
 1function whoo() {
 2    // Cause mjit to use the script's RegExpObject directly when it compiles this function.
 3    assertEq(/foo.*baz/.test('foobarbaz'), true);
 4}
 5
 6var orig_test = RegExp.prototype.test
 7for (var i = 0; i < 50; ++i)
 8    whoo();
 9eval('RegExp.prototype.test = function(str) { return orig_test.call(this, str) }')
10for (var i = 0; i < 50; ++i)
11    whoo();
12RegExp.prototype.test = orig_test;
13gc();
14whoo();
15