LibWeb/IDB: Implement IDBObjectStore::add

This commit is contained in:
stelar7 2025-04-11 11:41:30 +02:00 committed by Andrew Kaster
commit ca1e94f9ea
Notes: github-actions[bot] 2025-04-23 18:36:55 +00:00
3 changed files with 9 additions and 1 deletions

View file

@ -317,4 +317,11 @@ WebIDL::ExceptionOr<GC::Ref<IDBRequest>> IDBObjectStore::add_or_put(GC::Ref<IDBO
return result;
}
// https://w3c.github.io/IndexedDB/#dom-idbobjectstore-add
WebIDL::ExceptionOr<GC::Ref<IDBRequest>> IDBObjectStore::add(JS::Value value, Optional<JS::Value> const& key)
{
// The add(value, key) method steps are to return the result of running add or put with this, value, key and the no-overwrite flag true.
return add_or_put(*this, value, key, true);
}
}