mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibJS: Convert create_data_property_or_throw() to ThrowCompletionOr
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 03:07:25 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/364dd42fc8c Pull-request: https://github.com/SerenityOS/serenity/pull/10327 Reviewed-by: https://github.com/IdanHo ✅
@@ -111,7 +111,7 @@ String JSONObject::stringify_impl(GlobalObject& global_object, Value value, Valu
|
||||
}
|
||||
|
||||
auto* wrapper = Object::create(global_object, global_object.object_prototype());
|
||||
wrapper->create_data_property_or_throw(String::empty(), value);
|
||||
MUST(wrapper->create_data_property_or_throw(String::empty(), value));
|
||||
auto result = serialize_json_property(global_object, state, String::empty(), wrapper);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
@@ -408,7 +408,7 @@ JS_DEFINE_NATIVE_FUNCTION(JSONObject::parse)
|
||||
if (reviver.is_function()) {
|
||||
auto* root = Object::create(global_object, global_object.object_prototype());
|
||||
auto root_name = String::empty();
|
||||
root->create_data_property_or_throw(root_name, unfiltered);
|
||||
MUST(root->create_data_property_or_throw(root_name, unfiltered));
|
||||
auto result = internalize_json_property(global_object, root, root_name, reviver.as_function());
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user