mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
LibWeb/IDB: Implement IDBObjectStore::indexNames
This commit is contained in:
parent
3367352991
commit
fba7ad6969
Notes:
github-actions[bot]
2025-04-09 17:50:38 +00:00
Author: https://github.com/stelar7
Commit: fba7ad6969
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4178
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
3 changed files with 14 additions and 1 deletions
|
@ -153,4 +153,16 @@ WebIDL::ExceptionOr<GC::Ref<IDBIndex>> IDBObjectStore::create_index(String const
|
|||
return IDBIndex::create(realm, index, *this);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#dom-idbobjectstore-indexnames
|
||||
GC::Ref<HTML::DOMStringList> IDBObjectStore::index_names()
|
||||
{
|
||||
// 1. Let names be a list of the names of the indexes in this's index set.
|
||||
Vector<String> names;
|
||||
for (auto const& [name, index] : m_indexes)
|
||||
names.append(name);
|
||||
|
||||
// 2. Return the result (a DOMStringList) of creating a sorted name list with names.
|
||||
return create_a_sorted_name_list(realm(), names);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue