Skip to content

Commit

Permalink
Return the completion record result from running a script
Browse files Browse the repository at this point in the history
The Service Worker spec will use this to detect uncaught runtime errors:
w3c/ServiceWorker#1334.
  • Loading branch information
mfalken authored and domenic committed Aug 10, 2018
1 parent 823f4bc commit ad3dda5
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -81974,10 +81974,11 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<var>script source</var>, <var>settings</var>, <var>base URL</var>, and the <span>default
classic script fetch options</span>.</p></li>

<li><p>Let <var>result</var> be the result of <span data-x="run a classic script">running the
classic script</span> <var>script</var>. If evaluation was unsuccessful, let
<var>result</var> be undefined instead. (The result will also be undefined if <span
data-x="concept-bc-noscript">scripting is disabled</span>.)</p></li>
<li><p>Let <var>evaluationStatus</var> be the result of <span data-x="run a classic
script">running the classic script</span> <var>script</var>.</p></li>

<li><p>Let <var>result</var> be undefined if <var>evaluationStatus</var> is an <span>abrupt
completion</span>, or <var>evaluationStatus</var>.[[Value]] otherwise.</p></li>

<li><p>Let <var>response</var> be null.</p></li>

Expand Down Expand Up @@ -87371,7 +87372,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
<li><p>Let <var>settings</var> be the <span>settings object</span> of <var>script</var>.</p></li>

<li><p><span>Check if we can run script</span> with <var>settings</var>. If this returns "do
not run" then return.</p></li>
not run" then return <span>NormalCompletion</span>(undefined).</p></li>

<li><p><span>Prepare to run script</span> given <var>settings</var>.</p></li>

Expand Down Expand Up @@ -87426,7 +87427,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {

<li><p><span>Clean up after running script</span> with <var>settings</var>.</p></li>

<li><p>Return undefined.</p></li>
<li><p>Return <var>evaluationStatus</var>.</p></li>
</ol>
</li>
</ol>
Expand All @@ -87436,15 +87437,17 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {

<li>
<p>If <var>evaluationStatus</var> is a normal completion, return
<var>evaluationStatus</var>.[[Value]].</p>
<var>evaluationStatus</var>.</p>

<p class="note">This value is only ever used by the <span data-x="javascript
protocol"><code>javascript:</code> URL steps</span>.</p>
</li>

<li><p>If we've reached this point, <var>evaluationStatus</var> was left as null because the
script was <span data-x="abort a running script">aborted prematurely</span> during evaluation.
Return undefined.</p></li>
Return Completion { [[Type]]: throw, [[Value]]: a new
<span>"<code>QuotaExceededError</code>"</span> <code>DOMException</code>, [[Target]]: empty }.
</p></li>
</ol>

<p>To <dfn data-export="">run a module script</dfn> given a <span>module script</span>
Expand All @@ -87456,7 +87459,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
<li><p>Let <var>settings</var> be the <span>settings object</span> of <var>script</var>.</p></li>

<li><p><span>Check if we can run script</span> with <var>settings</var>. If this returns "do
not run" then return.</p></li>
not run" then return <span>NormalCompletion</span>(undefined).</p></li>

<li><p><span>Prepare to run script</span> given <var>settings</var>.</p></li>

Expand Down Expand Up @@ -87485,7 +87488,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
<var>evaluationStatus</var> to Completion { [[Type]]: throw, [[Value]]: a new
<span>"<code>QuotaExceededError</code>"</span> <code>DOMException</code>, [[Target]]: empty
}.</p>
</li>
</li>
</ol>
</li>

Expand All @@ -87502,6 +87505,8 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
</li>

<li><p><span>Clean up after running script</span> with <var>settings</var>.</p></li>

<li><p>Return <var>evaluationStatus</var>.</p></li>
</ol>

<p>The steps to <dfn>check if we can run script</dfn> with an <span>environment settings
Expand Down

0 comments on commit ad3dda5

Please sign in to comment.