/js/src/jit-test/tests/basic/testBug582766.js

http://github.com/zpao/v8monkey · JavaScript · 18 lines · 14 code · 4 blank · 0 comment · 1 complexity · 01efe7158cfff03c3ffc7bc632753020 MD5 · raw file

  1. expected = 4;
  2. var fourth = { nextSibling: null };
  3. var third = { nextSibling: fourth };
  4. var second = { nextSibling: third };
  5. var first = { nextSibling: second };
  6. function f() {
  7. let loopcount = 0;
  8. for (let node = first; node; node = node.nextSibling) {
  9. loopcount++;
  10. }
  11. return loopcount;
  12. }
  13. actual = f();
  14. assertEq(actual, expected);