mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibJS: Convert create_data_property() to ThrowCompletionOr
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 03:07:33 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/fb443b3fb45 Pull-request: https://github.com/SerenityOS/serenity/pull/10327 Reviewed-by: https://github.com/IdanHo ✅
@@ -468,13 +468,10 @@ Value JSONObject::internalize_json_property(GlobalObject& global_object, Object*
|
||||
auto element = internalize_json_property(global_object, &value_object, key, reviver);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
if (element.is_undefined()) {
|
||||
if (element.is_undefined())
|
||||
TRY(value_object.internal_delete(key));
|
||||
} else {
|
||||
value_object.create_data_property(key, element);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
}
|
||||
else
|
||||
TRY(value_object.create_data_property(key, element));
|
||||
return {};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user