-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This fixes #193, which notes that importScripts() previously sent errors down the "report an exception" path instead of rethrowing them. It also makes a slight change of rethrowing any early errors that are not SyntaxErrors, instead of converting early ReferenceErrors into SyntaxErrors.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85690,8 +85690,8 @@ interface <dfn>NavigatorOnLine</dfn> { | |
<h5>Calling scripts</h5> | ||
|
||
<p>When a user agent is to <dfn>jump to a code entry-point</dfn> for a <span | ||
data-x="concept-script">script</span> <var>s</var>, the user agent must run the | ||
following steps:</p> | ||
data-x="concept-script">script</span> <var>s</var>, given an optional <var>rethrow errors</var> | ||
flag, the user agent must run the following steps:</p> | ||
|
||
<ol> | ||
|
||
|
@@ -85706,15 +85706,35 @@ interface <dfn>NavigatorOnLine</dfn> { | |
<li><p>Let <var>result</var> be <span data-x="js-ParseScript">ParseScript</span>(<var>s</var>'s | ||
code entry-point, <var>s</var>).</p></li> | ||
|
||
<li><p>If <var>result</var> is a List of errors, <span>report the exception</span> given by the | ||
first element in <var>result</var> for the script <var>s</var>, and go to the step labeled | ||
<i>cleanup</i>.</p></li> | ||
<li> | ||
<p>If <var>result</var> is a List of errors, then:</p> | ||
|
||
<ol> | ||
<li><p>If the <var>rethrow errors</var> flag is set and <var>s</var>'s <var>muted errors</var> | ||
flag is not set, rethrow the error given by the first element of <var>result</var>.</p></li> | ||
This comment has been minimized.
Sorry, something went wrong. |
||
<li><p>If the <var>rethrow errors</var> flag is set and <var>s</var>'s <var>muted | ||
errors</var> flag is set, throw a <code>NetworkError</code> exception.</p></li> | ||
This comment has been minimized.
Sorry, something went wrong.
annevk
Member
|
||
<li><p>If the <var>rethrow errors</var> flag is not set, <span>report the exception</span> | ||
given by the first element in <var>result</var> for the script <var>s</var>.</p></li> | ||
<li><p>In all cases, go to the step labeled <i>cleanup</i>.</p></li> | ||
</ol> | ||
</li> | ||
|
||
<li><p>Let <var>status</var> be <span | ||
data-x="js-ScriptEvaluation">ScriptEvaluation</span>(<var>result</var>).</p></li> | ||
|
||
<li><p>If <var>status</var> is an abrupt completion, <span>report the exception</span> given by | ||
<var>result</var>.[[value]] for the script <var>s</var>.</p></li> | ||
<li> | ||
<p>If <var>status</var> is an abrupt completion, then:</p> | ||
|
||
<ol> | ||
<li><p>If the <var>rethrow errors</var> flag is set and <var>s</var>'s <var>muted errors</var> | ||
flag is not set, rethrow the error given by <var>result</var>.[[value]].</p></li> | ||
<li><p>If the <var>rethrow errors</var> flag is set and <var>s</var>'s <var>muted | ||
errors</var> flag is set, throw a <code>NetworkError</code> exception.</p></li> | ||
<li><p>If the <var>rethrow errors</var> flag is not set, <span>report the exception</span> | ||
given <var>result</var>.[[value]] for the script <var>s</var>.</p></li> | ||
</ol> | ||
</li> | ||
|
||
<li><p><i>Cleanup</i>: <span>Clean up after running a callback</span> with | ||
<var>settings</var>.</p></li> | ||
|
@@ -85871,8 +85891,8 @@ interface <dfn>NavigatorOnLine</dfn> { | |
|
||
<p>When the specification says that a <span data-x="concept-script">script</span> is to be <dfn | ||
data-x="create a script">created</dfn>, given some script source, a script source URL, an | ||
<span>environment settings object</span>, and optionally a <var>muted errors</var> flag, the user | ||
agent must run the following steps:</p> | ||
<span>environment settings object</span>, and optionally <var>muted errors</var> and <var>rethrow | ||
errors</var> flag, the user agent must run the following steps:</p> | ||
|
||
<ol> | ||
|
||
|
@@ -85893,7 +85913,7 @@ interface <dfn>NavigatorOnLine</dfn> { | |
errors</span> flag.</p></li> | ||
|
||
<li><p><span data-x="jump to a code entry-point">Jump</span> to <var>script</var>'s <span>code | ||
entry-point</span>.</p></li> | ||
entry-point</span>, passing the <var>rethrow errors</var> flag if it was given.</p></li> | ||
|
||
</ol> | ||
|
||
|
@@ -95413,24 +95433,18 @@ interface <dfn>SharedWorker</dfn> : <span>EventTarget</span> { | |
<li> | ||
|
||
<p><span>Create a script</span> using <var>source</var> as the script source, the | ||
<span>URL</span> from which <var>source</var> was obtained, and <var>settings object</var> as | ||
the <span>environment settings object</span>.</p> | ||
<span>URL</span> from which <var>source</var> was obtained, <var>settings object</var> as | ||
the <span>environment settings object</span>, and passing the <var>rethrow errors</var> | ||
flag.</p> | ||
|
||
<p>If <var>response</var> is <span>CORS-cross-origin</span>, pass the <var>muted errors</var> | ||
flag to the <span>create a script</span> algorithm as well.</p> | ||
|
||
<p>Let the newly created <span data-x="concept-script">script</span> run until it either | ||
returns, fails to parse, fails to catch an exception, or gets prematurely aborted by the | ||
"<span>kill a worker</span>" or "<span>terminate a worker</span>" algorithms defined | ||
<p class="note">The newly created <span data-x="concept-script">script</span> will run until | ||
it either returns, fails to parse, fails to catch an exception, or gets prematurely aborted | ||
by the "<span>kill a worker</span>" or "<span>terminate a worker</span>" algorithms defined | ||
above.</p> | ||
|
||
<p>If <var>response</var> is <span>CORS-cross-origin</span> and either it failed to parse or | ||
an exception was thrown, then throw a <code>NetworkError</code> exception and abort all these | ||
steps.</p> | ||
|
||
<p>If it failed to parse, then throw an ECMAScript <code | ||
data-x="js-SyntaxError">SyntaxError</code> exception and abort all these steps. <ref spec=ECMA262></p> | ||
|
||
<p>If an exception was thrown or if the script was prematurely aborted, then abort all these | ||
steps, letting the exception or aborting continue to be processed by the calling <span | ||
data-x="concept-script">script</span>.</p> | ||
|
Newline after each
<li>
that is not followed by</ol>
?