1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:17:35 +00:00

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

This commit is contained in:
Idan Horowitz 2021-09-24 01:39:34 +03:00
parent ee825d6d9e
commit 99bc429f3f
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)));