mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Make factory method of DOM::Text fallible
This commit is contained in:
parent
2411dadc35
commit
200d22c650
Notes:
sideshowbarker
2024-07-17 00:11:51 +09:00
Author: https://github.com/kennethmyhra
Commit: 200d22c650
Pull-request: https://github.com/SerenityOS/serenity/pull/17491
Reviewed-by: https://github.com/linusg ✅
2 changed files with 3 additions and 3 deletions
|
@ -39,11 +39,11 @@ void Text::visit_edges(Cell::Visitor& visitor)
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-text-text
|
||||
JS::NonnullGCPtr<Text> Text::construct_impl(JS::Realm& realm, DeprecatedString const& data)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Text>> Text::construct_impl(JS::Realm& realm, DeprecatedString const& data)
|
||||
{
|
||||
// The new Text(data) constructor steps are to set this’s data to data and this’s node document to current global object’s associated Document.
|
||||
auto& window = verify_cast<HTML::Window>(HTML::current_global_object());
|
||||
return realm.heap().allocate<Text>(realm, window.associated_document(), data).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<Text>(realm, window.associated_document(), data));
|
||||
}
|
||||
|
||||
void Text::set_owner_input_element(Badge<HTML::HTMLInputElement>, HTML::HTMLInputElement& input_element)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue