mirror of
https://github.com/RGBCube/serenity
synced 2025-07-08 23:07:35 +00:00
LibJS: Convert Object::get() to ThrowCompletionOr
To no one's surprise, this patch is pretty big - this is possibly the most used AO of all of them. Definitely worth it though.
This commit is contained in:
parent
9b6c09e2c4
commit
b7e5f08e56
61 changed files with 326 additions and 686 deletions
|
@ -189,9 +189,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::from)
|
|||
auto& array_object = array.as_object();
|
||||
|
||||
for (size_t k = 0; k < length; ++k) {
|
||||
auto k_value = array_like->get(k);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto k_value = TRY_OR_DISCARD(array_like->get(k));
|
||||
Value mapped_value;
|
||||
if (map_fn)
|
||||
mapped_value = TRY_OR_DISCARD(vm.call(*map_fn, this_arg, k_value, Value(k)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue