4 ms·
> Stack traces are lost when generators throw(). V8 (and probably others) now has some special cases for async functions (and generators, I think, but those ar
by alangpierce 8y ago
> Stack traces are lost when generators throw().
V8 (and probably others) now has some special cases for async functions (and generators, I think, but those are much more rare) to show useful stack traces with the lineage of async calls. For example, this code shows the stack trace you'd expect when run in latest Chrome or Node.js.
async function c() { throw new Error('Some error'); }
async function b() { await c(); }
async function a() { await b(); }
a();
- Ajedi32 8y agoYeah, V8 in particular has possibly the best debugger tool available in any language ever; an easy to use UI, but still absolutely chock full of just about every useful feature you could imagine.