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

LibJS: Treat missing arg in Array.prototype.includes() as undefined

This commit is contained in:
Linus Groh 2020-05-21 20:50:53 +01:00 committed by Andreas Kling
parent fbcfc8dcd0
commit 5db9becc4a
2 changed files with 4 additions and 2 deletions

View file

@ -422,8 +422,8 @@ Value ArrayPrototype::includes(Interpreter& interpreter)
if (!array)
return {};
i32 array_size = static_cast<i32>(array->elements().size());
if (interpreter.argument_count() == 0 || array_size == 0)
i32 array_size = array->elements().size();
if (array_size == 0)
return Value(false);
i32 from_index = 0;