1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibWeb: Make DOMException GC-allocated

This commit is contained in:
Andreas Kling 2022-09-04 16:56:15 +02:00
parent 0e47754ac8
commit 497ead37bc
58 changed files with 307 additions and 278 deletions

View file

@ -228,10 +228,10 @@ ExceptionOr<bool> EventTarget::dispatch_event_binding(Event& event)
{
// 1. If events dispatch flag is set, or if its initialized flag is not set, then throw an "InvalidStateError" DOMException.
if (event.dispatched())
return DOM::InvalidStateError::create("The event is already being dispatched.");
return DOM::InvalidStateError::create(global_object(), "The event is already being dispatched.");
if (!event.initialized())
return DOM::InvalidStateError::create("Cannot dispatch an uninitialized event.");
return DOM::InvalidStateError::create(global_object(), "Cannot dispatch an uninitialized event.");
// 2. Initialize events isTrusted attribute to false.
event.set_is_trusted(false);