mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 21:12:08 +02:00
LibWeb: Don't set a transaction request's error until after JS finishes
Otherwise, the JS can't access the `result` property anymore.
This commit is contained in:
committed by
Gregory Bertilson
parent
30e21c2790
commit
9ec949980a
Notes:
github-actions[bot]
2026-03-05 23:42:50 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/9ec949980af Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8264
@@ -602,13 +602,6 @@ void abort_a_transaction(GC::Ref<IDBTransaction> transaction, GC::Ptr<WebIDL::DO
|
||||
// 5. Set transaction’s error to error.
|
||||
transaction->set_error(error);
|
||||
|
||||
// FIXME: https://github.com/w3c/IndexedDB/issues/473
|
||||
// x. If transaction is an upgrade transaction:
|
||||
if (transaction->is_upgrade_transaction()) {
|
||||
// 1. Set transaction's associated request's error to a newly created "AbortError" DOMException.
|
||||
transaction->associated_request()->set_error(WebIDL::AbortError::create(transaction->realm(), "Upgrade transaction was aborted"_utf16));
|
||||
}
|
||||
|
||||
// 6. For each request of transaction’s request list,
|
||||
for (auto const& request : transaction->request_list()) {
|
||||
// FIXME: abort the steps to asynchronously execute a request for request,
|
||||
@@ -654,6 +647,10 @@ void abort_a_transaction(GC::Ref<IDBTransaction> transaction, GC::Ptr<WebIDL::DO
|
||||
// 3. Set request’s result to undefined.
|
||||
request->set_result(JS::js_undefined());
|
||||
|
||||
// FIXME: https://github.com/w3c/IndexedDB/issues/473
|
||||
// x. Set transaction's associated request's error to a newly created "AbortError" DOMException.
|
||||
request->set_error(WebIDL::AbortError::create(transaction->realm(), "Upgrade transaction was aborted"_utf16));
|
||||
|
||||
// 4. Set request’s processed flag to false.
|
||||
// FIXME: request->set_processed(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user