mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-30 22:28:22 +00:00
LibWeb/IDB: Dont include databases with version 0 in databases()
This commit is contained in:
parent
8ac096c0e2
commit
d28a4434d0
Notes:
github-actions[bot]
2025-04-25 11:24:39 +00:00
Author: https://github.com/stelar7
Commit: d28a4434d0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4464
1 changed files with 9 additions and 3 deletions
|
@ -211,11 +211,17 @@ GC::Ref<WebIDL::Promise> IDBFactory::databases()
|
|||
for (u32 i = 0; i < databases.size(); ++i) {
|
||||
auto& db = databases[i];
|
||||
|
||||
// 1. Let info be a new IDBDatabaseInfo dictionary.
|
||||
// 2. Set info’s name dictionary member to db’s name.
|
||||
// 3. Set info’s version dictionary member to db’s version.
|
||||
// 1. If db’s version is 0, then continue.
|
||||
if (db->version() == 0)
|
||||
continue;
|
||||
|
||||
// 2. Let info be a new IDBDatabaseInfo dictionary.
|
||||
auto info = JS::Object::create(realm, realm.intrinsics().object_prototype());
|
||||
|
||||
// 3. Set info’s name dictionary member to db’s name.
|
||||
MUST(info->create_data_property("name"_fly_string, JS::PrimitiveString::create(realm.vm(), db->name())));
|
||||
|
||||
// 4. Set info’s version dictionary member to db’s version.
|
||||
MUST(info->create_data_property("version"_fly_string, JS::Value(db->version())));
|
||||
|
||||
// 4. Append info to result.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue