Files
scriptc/docs/content
Chris Tate 7eeca8eb43 Add AsyncDisposableStack
new AsyncDisposableStack() compiles to a native stack handle with use,
adopt, defer, move, disposeAsync, disposed and [Symbol.asyncDispose], and
works with `await using`. disposeAsync runs the resources in reverse order
and awaits each result as Node does: the next resource runs one microtask
turn after the result settles, a callback that throws is not awaited, and
use() of null or undefined costs one await at the end when nothing else
was awaited. Failures chain into a SuppressedError, and an invalid receiver
rejects the returned promise.

use() of a class instance calls its [Symbol.asyncDispose] method, or its
[Symbol.dispose] method when it has no async one. The stack lives in a new
runtime unit, scr_async_disposable.c, linked when a program uses both
symbols and checked-dynamic promises; it shares DisposableStack's storage
through scr_disposable.h. Library mode refuses it with the rest of the
checked-dynamic async surface.
2026-10-18 00:57:21 -05:00
..
2026-10-18 00:57:21 -05:00