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

LibJS: Convert IterableToList AO to ThrowCompletionOr

This commit is contained in:
Timothy Flynn 2021-10-20 13:41:27 -04:00 committed by Linus Groh
parent ec54a7b5b0
commit 03b251a704
5 changed files with 8 additions and 14 deletions

View file

@ -51,9 +51,7 @@ Value AggregateErrorConstructor::construct(FunctionObject& new_target)
TRY_OR_DISCARD(aggregate_error->install_error_cause(vm.argument(2)));
auto errors_list = iterable_to_list(global_object, vm.argument(0));
if (vm.exception())
return {};
auto errors_list = TRY_OR_DISCARD(iterable_to_list(global_object, vm.argument(0)));
MUST(aggregate_error->define_property_or_throw(vm.names.errors, { .value = Array::create_from(global_object, errors_list), .writable = true, .enumerable = false, .configurable = true }));