summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug1238003.js
blob: 64c89cb2732389f6793b04788e9a8143b6334112 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function f(str) {
   if (typeof str === 'string')
      str = new RegExp(str);
   for (var i = 0; i < 2000; i++)
      str.test('foo');
}
f("abc");

function g(str) {
   if (typeof str === 'string')
      str = new RegExp(str);
   for (var i = 0; i < 2000; i++)
      str.exec('foo');
}
g("abc");