mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03: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
Notes:
sideshowbarker
2024-07-19 06:14:33 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/daf74838dda Pull-request: https://github.com/SerenityOS/serenity/pull/2337
@ -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…
Reference in New Issue
Block a user