summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-09-24 01:39:34 +0300
committerIdan Horowitz <idan.horowitz@gmail.com>2021-09-24 02:28:17 +0300
commit99bc429f3f18743963a484152ff4067f9c610156 (patch)
tree0b8b78670e131ff3f4ea0178c0ea6395c18684d0 /Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
parentee825d6d9e1cb4d106a2fc87d9dafe517915d4de (diff)
downloadserenity-99bc429f3f18743963a484152ff4067f9c610156.zip
LibJS: Add missing exception checks to {Array, TypedArray}.from()
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
index 2e92962e1a..22359d9bd1 100644
--- a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
@@ -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)));