LibWeb: Don't crash when upgrading custom element with a bad constructor

Previously, a crash would occur when attempting to throw an error in
this case because the method used to create the exception tried to get
the current realm from the execution context stack, which is empty. The
realm is now passed explicitly when constructing the error, avoiding
the crash.
This commit is contained in:
Tim Ledbetter 2025-01-12 17:17:21 +00:00 committed by Luke Wilde
commit 619df0bc2c
Notes: github-actions[bot] 2025-01-13 10:56:42 +00:00
3 changed files with 101 additions and 3 deletions

View file

@ -0,0 +1,9 @@
Harness status: OK
Found 4 tests
4 Pass
Pass HTML parser must create a fallback HTMLUnknownElement when a custom element constructor returns a Text node
Pass HTML parser must create a fallback HTMLUnknownElement when a custom element constructor returns non-Element object
Pass HTML parser must create a fallback HTMLUnknownElement when a custom element constructor does not call super()
Pass HTML parser must create a fallback HTMLUnknownElement when a custom element constructor throws an exception