mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 00:47:36 +00:00
LibJS: Convert create_data_property() to ThrowCompletionOr
This commit is contained in:
parent
1d45541278
commit
fb443b3fb4
5 changed files with 14 additions and 27 deletions
|
@ -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 {};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue