Skip to content

Commit

Permalink
Integrate with Atomics.waitAsync
Browse files Browse the repository at this point in the history
Implements HostResolveCrossAgentJob and HostEnqueueTimeoutJob.
  • Loading branch information
syg committed May 5, 2023
1 parent 9be1432 commit c1dd708
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2953,8 +2953,10 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x-href="https://tc39.es/ecma262/#sec-getfunctionrealm">GetFunctionRealm</dfn> abstract operation</li>
<li>The <dfn data-x-href="https://tc39.es/ecma262/#sec-hasownproperty">HasOwnProperty</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostCallJobCallback" data-x-href="https://tc39.es/ecma262/#sec-hostcalljobcallback">HostCallJobCallback</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostEnqueueCrossAgentJob" data-x-href="https://tc39.es/ecma262/#sec-hostenqueuecrossagentjob">HostEnqueueCrossAgentJob</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostEnqueueFinalizationRegistryCleanupJob" data-x-href="https://tc39.es/ecma262/#sec-host-cleanup-finalization-registry">HostEnqueueFinalizationRegistryCleanupJob</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostEnqueuePromiseJob" data-x-href="https://tc39.es/ecma262/#sec-hostenqueuepromisejob">HostEnqueuePromiseJob</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostEnqueueTimeoutJob" data-x-href="https://tc39.es/ecma262/#sec-hostenqueuetimeoutjob">HostEnqueueTimeoutJob</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostEnsureCanAddPrivateElement" data-x-href="https://tc39.es/ecma262/#sec-hostensurecanaddprivateelement">HostEnsureCanAddPrivateElement</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostEnsureCanCompileStrings" data-x-href="https://tc39.es/ecma262/#sec-hostensurecancompilestrings">HostEnsureCanCompileStrings</dfn> abstract operation</li>
<li>The <dfn data-x="js-HostLoadImportedModule" data-x-href="https://tc39.es/proposal-import-attributes/#sec-HostLoadImportedModule">HostLoadImportedModule</dfn> abstract operation</li>
Expand Down Expand Up @@ -100641,6 +100643,26 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
<li><p>Return <var>result</var>.</p></li>
</ol>

<h6 id="hostenqueuecrossagentjob"><dfn>HostEnqueueCrossAgentJob</dfn>(<var>job</var>, <var>agentSignifier</var>)</h5>

<p>JavaScript contains an <span>implementation-defined</span> <span
data-x="js-HostEnqueueCrossAgentJob">HostEnqueueCrossAgentJob</span>(<var>job</var>,
<var>agentSignifier</var>) abstract operation to perform jobs across agents (e.g., resolve
Promises resulting from <code>Atomics.waitAsync</code>). User agents must use the following
implementation: <ref spec=JAVASCRIPT></p>

<ol>
<li><p>Let <var>agent</var> be the agent whose [[Signifier]] is <var>agentSignifier</var>.</p></li>

<li><p><span>Queue a task</span> on the <span>JavaScript engine task source</span> in
<var>agent</var>'s <span>event loop</span> to perform the following steps:</p>

<ol>
<li><p>Perform <var>job</var>().</p></li>
</ol>
</li>
</ol>

<h6
id="hostenqueuefinalizationregistrycleanupjob"><dfn>HostEnqueueFinalizationRegistryCleanupJob</dfn>(<var>finalizationRegistry</var>)</h6>

Expand Down Expand Up @@ -100766,6 +100788,29 @@ dictionary <dfn dictionary>PromiseRejectionEventInit</dfn> : <span>EventInit</sp
</li>
</ol>

<h6 id="hostenqueuetimeoutjob"><dfn>HostEnqueueTimeoutJob</dfn>(<var>job</var>, <var>milliseconds</var>)</h6>

<p>JavaScript contains an <span>implementation-defined</span> <span
data-x="js-HostEnqueueTimeoutJob">HostEnqueueTimeoutJob</span>(<var>job</var>,
<var>milliseconds</var>) abstract operation to schedule an operation to be performed after a
timeout. HTML schedules these operations using <span>run steps after a tiemout</span>. User agents
must use the following implementation: <ref spec=JAVASCRIPT></p>

<ol>
<li><p>Let <var>global</var> be the <span>current global object</span>.</p></li>

<li><p>Let <var>timeoutStep</var> be an algorithm step which <span data-x="queue a global
task">queues a global task</span> on the <span>JavaScript engine task source</spspan> given
<var>global</var> to perform the following steps:.</p></li>

<ol>
<li><p>Perform <var>job</var>().</p></li>
</ol>

<li><p><span>Run steps after a timeout</span> given <var>global</var>, "<code
data-x="">JavaScript</code>", <var>milliseconds</var>, and <var>timeoutStep</var>.</p></li>
</ol>

<h6 id="hostmakejobcallback"><dfn>HostMakeJobCallback</dfn>(<var>callable</var>)</h6>

<p>JavaScript contains an <span>implementation-defined</span> <span
Expand Down

0 comments on commit c1dd708

Please sign in to comment.