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");