mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:27:43 +00:00
LibJS: Remove unnecessary value_or() from get()
Object::get() never returns an empty value anymore, as per the spec, so having a value_or() fallback is no longer needed.
This commit is contained in:
parent
57f7e6e775
commit
9555ca99a0
19 changed files with 56 additions and 56 deletions
|
@ -70,10 +70,10 @@ Value MapConstructor::construct(FunctionObject& new_target)
|
|||
vm.throw_exception<TypeError>(global_object, ErrorType::NotAnObject, String::formatted("Iterator value {}", iterator_value.to_string_without_side_effects()));
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
auto key = iterator_value.as_object().get(0).value_or(js_undefined());
|
||||
auto key = iterator_value.as_object().get(0);
|
||||
if (vm.exception())
|
||||
return IterationDecision::Break;
|
||||
auto value = iterator_value.as_object().get(1).value_or(js_undefined());
|
||||
auto value = iterator_value.as_object().get(1);
|
||||
if (vm.exception())
|
||||
return IterationDecision::Break;
|
||||
(void)vm.call(adder.as_function(), Value(map), key, value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue