mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibJS: Replace the boolean argument of Object::set with an enum class
This is more serenity-esque and also makes pointing out missing exception checks during reviews much easier.
This commit is contained in:
parent
4b39e718b3
commit
8d01d43f5e
17 changed files with 73 additions and 66 deletions
|
@ -70,7 +70,7 @@ bool ArgumentsObject::internal_set(PropertyName const& property_name, Value valu
|
|||
// 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, false);
|
||||
auto set_status = 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 +163,7 @@ bool ArgumentsObject::internal_define_own_property(PropertyName const& property_
|
|||
// 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(), false);
|
||||
bool set_status = 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