Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explanations for scripts' different error fields #5351

Merged
merged 2 commits into from
Mar 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -89120,12 +89120,18 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
script">module scripts</span>; or null. In the former two cases, it represents a parsed script;
null represents a failure parsing.</p></dd>

<dt>A <dfn data-dfn-for="script" data-export="" data-x="concept-script-parse-error">parse
error</dfn></dt>
<dt>A <dfn data-dfn-for="script" data-x="concept-script-parse-error">parse error</dfn></dt>

<dd><p>A JavaScript value, which has meaning only if the <span
data-x="concept-script-record">record</span> is null, indicating that the corresponding script
source text could not be parsed.</p></dd>
<dd>
<p>A JavaScript value, which has meaning only if the <span
data-x="concept-script-record">record</span> is null, indicating that the corresponding script
source text could not be parsed.</p>

<p class="note">This value is used for internal tracking of immediate parse errors when <a
href="#creating-scripts">creating scripts</a>, and is not to be used directly. Instead, consult
the <span data-x="concept-script-error-to-rethrow">error to rethrow</span> when determining
"what went wrong" for this script.</p>
</dd>

<dt>An <dfn data-dfn-for="script" data-export="" data-x="concept-script-error-to-rethrow">error
to rethrow</dfn></dt>
Expand All @@ -89134,6 +89140,11 @@ interface <dfn>ApplicationCache</dfn> : <span>EventTarget</span> {
<p>A JavaScript value representing an error that will prevent evaluation from succeeding. It
will be re-thrown by any attempts to <a href="#calling-scripts">run</a> the script.</p>

<p class="note">This could be the script's <span data-x="concept-script-parse-error">parse
error</span>, but in the case of a <span>module script</span> it could instead be the
<span data-x="concept-script-parse-error">parse error</span> from one of its dependencies, or
an error from <span>resolve a module specifier</span>.</p>

<p class="note">Since this exception value is provided by the JavaScript specification, we know
that it is never null, so we use null to signal that no error has occurred.</p>
</dd>
Expand Down