mirror of
https://github.com/RGBCube/serenity
synced 2025-06-28 16:42:12 +00:00
LibJS: Convert enumerable_own_property_names() to ThrowCompletionOr
This commit is contained in:
parent
3af559ee8a
commit
e5b8544762
6 changed files with 14 additions and 37 deletions
|
@ -238,9 +238,7 @@ String JSONObject::serialize_json_object(GlobalObject& global_object, StringifyS
|
|||
return {};
|
||||
}
|
||||
} else {
|
||||
auto property_list = object.enumerable_own_property_names(PropertyKind::Key);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto property_list = TRY_OR_DISCARD(object.enumerable_own_property_names(PropertyKind::Key));
|
||||
for (auto& property : property_list) {
|
||||
process_property(property.as_string().string());
|
||||
if (vm.exception())
|
||||
|
@ -480,9 +478,7 @@ Value JSONObject::internalize_json_property(GlobalObject& global_object, Object*
|
|||
for (size_t i = 0; i < length; ++i)
|
||||
TRY_OR_DISCARD(process_property(i));
|
||||
} else {
|
||||
auto property_list = value_object.enumerable_own_property_names(Object::PropertyKind::Key);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto property_list = TRY_OR_DISCARD(value_object.enumerable_own_property_names(Object::PropertyKind::Key));
|
||||
for (auto& property_name : property_list)
|
||||
TRY_OR_DISCARD(process_property(property_name.as_string().string()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue