Bindings: Implement is_supported_property_index in terms of item_value

Greatly simplifying the code :^)
This commit is contained in:
Shannon Booth 2024-07-25 18:30:29 +12:00 committed by Andreas Kling
commit 9b1af542e7
Notes: github-actions[bot] 2024-07-26 12:27:15 +00:00
34 changed files with 4 additions and 138 deletions

View file

@ -45,17 +45,6 @@ void FileList::initialize(JS::Realm& realm)
WEB_SET_PROTOTYPE_FOR_INTERFACE(FileList);
}
// https://w3c.github.io/FileAPI/#dfn-item
bool FileList::is_supported_property_index(u32 index) const
{
// Supported property indices are the numbers in the range zero to one less than the number of File objects represented by the FileList object.
// If there are no such File objects, then there are no supported property indices.
if (m_files.is_empty())
return false;
return index < m_files.size();
}
Optional<JS::Value> FileList::item_value(size_t index) const
{
if (index >= m_files.size())