summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testWhileObjectOrNull.js
blob: 51316ae8ec22c1fb2c28b2c9571b20663ffdcd29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function testWhileObjectOrNull()
{
  try
  {
    for (var i = 0; i < 3; i++)
    {
      var o = { p: { p: null } };
      while (o.p)
        o = o.p;
    }
    return "pass";
  }
  catch (e)
  {
    return "threw exception: " + e;
  }
}
assertEq(testWhileObjectOrNull(), "pass");