Files
scriptc/tests
Chris Tate 9e1027e13a Run async generator steps in the AsyncLocalStorage context of their resumer
An async generator kept the context of its creation for its whole life,
and a store its body entered carried into every later step. Node runs
each step in the execution that resumes it: a step starts with the
context of the next(), return() or throw() call, a store it enters
before its first await is the caller's after the call, and after an
await the step continues in its own copy.

Async generators now start each new step from the resumer's context and
hand the prefix's context back at the step's first suspension, as
synchronous generator steps and async function prefixes already do; the
continuation after an await keeps the generator's own. Two requests that
start from the settlement job, which runs from the loop, take Node's
contexts too: a request queued behind a running step starts in that
step's context, and a return() at a yield, whose unwind waits a turn,
runs in the return() call's context.

Corpus 7381 and 7382.
2026-10-22 11:46:44 -05:00
..
…
2026-10-20 17:56:44 -05:00