mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibWeb: Make factory method of HTML::History fallible
This commit is contained in:
parent
3941e64fde
commit
2f4db60c08
Notes:
sideshowbarker
2024-07-17 22:41:14 +09:00
Author: https://github.com/kennethmyhra
Commit: 2f4db60c08
Pull-request: https://github.com/SerenityOS/serenity/pull/17491
Reviewed-by: https://github.com/linusg ✅
3 changed files with 4 additions and 4 deletions
|
@ -2058,7 +2058,7 @@ CSS::StyleSheetList const& Document::style_sheets() const
|
|||
JS::NonnullGCPtr<HTML::History> Document::history()
|
||||
{
|
||||
if (!m_history)
|
||||
m_history = HTML::History::create(realm(), *this);
|
||||
m_history = HTML::History::create(realm(), *this).release_value_but_fixme_should_propagate_errors();
|
||||
return *m_history;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
JS::NonnullGCPtr<History> History::create(JS::Realm& realm, DOM::Document& document)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<History>> History::create(JS::Realm& realm, DOM::Document& document)
|
||||
{
|
||||
return realm.heap().allocate<History>(realm, realm, document).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<History>(realm, realm, document));
|
||||
}
|
||||
|
||||
History::History(JS::Realm& realm, DOM::Document& document)
|
||||
|
|
|
@ -16,7 +16,7 @@ class History final : public Bindings::PlatformObject {
|
|||
WEB_PLATFORM_OBJECT(History, Bindings::PlatformObject);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<History> create(JS::Realm&, DOM::Document&);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<History>> create(JS::Realm&, DOM::Document&);
|
||||
|
||||
virtual ~History() override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue