mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:47:44 +00:00
LibWeb: Add FormDataIterator implementation
This adds the FormDataIterator implementation so we can iterate over FormData.{keys(),values(),entries()}.
This commit is contained in:
parent
680e970597
commit
be52e7171a
8 changed files with 133 additions and 2 deletions
|
@ -171,4 +171,14 @@ WebIDL::ExceptionOr<void> FormData::set_impl(String const& name, Variant<JS::Non
|
|||
return {};
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> FormData::for_each(ForEachCallback callback)
|
||||
{
|
||||
for (auto i = 0u; i < m_entry_list.size(); ++i) {
|
||||
auto& entry = m_entry_list[i];
|
||||
TRY(callback(entry.name, entry.value));
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue