1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:37:46 +00:00

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
parent d89f539d16
commit 28172fde10

View file

@ -101,7 +101,11 @@ static Object* array_species_create(GlobalObject& global_object, Object& origina
{ {
auto& vm = global_object.vm(); 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); auto array = Array::create(global_object, length);
if (vm.exception()) if (vm.exception())
return {}; return {};