mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb/IDB: Implement IDBObjectStore::put
This commit is contained in:
parent
94183f1fc2
commit
133e0e0187
3 changed files with 9 additions and 1 deletions
|
@ -324,4 +324,11 @@ WebIDL::ExceptionOr<GC::Ref<IDBRequest>> IDBObjectStore::add(JS::Value value, Op
|
|||
return add_or_put(*this, value, key, true);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#dom-idbobjectstore-put
|
||||
WebIDL::ExceptionOr<GC::Ref<IDBRequest>> IDBObjectStore::put(JS::Value value, Optional<JS::Value> const& key)
|
||||
{
|
||||
// The put(value, key) method steps are to return the result of running add or put with this, value, key and the no-overwrite flag false.
|
||||
return add_or_put(*this, value, key, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public:
|
|||
|
||||
[[nodiscard]] WebIDL::ExceptionOr<GC::Ref<IDBRequest>> add_or_put(GC::Ref<IDBObjectStore>, JS::Value, Optional<JS::Value> const&, bool);
|
||||
[[nodiscard]] WebIDL::ExceptionOr<GC::Ref<IDBRequest>> add(JS::Value value, Optional<JS::Value> const& key);
|
||||
[[nodiscard]] WebIDL::ExceptionOr<GC::Ref<IDBRequest>> put(JS::Value value, Optional<JS::Value> const& key);
|
||||
|
||||
protected:
|
||||
explicit IDBObjectStore(JS::Realm&, GC::Ref<ObjectStore>, GC::Ref<IDBTransaction>);
|
||||
|
|
|
@ -10,7 +10,7 @@ interface IDBObjectStore {
|
|||
[SameObject] readonly attribute IDBTransaction transaction;
|
||||
readonly attribute boolean autoIncrement;
|
||||
|
||||
[FIXME, NewObject] IDBRequest put(any value, optional any key);
|
||||
[NewObject] IDBRequest put(any value, optional any key);
|
||||
[NewObject] IDBRequest add(any value, optional any key);
|
||||
[FIXME, NewObject] IDBRequest delete(any query);
|
||||
[FIXME, NewObject] IDBRequest clear();
|
||||
|
|
Loading…
Add table
Reference in a new issue