diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp index cfa0d90eaf..e5671eadef 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp @@ -57,7 +57,7 @@ size_t length_of_array_like(GlobalObject& global_object, Object const& object) } // 7.3.19 CreateListFromArrayLike ( obj [ , elementTypes ] ), https://tc39.es/ecma262/#sec-createlistfromarraylike -MarkedValueList create_list_from_array_like(GlobalObject& global_object, Value value, Function<Result<void, ErrorType>(Value)> check_value) +MarkedValueList create_list_from_array_like(GlobalObject& global_object, Value value, Function<void(Value)> check_value) { auto& vm = global_object.vm(); auto& heap = global_object.heap(); @@ -76,11 +76,9 @@ MarkedValueList create_list_from_array_like(GlobalObject& global_object, Value v if (vm.exception()) return MarkedValueList { heap }; if (check_value) { - auto result = check_value(next); - if (result.is_error()) { - vm.throw_exception<TypeError>(global_object, result.release_error()); + check_value(next); + if (vm.exception()) return MarkedValueList { heap }; - } } list.append(next); } |