1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
function testThrowingObjectEqUndefined() { try { var obj = { toString: function() { throw 0; } }; for (var i = 0; i < 5; i++) "" + (obj == undefined); return i === 5; } catch (e) { return "" + e; } } assertEq(testThrowingObjectEqUndefined(), true);