diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index f6b3f7e3fc..b96826af74 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -178,7 +178,7 @@ WebIDL::ExceptionOr> Document::create_and_initialize( Bindings::main_thread_vm(), [&](JS::Realm& realm) -> JS::Object* { // - For the global object, create a new Window object. - window = HTML::Window::create(realm); + window = HTML::Window::create(realm).release_value_but_fixme_should_propagate_errors(); return window; }, [&](JS::Realm&) -> JS::Object* { diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index ea35da2fd6..0c7230266a 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -118,7 +118,7 @@ JS::NonnullGCPtr BrowsingContext::create_a_new_browsing_context browsing_context->m_window_proxy = realm.heap().allocate(realm, realm).release_allocated_value_but_fixme_should_propagate_errors(); // - For the global object, create a new Window object. - window = HTML::Window::create(realm); + window = HTML::Window::create(realm).release_value_but_fixme_should_propagate_errors(); return window.ptr(); }, [&](JS::Realm&) -> JS::Object* { diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index f301442023..0300b45285 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -86,9 +86,9 @@ private: u32 m_handle { 0 }; }; -JS::NonnullGCPtr Window::create(JS::Realm& realm) +WebIDL::ExceptionOr> Window::create(JS::Realm& realm) { - return realm.heap().allocate(realm, realm).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm)); } Window::Window(JS::Realm& realm) diff --git a/Userland/Libraries/LibWeb/HTML/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h index 1944ec9fa2..7e2c69a034 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.h +++ b/Userland/Libraries/LibWeb/HTML/Window.h @@ -37,7 +37,7 @@ class Window final WEB_PLATFORM_OBJECT(Window, DOM::EventTarget); public: - static JS::NonnullGCPtr create(JS::Realm&); + static WebIDL::ExceptionOr> create(JS::Realm&); ~Window();