mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibWeb: Make factory method of DOM::DOMImplementation fallible
This commit is contained in:
parent
a5ad8b2959
commit
b9c5828fe6
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/b9c5828fe6 Pull-request: https://github.com/SerenityOS/serenity/pull/17491 Reviewed-by: https://github.com/linusg ✅
|
@ -17,10 +17,10 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
JS::NonnullGCPtr<DOMImplementation> DOMImplementation::create(Document& document)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMImplementation>> DOMImplementation::create(Document& document)
|
||||
{
|
||||
auto& realm = document.realm();
|
||||
return realm.heap().allocate<DOMImplementation>(realm, document).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<DOMImplementation>(realm, document));
|
||||
}
|
||||
|
||||
DOMImplementation::DOMImplementation(Document& document)
|
||||
|
|
|
@ -17,7 +17,7 @@ class DOMImplementation final : public Bindings::PlatformObject {
|
|||
WEB_PLATFORM_OBJECT(DOMImplementation, Bindings::PlatformObject);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<DOMImplementation> create(Document&);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMImplementation>> create(Document&);
|
||||
virtual ~DOMImplementation();
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> create_document(DeprecatedString const&, DeprecatedString const&, JS::GCPtr<DocumentType>) const;
|
||||
|
|
|
@ -1824,7 +1824,7 @@ void Document::evaluate_media_rules()
|
|||
DOMImplementation* Document::implementation()
|
||||
{
|
||||
if (!m_implementation)
|
||||
m_implementation = DOMImplementation::create(*this);
|
||||
m_implementation = DOMImplementation::create(*this).release_value_but_fixme_should_propagate_errors();
|
||||
return m_implementation;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue