LibJS: Add missing exception check to the ArraySpeciesCreate AO

This commit is contained in:
Idan Horowitz 2021-07-06 00:04:47 +03:00 committed by Linus Groh
commit 28172fde10
Notes: sideshowbarker 2024-07-18 10:19:13 +09:00

View file

@ -101,7 +101,11 @@ static Object* array_species_create(GlobalObject& global_object, Object& origina
{
auto& vm = global_object.vm();
if (!Value(&original_array).is_array(global_object)) {
auto is_array = Value(&original_array).is_array(global_object);
if (vm.exception())
return {};
if (!is_array) {
auto array = Array::create(global_object, length);
if (vm.exception())
return {};