Skip to content

Commit ad3dda5

Browse files
mfalkendomenic
authored andcommitted
Return the completion record result from running a script
The Service Worker spec will use this to detect uncaught runtime errors: w3c/ServiceWorker#1334.
1 parent 823f4bc commit ad3dda5

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

source

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81974,10 +81974,11 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
8197481974
<var>script source</var>, <var>settings</var>, <var>base URL</var>, and the <span>default
8197581975
classic script fetch options</span>.</p></li>
8197681976

81977-
<li><p>Let <var>result</var> be the result of <span data-x="run a classic script">running the
81978-
classic script</span> <var>script</var>. If evaluation was unsuccessful, let
81979-
<var>result</var> be undefined instead. (The result will also be undefined if <span
81980-
data-x="concept-bc-noscript">scripting is disabled</span>.)</p></li>
81977+
<li><p>Let <var>evaluationStatus</var> be the result of <span data-x="run a classic
81978+
script">running the classic script</span> <var>script</var>.</p></li>
81979+
81980+
<li><p>Let <var>result</var> be undefined if <var>evaluationStatus</var> is an <span>abrupt
81981+
completion</span>, or <var>evaluationStatus</var>.[[Value]] otherwise.</p></li>
8198181982

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

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

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

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

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

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

87429-
<li><p>Return undefined.</p></li>
87430+
<li><p>Return <var>evaluationStatus</var>.</p></li>
8743087431
</ol>
8743187432
</li>
8743287433
</ol>
@@ -87436,15 +87437,17 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
8743687437

8743787438
<li>
8743887439
<p>If <var>evaluationStatus</var> is a normal completion, return
87439-
<var>evaluationStatus</var>.[[Value]].</p>
87440+
<var>evaluationStatus</var>.</p>
8744087441

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

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

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

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

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

@@ -87485,7 +87488,7 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
8748587488
<var>evaluationStatus</var> to Completion { [[Type]]: throw, [[Value]]: a new
8748687489
<span>"<code>QuotaExceededError</code>"</span> <code>DOMException</code>, [[Target]]: empty
8748787490
}.</p>
87488-
</li>
87491+
</li>
8748987492
</ol>
8749087493
</li>
8749187494

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

8750487507
<li><p><span>Clean up after running script</span> with <var>settings</var>.</p></li>
87508+
87509+
<li><p>Return <var>evaluationStatus</var>.</p></li>
8750587510
</ol>
8750687511

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

0 commit comments

Comments
 (0)