summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-14 19:18:10 +0000
committerTim Flynn <trflynn89@pm.me>2022-12-15 06:56:37 -0500
commit6ae79a84df4ded7d3580a60fce5d1fa6e1ffd44d (patch)
tree1892be6fec1f014c02524918922abe70691f69ed /Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp
parent03acbf0beba6e7c07124742ab61918f712af7088 (diff)
downloadserenity-6ae79a84df4ded7d3580a60fce5d1fa6e1ffd44d.zip
LibJS: Convert Object::construct() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp
index 4b7840c9ed..96e7b06e7c 100644
--- a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp
@@ -44,7 +44,7 @@ ThrowCompletionOr<Value> ArrayBufferConstructor::call()
}
// 25.1.3.1 ArrayBuffer ( length ), https://tc39.es/ecma262/#sec-arraybuffer-length
-ThrowCompletionOr<Object*> ArrayBufferConstructor::construct(FunctionObject& new_target)
+ThrowCompletionOr<NonnullGCPtr<Object>> ArrayBufferConstructor::construct(FunctionObject& new_target)
{
auto& vm = this->vm();
auto byte_length_or_error = vm.argument(0).to_index(vm);
@@ -57,7 +57,7 @@ ThrowCompletionOr<Object*> ArrayBufferConstructor::construct(FunctionObject& new
}
return error;
}
- return TRY(allocate_array_buffer(vm, new_target, byte_length_or_error.release_value()));
+ return *TRY(allocate_array_buffer(vm, new_target, byte_length_or_error.release_value()));
}
// 25.1.4.1 ArrayBuffer.isView ( arg ), https://tc39.es/ecma262/#sec-arraybuffer.isview