From cf5565cb9ae2dd6ad07bf9a0496699afe7c6f0c5 Mon Sep 17 00:00:00 2001 From: Piers Wombwell Date: Wed, 21 Aug 2024 14:31:00 +0100 Subject: [PATCH] Change exception thrown in HTMLElement construction steps Chrome, Safari, and Firefox all throw a TypeError and WPT already tests for that. Fixes #10553. --- source | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source b/source index 9f2a547c10d..b099f0d6889 100644 --- a/source +++ b/source @@ -12071,8 +12071,7 @@ document.createElement("bad-1"); // (2)
  • If element is an already - constructed marker, then throw an "InvalidStateError" - DOMException.

    + constructed marker, then throw a TypeError.

    This can occur when the author code inside the custom element @@ -12090,7 +12089,7 @@ class DontDoThis extends HTMLElement { // Now the construction stack will contain an already constructed marker. } - // This will then fail with an "InvalidStateError" DOMException: + // This will then fail with a TypeError: super(); } }