Make transaction field non-null in IDBObjectStore (#38834)

In the `IDBObjectStore::new` constructor, the `transaction` field is
initialized to null, but when using this constructor, we always execute
`set_transaction` immediately afterward. Therefore, we refactored to
require the `transaction` field to be specified during construction and
thereby also removed some no longer necessary assertions.

We also updated the `transaction` field in WebIDL to remove the nullable
capability.

Testing: WPT
Fixes: #38814

---------

Signed-off-by: criskell <96352451+criskell@users.noreply.github.com>
This commit is contained in:
criskell 2025-08-22 02:10:13 -03:00 committed by GitHub
parent ede9db2e18
commit 56ce19511c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 17 deletions

View file

@ -244,8 +244,8 @@ impl IDBDatabaseMethods<crate::DomTypeHolder> for IDBDatabase {
name.clone(),
Some(options),
CanGc::note(),
&upgrade_transaction,
);
object_store.set_transaction(&upgrade_transaction);
let (sender, receiver) = ipc::channel(self.global().time_profiler_chan().clone()).unwrap();