script: correctly handle indexeddb backend errors (#38740)

Sets the indexeddb request error when the backend errors out. This also
matches statements to the spec.

Testing: Covered by WPT
Fixes: General indexeddb

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Ashwin Naren 2025-08-28 00:49:17 -07:00 committed by GitHub
parent 57f25d0a8a
commit 91b27d98a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 49 additions and 24 deletions

View file

@ -220,7 +220,7 @@ impl IDBOpenDBRequest {
self.idbrequest.set_result(result);
}
pub fn set_error(&self, error: Error, can_gc: CanGc) {
pub fn set_error(&self, error: Option<Error>, can_gc: CanGc) {
self.idbrequest.set_error(error, can_gc);
}
@ -270,7 +270,7 @@ impl IDBOpenDBRequest {
},
Err(dom_exception) => {
request.set_result(HandleValue::undefined());
request.set_error(dom_exception, CanGc::note());
request.set_error(Some(dom_exception), CanGc::note());
let event = Event::new(
&global,
Atom::from("error"),