You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implements the coherent async-context call boundary shared by the pinned Home and Bun inventories. This is a child of the private ABI coverage work tracked by #140, #163, and #164.
Scope
AsyncContextFrame__withAsyncContextIfNeeded
Bun__JSValue__isAsyncContextFrame
Bun__JSValue__call
Bake__getAsyncLocalStorage is intentionally out of scope: upstream exposes a separately stored Bake/dev-server ALS instance, not the currently active async-context value captured by these wrappers.
Acceptance
Add a realm-local active async-context value as a precise traced and relocated GC root.
Represent an AsyncContextFrame as a branded, non-callable object with strong callback and captured-context edges.
Return callbacks unchanged when no context is active and avoid double-wrapping existing frames.
Invoke plain callbacks and wrapped callbacks with exact argument ordering and global-this fallback for an empty receiver.
Install the captured context for the dynamic extent of the call and restore the prior context before normal return or exception publication.
Reject invalid/foreign handles without crossing VM ownership boundaries.
Refresh generated ABI inventories and coverage documentation, batch Debug/ReleaseSafe verification, then close this issue only after the pushed main commit is green.
Implemented and pushed directly to main in df79596 (feat(abi): implement async context calls (#373)).
Delivered:
AsyncContextFrame__withAsyncContextIfNeeded, Bun__JSValue__isAsyncContextFrame, and Bun__JSValue__call
realm-local precisely traced/relocated active async-context root
branded null-prototype non-callable frame with strong callback/context edges
exact inactive identity, no double wrapping, encoded argument order, empty-receiver global fallback, same-VM validation, and restoration before normal return or throw publication
insertion barriers plus a temporary root for the displaced context across callback-triggered GC
compiled Home and Bun consumer evidence and refreshed pinned inventories/docs
Home private consumer: 352/352 linked and runtime matrix passed
Bun private C-API extension consumer passed
C/API inventory audit passed
Coverage is now Home 365/471 (106 pending) and Bun 357/461 (104 pending). Bake__getAsyncLocalStorage remains intentionally separate because upstream stores a distinct Bake/dev-server ALS instance.
Activity
feat(abi): implement async context calls (#373)
chrisbbreuer commentedon Jul 20, 2026
Implemented and pushed directly to
mainin df79596 (feat(abi): implement async context calls (#373)).Delivered:
AsyncContextFrame__withAsyncContextIfNeeded,Bun__JSValue__isAsyncContextFrame, andBun__JSValue__callVerification (Debug and ReleaseSafe):
Coverage is now Home 365/471 (106 pending) and Bun 357/461 (104 pending).
Bake__getAsyncLocalStorageremains intentionally separate because upstream stores a distinct Bake/dev-server ALS instance.