1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:04:59 +00:00

LibJS: Convert Object::create() to NonnullGCPtr

This commit is contained in:
Linus Groh 2022-12-13 20:49:50 +00:00
parent f990095728
commit ddc6e139a6
45 changed files with 80 additions and 80 deletions

View file

@ -351,9 +351,9 @@ static JS::ThrowCompletionOr<JS::Value> load_ini_impl(JS::VM& vm)
return vm.throw_completion<JS::Error>(DeprecatedString::formatted("Failed to open '{}': {}", filename, file_or_error.error()));
auto config_file = MUST(Core::ConfigFile::open(filename, file_or_error.release_value()));
auto* object = JS::Object::create(realm, realm.intrinsics().object_prototype());
auto object = JS::Object::create(realm, realm.intrinsics().object_prototype());
for (auto const& group : config_file->groups()) {
auto* group_object = JS::Object::create(realm, realm.intrinsics().object_prototype());
auto group_object = JS::Object::create(realm, realm.intrinsics().object_prototype());
for (auto const& key : config_file->keys(group)) {
auto entry = config_file->read_entry(group, key);
group_object->define_direct_property(key, JS::PrimitiveString::create(vm, move(entry)), JS::Attribute::Enumerable | JS::Attribute::Configurable | JS::Attribute::Writable);