js-self-profiling icon indicating copy to clipboard operation
js-self-profiling copied to clipboard

Metadata for "async" callstacks

Open dominiccooney opened this issue 6 years ago • 0 comments

I'll just throw this idea out there... I've seen JavaScript debuggers/instrumentation which synthesize callstacks between async operations. So for example if you had JS like:

function f(url) {
  fetch(url)
    .then(response => response.json())  // line 3
    .then(g);
}

function g(json) {
  // here
}

With "async" callstacks you'd see breadcrumbs which let you reconstruct a stack to "here" like f, fetch, f, g even though the JS VM stack is just (internal Promise gunk), g.

This could apply to any asynchronous callbacks: Promises, timers, etc.

It would be nice to have this.

dominiccooney avatar Nov 27 '18 07:11 dominiccooney