1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:08:12 +00:00

LibJS: Convert Object::construct() to NonnullGCPtr

This commit is contained in:
Linus Groh 2022-12-14 19:18:10 +00:00 committed by Tim Flynn
parent 03acbf0beb
commit 6ae79a84df
117 changed files with 216 additions and 216 deletions

View file

@ -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