mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
LibJS: Convert Object::construct() to NonnullGCPtr
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 07:20:49 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/6ae79a84df Pull-request: https://github.com/SerenityOS/serenity/pull/16498 Reviewed-by: https://github.com/trflynn89 ✅
@@ -208,7 +208,7 @@ ThrowCompletionOr<Value> DateConstructor::call()
|
||||
}
|
||||
|
||||
// 21.4.2.1 Date ( ...values ), https://tc39.es/ecma262/#sec-date
|
||||
ThrowCompletionOr<Object*> DateConstructor::construct(FunctionObject& new_target)
|
||||
ThrowCompletionOr<NonnullGCPtr<Object>> DateConstructor::construct(FunctionObject& new_target)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
|
||||
@@ -299,7 +299,7 @@ ThrowCompletionOr<Object*> DateConstructor::construct(FunctionObject& new_target
|
||||
// 6. Let O be ? OrdinaryCreateFromConstructor(NewTarget, "%Date.prototype%", « [[DateValue]] »).
|
||||
// 7. Set O.[[DateValue]] to dv.
|
||||
// 8. Return O.
|
||||
return TRY(ordinary_create_from_constructor<Date>(vm, new_target, &Intrinsics::date_prototype, date_value)).ptr();
|
||||
return TRY(ordinary_create_from_constructor<Date>(vm, new_target, &Intrinsics::date_prototype, date_value));
|
||||
}
|
||||
|
||||
// 21.4.3.1 Date.now ( ), https://tc39.es/ecma262/#sec-date.now
|
||||
|
||||
Reference in New Issue
Block a user