mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
LibJS: Convert Object::construct() to NonnullGCPtr
This commit is contained in:
parent
03acbf0beb
commit
6ae79a84df
117 changed files with 216 additions and 216 deletions
|
@ -64,17 +64,17 @@ ThrowCompletionOr<Value> ObjectConstructor::call()
|
|||
}
|
||||
|
||||
// 20.1.1.1 Object ( [ value ] ), https://tc39.es/ecma262/#sec-object-value
|
||||
ThrowCompletionOr<Object*> ObjectConstructor::construct(FunctionObject& new_target)
|
||||
ThrowCompletionOr<NonnullGCPtr<Object>> ObjectConstructor::construct(FunctionObject& new_target)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
auto& realm = *vm.current_realm();
|
||||
|
||||
if (&new_target != this)
|
||||
return TRY(ordinary_create_from_constructor<Object>(vm, new_target, &Intrinsics::object_prototype, ConstructWithPrototypeTag::Tag)).ptr();
|
||||
return TRY(ordinary_create_from_constructor<Object>(vm, new_target, &Intrinsics::object_prototype, ConstructWithPrototypeTag::Tag));
|
||||
auto value = vm.argument(0);
|
||||
if (value.is_nullish())
|
||||
return Object::create(realm, realm.intrinsics().object_prototype()).ptr();
|
||||
return value.to_object(vm);
|
||||
return Object::create(realm, realm.intrinsics().object_prototype());
|
||||
return *TRY(value.to_object(vm));
|
||||
}
|
||||
|
||||
enum class GetOwnPropertyKeysType {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue