1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-09 10:20:45 +00:00

LibWeb: Implement IDBRequest.onerror

(cherry picked from commit 68d84755f4b745351d3d494759d59ba6719b8ad8)
This commit is contained in:
Jamie Mansfield 2024-06-22 11:34:09 +01:00 committed by Nico Weber
parent 6d268be6fc
commit ef7d593463
3 changed files with 15 additions and 1 deletions

View File

@ -39,4 +39,16 @@ WebIDL::CallbackType* IDBRequest::onsuccess()
return event_handler_attribute(HTML::EventNames::success);
}
// https://w3c.github.io/IndexedDB/#dom-idbrequest-onerror
void IDBRequest::set_onerror(WebIDL::CallbackType* event_handler)
{
set_event_handler_attribute(HTML::EventNames::error, event_handler);
}
// https://w3c.github.io/IndexedDB/#dom-idbrequest-onerror
WebIDL::CallbackType* IDBRequest::onerror()
{
return event_handler_attribute(HTML::EventNames::error);
}
}

View File

@ -20,6 +20,8 @@ public:
void set_onsuccess(WebIDL::CallbackType*);
WebIDL::CallbackType* onsuccess();
void set_onerror(WebIDL::CallbackType*);
WebIDL::CallbackType* onerror();
protected:
explicit IDBRequest(JS::Realm&);

View File

@ -11,7 +11,7 @@ interface IDBRequest : EventTarget {
// Event handlers:
attribute EventHandler onsuccess;
[FIXME] attribute EventHandler onerror;
attribute EventHandler onerror;
};
enum IDBRequestReadyState {