Skip to content

Commit fee5229

Browse files
Add Async Context Mapping type (#144)
* Add Async Context Mapping type This will also be useful for web specs using it downstream. * Update spec.html
1 parent 4d3a42b commit fee5229

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

spec.html

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ <h1>The Async Context Mapping Record Specification Type</h1>
5757
</tr>
5858
</table>
5959
</emu-table>
60+
61+
<p>An <dfn id="async-context-mapping">Async Context Mapping</dfn> is a List of Async Context
62+
Mapping Records such that every Record in the List contains a unique [[AsyncContextKey]].</p>
6063
</emu-clause>
6164
</ins>
6265
</emu-clause>
@@ -120,10 +123,10 @@ <h1>Agents</h1>
120123
<ins>[[AsyncContextMapping]]</ins>
121124
</td>
122125
<td>
123-
<ins>a List of Async Context Mapping Records</ins>
126+
<ins>an Async Context Mapping</ins>
124127
</td>
125128
<td>
126-
<ins>A map from the AsyncContext.Variable instances to the saved ECMAScript language value. Every Record in the List contains a unique [[AsyncContextKey]]. The map is initially empty.</ins>
129+
<ins>A map from the AsyncContext.Variable instances to the saved ECMAScript language value. The map is initially empty.</ins>
127130
</td>
128131
</tr>
129132
</table>
@@ -366,10 +369,10 @@ <h1>PromiseReaction Records</h1>
366369
<ins>[[PromiseAsyncContextMapping]]</ins>
367370
</td>
368371
<td>
369-
<ins>a List of Async Context Mapping Records</ins>
372+
<ins>an Async Context Mapping</ins>
370373
</td>
371374
<td>
372-
<ins>A map from the AsyncContext.Variable instances to the saved ECMAScript language value. Every Record in the List contains a unique [[AsyncContextKey]].</ins>
375+
<ins>A map from the AsyncContext.Variable instances to the saved ECMAScript language value.</ins>
373376
</td>
374377
</tr>
375378
</table>
@@ -768,7 +771,7 @@ <h1>AsyncContext Abstract Operations</h1>
768771
<emu-clause id="sec-asynccontextsnapshot" type="abstract operation">
769772
<h1>
770773
AsyncContextSnapshot (
771-
): a List of Async Context Mapping Records
774+
): an Async Context Mapping
772775
</h1>
773776
<dl class="header">
774777
<dt>description</dt>
@@ -783,8 +786,8 @@ <h1>
783786
<emu-clause id="sec-asynccontextswap" type="abstract operation">
784787
<h1>
785788
AsyncContextSwap (
786-
_snapshotMapping_: a List of Async Context Mapping Records
787-
): a List of Async Context Mapping Records
789+
_snapshotMapping_: an Async Context Mapping
790+
): an Async Context Mapping
788791
</h1>
789792
<dl class="header">
790793
<dt>description</dt>
@@ -801,12 +804,12 @@ <h1>
801804
<emu-clause id="sec-createasynccontextsnapshot" type="abstract operation">
802805
<h1>
803806
CreateAsyncContextSnapshot (
804-
_snapshotMapping_: a List of Async Context Mapping Records
807+
_snapshotMapping_: an Async Context Mapping
805808
): either a normal completion containing an AsyncContext.Snapshot object or a throw completion
806809
</h1>
807810
<dl class="header">
808811
<dt>description</dt>
809-
<dd>It is used to obtain an AsyncContext.Snapshot object representing the given List of Async Context Mapping Records.</dd>
812+
<dd>It is used to obtain an AsyncContext.Snapshot object representing the given Async Context Mapping.</dd>
810813
</dl>
811814
<emu-alg>
812815
1. Let _asyncSnapshot_ be ? OrdinaryCreateFromConstructor(%AsyncContext.Snapshot%, *"%AsyncContext.Snapshot.prototype%"*, « [[AsyncSnapshotMapping]] »).
@@ -967,7 +970,7 @@ <h1>Properties of AsyncContext.Snapshot Instances</h1>
967970
[[AsyncSnapshotMapping]]
968971
</td>
969972
<td>
970-
a List of Async Context Mapping Records
973+
an Async Context Mapping
971974
</td>
972975
<td>
973976
Represents the snapshotted surrounding agent's Agent Record's [[AsyncContextMapping]] of the AsyncContext.Snapshot instance.
@@ -1051,7 +1054,7 @@ <h1>AsyncContext.Variable.prototype.run ( _value_, _func_, ..._args_ )</h1>
10511054
1. Let _asyncVariable_ be the *this* value.
10521055
1. Perform ? RequireInternalSlot(_asyncVariable_, [[AsyncVariableName]]).
10531056
1. Let _previousContextMapping_ be AsyncContextSnapshot().
1054-
1. Let _asyncContextMapping_ be a new empty List.
1057+
1. Let _asyncContextMapping_ be a new empty Async Context Mapping.
10551058
1. For each Async Context Mapping Record _p_ of _previousContextMapping_, do
10561059
1. If SameValueZero(_p_.[[AsyncContextKey]], _asyncVariable_) is *false*, then
10571060
1. Let _q_ be the Async Context Mapping Record { [[AsyncContextKey]]: _p_.[[AsyncContextKey]], [[AsyncContextValue]]: _p_.[[AsyncContextValue]] }.

0 commit comments

Comments
 (0)