Skip to content

Commit ec5b355

Browse files
authored
Add notes on HostPromiseRejectionTracker (tc39#62)
1 parent bab2505 commit ec5b355

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

spec.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,43 @@ <h1>
298298
<emu-clause id="sec-control-abstraction-objects">
299299
<h1>Control Abstraction Objects</h1>
300300

301+
<emu-clause id="sec-promise-objects">
302+
<h1>Promise Objects</h1>
303+
304+
<emu-clause id="sec-promise-abstract-operations">
305+
<h1>Promise Abstract Operations</h1>
306+
307+
<emu-clause id="sec-host-promise-rejection-tracker" type="host-defined abstract operation">
308+
<h1>
309+
HostPromiseRejectionTracker (
310+
_promise_: a Promise,
311+
_operation_: *"reject"* or *"handle"*,
312+
): ~unused~
313+
</h1>
314+
<dl class="header">
315+
<dt>description</dt>
316+
<dd>It allows host environments to track promise rejections.</dd>
317+
</dl>
318+
<p>An implementation of HostPromiseRejectionTracker must conform to the following requirements:</p>
319+
<ul>
320+
<li>It must complete normally (i.e. not return an abrupt completion).</li>
321+
</ul>
322+
<p>The default implementation of HostPromiseRejectionTracker is to return ~unused~.</p>
323+
324+
<ins class="block">
325+
<emu-note>
326+
<p>An implementation of HostPromiseRejectionTracker that delays notifying developers of unhandled rejections must conform to the following requirements</p>
327+
<ul>
328+
<li>It must perform AsyncContextSnapshot() at the call of HostPromiseRejectionTracker,</li>
329+
<li>It must perform AsyncContextSwap before the event notification, with the result of the AsyncContextSnapshot operation,</li>
330+
<li>It must perform AsyncContextSwap after the event notification, with the result of the earlier AsyncContextSwap operation.</li>
331+
</ul>
332+
</emu-note>
333+
</ins>
334+
</emu-clause>
335+
</emu-clause>
336+
</emu-clause>
337+
301338
<emu-clause id="sec-generator-objects">
302339
<h1>Generator Objects</h1>
303340

0 commit comments

Comments
 (0)