Skip to content

Commit

Permalink
Invoke the URL serializer for ErrorEvent.filename
Browse files Browse the repository at this point in the history
The URL's hash should be included to match majority of browser
engines (WebKit, Gecko, Edge). An "absolute URL" is without the
hash according to the URL standard, but serializing a URL record
includes it by default.

Fixes #2074.
Closes web-platform-tests/wpt#4221.
  • Loading branch information
zcorpan committed Nov 22, 2016
1 parent 6e305c4 commit 2c8eef6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -88020,8 +88020,9 @@ document.querySelector("button").addEventListener("click", bound);

<li>

<p>Let <var>location</var> be an <span>absolute URL</span> that corresponds to the
resource from which <var>script</var> was obtained.</p>
<p>Let <var>urlString</var> be the result of applying the <span
data-x="concept-url-serializer">URL serializer</span> to the <span>URL record</span> that
corresponds to the resource from which <var>script</var> was obtained.</p>

<p class="note">The resource containing the script will typically be the file from which the
<code>Document</code> was parsed, e.g. for inline <code>script</code> elements or <span>event
Expand All @@ -88043,15 +88044,15 @@ document.querySelector("button").addEventListener("click", bound);
</li>

<li><p>If <var>script</var> has <span>muted errors</span>, then set <var>message</var> to "<code
data-x="">Script error.</code>", <var>location</var> to the empty string, <var>line</var> and
data-x="">Script error.</code>", <var>urlString</var> to the empty string, <var>line</var> and
<var>col</var> to 0, and <var>errorValue</var> to null.</p></li>

<li><p>Let <var>notHandled</var> be the result of <span data-x="concept-event-fire">firing an
event</span> named <code data-x="event-error">error</code> at <var>target</var>, using
<code>ErrorEvent</code>, with the <code data-x="dom-Event-cancelable">cancelable</code> attribute
initialized to true, the <code data-x="dom-ErrorEvent-message">message</code> attribute
initialized to <var>message</var>, the <code data-x="dom-ErrorEvent-filename">filename</code>
attribute initialized to <var>location</var>, the <code
attribute initialized to <var>urlString</var>, the <code
data-x="dom-ErrorEvent-lineno">lineno</code> attribute initialized to <var>line</var>, the <code
data-x="dom-ErrorEvent-colno">colno</code> attribute initialized to <var>col</var>, and the <code
data-x="dom-ErrorEvent-error">error</code> attribute initialized to
Expand Down Expand Up @@ -88108,8 +88109,8 @@ dictionary <dfn>ErrorEventInit</dfn> : <span>EventInit</span> {
value it was initialized to. It represents the error message.</p>

<p>The <dfn><code data-x="dom-ErrorEvent-filename">filename</code></dfn> attribute must return the
value it was initialized to. It represents the <span>absolute URL</span> of the script in which
the error originally occurred.</p>
value it was initialized to. It represents the <span>URL</span> of the script in which the error
originally occurred.</p>

<p>The <dfn><code data-x="dom-ErrorEvent-lineno">lineno</code></dfn> attribute must return the
value it was initialized to. It represents the line number where the error occurred in the
Expand Down

0 comments on commit 2c8eef6

Please sign in to comment.