mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
LibJS: Convert Array::create{,_from}() to NonnullGCPtr
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 08:42:05 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/91b0123eaf Pull-request: https://github.com/SerenityOS/serenity/pull/16479 Reviewed-by: https://github.com/davidot ✅
@@ -441,7 +441,7 @@ Object* JSONObject::parse_json_object(VM& vm, JsonObject const& json_object)
|
||||
Array* JSONObject::parse_json_array(VM& vm, JsonArray const& json_array)
|
||||
{
|
||||
auto& realm = *vm.current_realm();
|
||||
auto* array = MUST(Array::create(realm, 0));
|
||||
auto array = MUST(Array::create(realm, 0));
|
||||
size_t index = 0;
|
||||
json_array.for_each([&](auto& value) {
|
||||
array->define_direct_property(index++, parse_json_value(vm, value), default_attributes);
|
||||
|
||||
Reference in New Issue
Block a user