[whatwg/webidl] Add an extended attribute to allow propagating TC39's AsyncContext (PR #1568)

This PR updates WebIDL to add the `[PropagatesAsyncContext]` extended attribute. This is a part of the TC39 AsyncContext proposal, which allows storing state associated with an async flow of execution in JavaScript, and preserving it across different kinds of async continuations in both JS and the web platform.

This `[PropagatesAsyncContext]` extended attribute can only be applied to callback function types in operation arguments. When set, the callback context will also store an Async Context Mapping, which the callback will run in.

This allows a callback-taking operation to act like an async continuation, and propagate the state associated with the async flow of execution at the time that this operation is called to the callback.

This patch relies on HTML's PR whatwg/html#12152 to define the "run with Async Context Mapping" operation. This operation must be defined in a web specs rather than in the TC39 proposal because it deals with throwing in spec algorithms, which is not a concept in the TC39 specs.

<!--
Thank you for contributing to the Web IDL Standard! Please describe the change you are making and complete the checklist below if your change is not editorial.

When you submit this PR, and each time you edit this comment (including checking a checkbox through the UI!), PR Preview will run and update it. As such make any edits in one go and only after PR Preview has run.

If you think your PR is ready to land, please double-check that the build is passing and the checklist is complete before pinging.
-->

- [ ] At least two implementers are interested (and none opposed):
   * Chromium
   * …
- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * … <!-- If these tests are tentative, link a PR to make them non-tentative. -->
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chromium: …
   * Gecko: …
   * WebKit: …
   * Deno: …
   * Node.js: …
   * webidl2.js: …
   * widlparser: …
- [ ] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: …
- [ ] The top of this comment includes a [clear commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use. <!-- If you created this PR from a single commit, Github copied its message. Otherwise, you need to add a commit message yourself. -->

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)

You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/webidl/pull/1568

-- Commit Summary --

  * Add an extended attribute to allow propagating TC39's AsyncContext

-- File Changes --

    M index.bs (160)

-- Patch Links --

https://github.com/whatwg/webidl/pull/1568.patch
https://github.com/whatwg/webidl/pull/1568.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1568
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/pull/1568@github.com>

Received on Wednesday, 11 February 2026 13:48:52 UTC