mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:38:13 +00:00
LibJS: Add missing exception check to ArrayPrototype's for_each_item()
Object::get_by_index() cannot throw for positive indices *right now*, but once we implement descriptors for array index properties, it can.
This commit is contained in:
parent
843e000f18
commit
daf74838dd
1 changed files with 2 additions and 0 deletions
|
@ -111,6 +111,8 @@ static void for_each_item(Interpreter& interpreter, const String& name, AK::Func
|
|||
|
||||
for (size_t i = 0; i < initial_length; ++i) {
|
||||
auto value = this_object->get_by_index(i);
|
||||
if (interpreter.exception())
|
||||
return;
|
||||
if (value.is_empty()) {
|
||||
if (skip_empty)
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue