()
| 232 | // If an error occurs while the stack trace is being formatted it should |
| 233 | // be handled gracefully. |
| 234 | function testErrorsDuringFormatting() { |
| 235 | function Nasty() { } |
| 236 | Nasty.prototype.foo = function () { throw new RangeError(); }; |
| 237 | var n = new Nasty(); |
| 238 | n.__defineGetter__('constructor', function () { CONS_FAIL; }); |
| 239 | assertThrows(()=>n.foo(), RangeError); |
| 240 | // Now we can't even format the message saying that we couldn't format |
| 241 | // the stack frame. Put that in your pipe and smoke it! |
| 242 | ReferenceError.prototype.toString = function () { NESTED_FAIL; }; |
| 243 | assertThrows(()=>n.foo(), RangeError); |
| 244 | } |
| 245 | |
| 246 | |
| 247 | // Poisonous object that throws a reference error if attempted converted to |
no test coverage detected