mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
LibJS: Convert Object::create() to NonnullGCPtr
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 03:17:23 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/ddc6e139a6 Pull-request: https://github.com/SerenityOS/serenity/pull/16479 Reviewed-by: https://github.com/davidot ✅
@@ -257,7 +257,7 @@ ThrowCompletionOr<Array*> format_relative_time_to_parts(VM& vm, RelativeTimeForm
|
||||
// 4. For each Record { [[Type]], [[Value]], [[Unit]] } part in parts, do
|
||||
for (auto& part : parts) {
|
||||
// a. Let O be OrdinaryObjectCreate(%Object.prototype%).
|
||||
auto* object = Object::create(realm, realm.intrinsics().object_prototype());
|
||||
auto object = Object::create(realm, realm.intrinsics().object_prototype());
|
||||
|
||||
// b. Perform ! CreateDataPropertyOrThrow(O, "type", part.[[Type]]).
|
||||
MUST(object->create_data_property_or_throw(vm.names.type, PrimitiveString::create(vm, part.type)));
|
||||
|
||||
Reference in New Issue
Block a user