mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibJS: Convert enumerable_own_property_names() to ThrowCompletionOr
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 03:06:55 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/e5b85447625 Pull-request: https://github.com/SerenityOS/serenity/pull/10327 Reviewed-by: https://github.com/IdanHo ✅
@@ -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()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user