Skip to content

async stack traces - #1803

Open
nitsky wants to merge 1 commit into
quickjs-ng:masterfrom
tangramdotdev:async-stack-traces
Open

nitsky wants to merge 1 commit into
quickjs-ng:masterfrom
tangramdotdev:async-stack-traces

Conversation

@nitsky

@nitsky nitsky commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

This PR adds support for async stack traces in a style similar to V8. It supports:

  • Async functions and generators.
  • Promise chains, including .then(), .catch(), and .finally().
  • Promise.all(), Promise.any(), and Promise.allSettled(), with synthetic combinator frames and element indices.
  • CallSite.isAsync(), isPromiseAll(), and getPromiseIndex().

For example:

async function fail() {
    await 0;
    throw new Error("boom");
}

async function main() {
    await Promise.all([Promise.resolve(), fail()]);
}

main().catch(error => console.log(error.stack));

The stack now includes the awaiting function and the failing promise’s index:

    at fail (example.js:3:11)
    at async Promise.all (index 1)
    at async main (...)

See also #1248 and #1249.

@saghul
saghul requested a review from bnoordhuis October 5, 2026 09:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant