1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:38:12 +00:00

LibJS: Use MUST() where applicable

This commit is contained in:
Linus Groh 2021-10-03 15:57:26 +01:00
parent 7cd3f7de61
commit 4d5bd092ea
14 changed files with 58 additions and 56 deletions

View file

@ -95,7 +95,7 @@ ThrowCompletionOr<bool> ArgumentsObject::internal_delete(PropertyName const& pro
// 4. If result is true and isMapped is true, then
if (result && is_mapped) {
// a. Call map.[[Delete]](P).
(void)map.internal_delete(property_name);
MUST(map.internal_delete(property_name));
}
// 5. Return result.
@ -106,7 +106,8 @@ ThrowCompletionOr<bool> ArgumentsObject::internal_delete(PropertyName const& pro
ThrowCompletionOr<Optional<PropertyDescriptor>> ArgumentsObject::internal_get_own_property(PropertyName const& property_name) const
{
// 1. Let desc be OrdinaryGetOwnProperty(args, P).
auto desc = Object::internal_get_own_property(property_name).release_value();
auto desc = MUST(Object::internal_get_own_property(property_name));
// 2. If desc is undefined, return desc.
if (!desc.has_value())
return desc;
@ -157,7 +158,7 @@ ThrowCompletionOr<bool> ArgumentsObject::internal_define_own_property(PropertyNa
// a. If IsAccessorDescriptor(Desc) is true, then
if (descriptor.is_accessor_descriptor()) {
// i. Call map.[[Delete]](P).
(void)map.internal_delete(property_name);
MUST(map.internal_delete(property_name));
} else {
// i. If Desc.[[Value]] is present, then
if (descriptor.value.has_value()) {
@ -169,7 +170,7 @@ ThrowCompletionOr<bool> ArgumentsObject::internal_define_own_property(PropertyNa
// ii. If Desc.[[Writable]] is present and its value is false, then
if (descriptor.writable == false) {
// 1. Call map.[[Delete]](P).
(void)map.internal_delete(property_name);
MUST(map.internal_delete(property_name));
}
}
}