summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Text.cpp')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Text.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Text.cpp b/Userland/Libraries/LibWeb/DOM/Text.cpp
index f6399176b1..9fb0967b52 100644
--- a/Userland/Libraries/LibWeb/DOM/Text.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Text.cpp
@@ -37,7 +37,7 @@ JS::NonnullGCPtr<Text> Text::construct_impl(JS::Realm& realm, DeprecatedString c
{
// 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);
+ return realm.heap().allocate<Text>(realm, window.associated_document(), data);
}
void Text::set_owner_input_element(Badge<HTML::HTMLInputElement>, HTML::HTMLInputElement& input_element)
@@ -63,7 +63,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Text>> Text::split_text(size_t offset)
auto new_data = TRY(substring_data(offset, count));
// 5. Let new node be a new Text node, with the same node document as node. Set new node’s data to new data.
- auto new_node = JS::NonnullGCPtr(*heap().allocate<Text>(realm(), document(), new_data));
+ auto new_node = heap().allocate<Text>(realm(), document(), new_data);
// 6. Let parent be node’s parent.
JS::GCPtr<Node> parent = this->parent();