Skip to content

Commit

Permalink
Handle incumbent settings object for promise jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed May 20, 2016
1 parent ed14dc6 commit 2508c60
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -86682,8 +86682,8 @@ interface <dfn>NavigatorOnLine</dfn> {
stack</dfn>, initially empty. Roughly speaking, it is used to determine the <span>incumbent
settings object</span> when no author code is on the stack, but author code is responsible for the
current algorithm having been run in some way. When Web IDL is used to <span
data-x="es-invoking-callback-functions">invoke</span> author code, it manipulates this stack. <ref
spec="WEBIDL"/></p>
data-x="es-invoking-callback-functions">invoke</span> author code, or when <span>EnqueueJob</span>
invokes a promise job, they manipulate this stack. <ref spec="WEBIDL"></p>

<p>The <dfn>incumbent settings object</dfn> is determined as follows:</p>

Expand Down Expand Up @@ -86912,19 +86912,24 @@ interface <dfn>NavigatorOnLine</dfn> {
<ol>
<li><p>Assert: <var>queueName</var> is <code data-x="">"PromiseJobs"</code>. (<code
data-x="">"ScriptJobs"</code> must not be used by user agents.)</p></li>
<li><p>Let <var>settings</var> be the <span data-x="concept-realm-settings-object">settings
<li><p>Let <var>job settings</var> be the <span data-x="concept-realm-settings-object">settings
object</span> of <var>job</var>.[[Realm]].</p></li>
<li><p>Let <var>incumbent settings</var> be the <span>incumbent settings object</span>.</p></li>
<li>
<p><span>Queue a microtask</span>, on <var>settings</var>'s <span>responsible event
<p><span>Queue a microtask</span>, on <var>job settings</var>'s <span>responsible event
loop</span>, to perform the following steps:</p>

<ol>
<li><p><span>Check if we can run script</span> with <var>settings</var>. If this returns "do
not run" then abort these steps.</p></li>
<li><p><span>Prepare to run script</span> with <var>settings</var>.</p></li>
<li><p><span>Check if we can run script</span> with <var>job settings</var>. If this returns
"do not run" then abort these steps.</p></li>
<li><p>Push <var>incumbent settings</var> onto the <span>backup incumbent settings object
stack</span>.</p></li>
<li><p><span>Prepare to run script</span> with <var>job settings</var>.</p></li>
<li><p>Let <var>result</var> be the result of performing the abstract operation specified by
<var>job</var>, using the elements of <var>arguments</var> as its arguments.</p></li>
<li><p><span>Clean up after running script</span> with <var>settings</var>.</p></li>
<li><p><span>Clean up after running script</span> with <var>job settings</var>.</p></li>
<li><p>Pop <var>incumbent settings</var> off of the <span>backup incumbent settings object
stack</span>.</p></li>
<li><p>If <var>result</var> is an abrupt completion, <span>report the exception</span> given by
<var>result</var>.[[Value]].</p></li>
</ol>
Expand Down

0 comments on commit 2508c60

Please sign in to comment.