summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testBug582766.js
blob: cfcafbed08c7f6abe002dd4ed093505a0c07ab6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
expected = 4;

var fourth = { nextSibling: null };
var third  = { nextSibling: fourth };
var second = { nextSibling: third };
var first  = { nextSibling: second };

function f() {
  let loopcount = 0;
  for (let node = first; node; node = node.nextSibling) {
    loopcount++;
  }
  return loopcount;
}

actual = f();

assertEq(actual, expected);