From 8a43f419060f2f0e96e3f692f45cb45266c2291c Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 12 Mar 2020 16:13:04 -0400 Subject: [PATCH 1/2] Add explanations for scripts' different error fields In https://github.com/whatwg/html/pull/5347#pullrequestreview-372839060 I realized that I had forgotten what the difference was between "parse error" and "error to rethrow", despite being the original author of the spec text. This adds notes explaining the function of each of them, and un-exports "parse error" since it should only be used internally. --- source | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/source b/source index 272f5c1bada..0fe0f056b2c 100644 --- a/source +++ b/source @@ -89120,12 +89120,18 @@ interface ApplicationCache : EventTarget { script">module scripts; or null. In the former two cases, it represents a parsed script; null represents a failure parsing.

-
A parse - error
+
A parse error
-

A JavaScript value, which has meaning only if the record is null, indicating that the corresponding script - source text could not be parsed.

+
+

A JavaScript value, which has meaning only if the record is null, indicating that the corresponding script + source text could not be parsed.

+ +

This value is used for internal tracking of immediate parse errors when creating scripts, and should not be used directly. Instead, consult + the error to rethrow when determining + "what went wrong" for this script.

+
An error to rethrow
@@ -89134,6 +89140,11 @@ interface ApplicationCache : EventTarget {

A JavaScript value representing an error that will prevent evaluation from succeeding. It will be re-thrown by any attempts to run the script.

+

This could be the script's parse + error, but in the case of a module script it could instead be the + parse error from one of its dependencies, or + an error from resolve a module specifier.

+

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.

From d8934f2b1b4328fa3164dd175aa4f6d83adf862c Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Thu, 12 Mar 2020 16:19:00 -0400 Subject: [PATCH 2/2] No "should" in notes --- source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source b/source index 0fe0f056b2c..3f73a2aa0c8 100644 --- a/source +++ b/source @@ -89128,7 +89128,7 @@ interface ApplicationCache : EventTarget { source text could not be parsed.

This value is used for internal tracking of immediate parse errors when creating scripts, and should not be used directly. Instead, consult + href="#creating-scripts">creating scripts, and is not to be used directly. Instead, consult the error to rethrow when determining "what went wrong" for this script.