MCPcopy Create free account
hub / github.com/nodejs/node / testErrorsDuringFormatting

Function testErrorsDuringFormatting

deps/v8/test/mjsunit/stack-traces.js:234–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232// If an error occurs while the stack trace is being formatted it should
233// be handled gracefully.
234function 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

Callers 1

stack-traces.jsFile · 0.85

Calls 2

assertThrowsFunction · 0.50
fooMethod · 0.45

Tested by

no test coverage detected