1 2 3 4 5 6 7 8 9 10 11 12 13
function whoo() { (new Object()).foo() } Object.prototype.foo = function() { return undefined }; whoo(); Object.prototype.foo = undefined; gc(); try { whoo(); assertEq(0, 1); } catch(e) { assertEq(e instanceof TypeError, true); }