mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
LibWeb: Make factory method of DOM::Text fallible
This commit is contained in:
parent
2411dadc35
commit
200d22c650
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