summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-13 20:49:50 +0000
committerLinus Groh <mail@linusgroh.de>2022-12-14 09:59:45 +0000
commit0eeb3164fab2e7580b805aa3fe162d84b5782d88 (patch)
treef349886df651b75156d5ef28fa8932e4add8c1a5 /Userland/Libraries
parentefbd8ee07226a70aab348bdfcfa6d1bbb5e3ab5c (diff)
downloadserenity-0eeb3164fab2e7580b805aa3fe162d84b5782d88.zip
LibJS: Convert DataView::create() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Runtime/DataView.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/DataView.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/DataView.cpp b/Userland/Libraries/LibJS/Runtime/DataView.cpp
index 1068ae6fe2..050a863e91 100644
--- a/Userland/Libraries/LibJS/Runtime/DataView.cpp
+++ b/Userland/Libraries/LibJS/Runtime/DataView.cpp
@@ -8,9 +8,9 @@
namespace JS {
-DataView* DataView::create(Realm& realm, ArrayBuffer* viewed_buffer, size_t byte_length, size_t byte_offset)
+NonnullGCPtr<DataView> DataView::create(Realm& realm, ArrayBuffer* viewed_buffer, size_t byte_length, size_t byte_offset)
{
- return realm.heap().allocate<DataView>(realm, viewed_buffer, byte_length, byte_offset, *realm.intrinsics().data_view_prototype());
+ return *realm.heap().allocate<DataView>(realm, viewed_buffer, byte_length, byte_offset, *realm.intrinsics().data_view_prototype());
}
DataView::DataView(ArrayBuffer* viewed_buffer, size_t byte_length, size_t byte_offset, Object& prototype)
diff --git a/Userland/Libraries/LibJS/Runtime/DataView.h b/Userland/Libraries/LibJS/Runtime/DataView.h
index a3c866023c..8955c03d6e 100644
--- a/Userland/Libraries/LibJS/Runtime/DataView.h
+++ b/Userland/Libraries/LibJS/Runtime/DataView.h
@@ -16,7 +16,7 @@ class DataView : public Object {
JS_OBJECT(DataView, Object);
public:
- static DataView* create(Realm&, ArrayBuffer*, size_t byte_length, size_t byte_offset);
+ static NonnullGCPtr<DataView> create(Realm&, ArrayBuffer*, size_t byte_length, size_t byte_offset);
virtual ~DataView() override = default;