LibJS: Add missing exception checks to {Array, TypedArray}.from()

This commit is contained in:
Idan Horowitz 2021-09-24 01:39:34 +03:00
commit 99bc429f3f
Notes: sideshowbarker 2024-07-18 03:30:58 +09:00
2 changed files with 4 additions and 0 deletions

View file

@ -189,6 +189,8 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayConstructor::from)
for (size_t k = 0; k < length; ++k) {
auto k_value = array_like->get(k);
if (vm.exception())
return {};
Value mapped_value;
if (map_fn)
mapped_value = TRY_OR_DISCARD(vm.call(*map_fn, this_arg, k_value, Value(k)));