mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
LibWeb: Make DOM::Event and all its subclasses GC-allocated
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 07:28:23 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/7c3db526b0 Pull-request: https://github.com/SerenityOS/serenity/pull/14816 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg ✅
@@ -217,12 +217,12 @@ void EnvironmentSettingsObject::notify_about_rejected_promises(Badge<EventLoop>)
|
||||
/* .promise = */ promise_handle,
|
||||
/* .reason = */ promise.result(),
|
||||
};
|
||||
auto promise_rejection_event = PromiseRejectionEvent::create(HTML::EventNames::unhandledrejection, event_init);
|
||||
|
||||
// FIXME: This currently assumes that global is a WindowObject.
|
||||
auto& window = verify_cast<Bindings::WindowObject>(*global.cell());
|
||||
|
||||
bool not_handled = window.impl().dispatch_event(move(promise_rejection_event));
|
||||
auto promise_rejection_event = PromiseRejectionEvent::create(window, HTML::EventNames::unhandledrejection, event_init);
|
||||
|
||||
bool not_handled = window.impl().dispatch_event(*promise_rejection_event);
|
||||
|
||||
// 3. If notHandled is false, then the promise rejection is handled. Otherwise, the promise rejection is not handled.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user