Commit 0598711
committed
Add an extended attribute to allow propagating TC39's AsyncContext
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.1 parent b1bba60 commit 0598711
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14876 | 14876 | | |
14877 | 14877 | | |
14878 | 14878 | | |
14879 | | - | |
| 14879 | + | |
14880 | 14880 | | |
14881 | 14881 | | |
14882 | 14882 | | |
| |||
0 commit comments