Skip to content

Commit

Permalink
Change exception thrown in HTMLElement construction steps
Browse files Browse the repository at this point in the history
Chrome, Safari, and Firefox all throw a TypeError and WPT already tests for that.

Fixes #10553.
  • Loading branch information
pwombwell committed Aug 21, 2024
1 parent 5b0f145 commit cf5565c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -12071,8 +12071,7 @@ document.createElement("bad-1"); // (2)</code></pre>

<li>
<p>If <var>element</var> is an <span data-x="concept-already-constructed-marker"><i>already
constructed</i> marker</span>, then throw an <span>"<code>InvalidStateError</code>"</span>
<code>DOMException</code>.</p>
constructed</i> marker</span>, then throw a <code>TypeError</code>.</p>

<div class="example">
<p>This can occur when the author code inside the <span>custom element
Expand All @@ -12090,7 +12089,7 @@ class DontDoThis extends HTMLElement {
// Now the construction stack will contain an <i>already constructed</i> marker.
}

// This will then fail with an "InvalidStateError" DOMException:
// This will then fail with a TypeError:
super();
}
}</code></pre>
Expand Down

0 comments on commit cf5565c

Please sign in to comment.