mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibJS: Convert Object::set() to ThrowCompletionOr
This commit is contained in:
parent
b7e5f08e56
commit
1d45541278
18 changed files with 89 additions and 188 deletions
|
@ -71,7 +71,8 @@ ThrowCompletionOr<bool> ArgumentsObject::internal_set(PropertyName const& proper
|
|||
// 3. If isMapped is true, then
|
||||
if (is_mapped) {
|
||||
// a. Let setStatus be Set(map, P, V, false).
|
||||
auto set_status = m_parameter_map->set(property_name, value, Object::ShouldThrowExceptions::No);
|
||||
auto set_status = MUST(m_parameter_map->set(property_name, value, Object::ShouldThrowExceptions::No));
|
||||
|
||||
// b. Assert: setStatus is true because formal parameters mapped by argument objects are always writable.
|
||||
VERIFY(set_status);
|
||||
}
|
||||
|
@ -163,7 +164,8 @@ ThrowCompletionOr<bool> ArgumentsObject::internal_define_own_property(PropertyNa
|
|||
// i. If Desc.[[Value]] is present, then
|
||||
if (descriptor.value.has_value()) {
|
||||
// 1. Let setStatus be Set(map, P, Desc.[[Value]], false).
|
||||
bool set_status = map.set(property_name, descriptor.value.value(), Object::ShouldThrowExceptions::No);
|
||||
bool set_status = MUST(map.set(property_name, descriptor.value.value(), Object::ShouldThrowExceptions::No));
|
||||
|
||||
// 2. Assert: setStatus is true because formal parameters mapped by argument objects are always writable.
|
||||
VERIFY(set_status);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue