summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug848319.js
blob: 8f8f46457a059cee0113519785fe969b5b88d78e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function test() {
  for(var i=0; i<2; i++) {
    var a = /a/;
    assertEq(a.lastIndex, 0);
    a.exec("aaa");
    assertEq(a.lastIndex, 0);
  }

  for(var i=0; i<2; i++) {
    var a = /a/g;
    assertEq(a.lastIndex, 0);
    a.exec("aaa");
    assertEq(a.lastIndex, 1);
  }

  for(var i=0; i<2; i++) {
    var a = /a/y;
    assertEq(a.lastIndex, 0);
    a.exec("aaa");
    assertEq(a.lastIndex, 1);
  }
}

test();
test();