LibWeb/IDB: Dont move away the name when creating an Index

This commit is contained in:
stelar7 2025-05-02 14:31:58 +02:00 committed by Jelle Raaijmakers
commit 0ed71d87ca
Notes: github-actions[bot] 2025-05-06 09:17:23 +00:00
2 changed files with 5 additions and 5 deletions

View file

@ -13,14 +13,14 @@ GC_DEFINE_ALLOCATOR(Index);
Index::~Index() = default; Index::~Index() = default;
GC::Ref<Index> Index::create(JS::Realm& realm, GC::Ref<ObjectStore> store, String name, KeyPath const& key_path, bool unique, bool multi_entry) GC::Ref<Index> Index::create(JS::Realm& realm, GC::Ref<ObjectStore> store, String const& name, KeyPath const& key_path, bool unique, bool multi_entry)
{ {
return realm.create<Index>(store, name, key_path, unique, multi_entry); return realm.create<Index>(store, name, key_path, unique, multi_entry);
} }
Index::Index(GC::Ref<ObjectStore> store, String name, KeyPath const& key_path, bool unique, bool multi_entry) Index::Index(GC::Ref<ObjectStore> store, String const& name, KeyPath const& key_path, bool unique, bool multi_entry)
: m_object_store(store) : m_object_store(store)
, m_name(move(name)) , m_name(name)
, m_unique(unique) , m_unique(unique)
, m_multi_entry(multi_entry) , m_multi_entry(multi_entry)
, m_key_path(key_path) , m_key_path(key_path)

View file

@ -28,7 +28,7 @@ class Index : public JS::Cell {
GC_DECLARE_ALLOCATOR(Index); GC_DECLARE_ALLOCATOR(Index);
public: public:
[[nodiscard]] static GC::Ref<Index> create(JS::Realm&, GC::Ref<ObjectStore>, String, KeyPath const&, bool, bool); [[nodiscard]] static GC::Ref<Index> create(JS::Realm&, GC::Ref<ObjectStore>, String const&, KeyPath const&, bool, bool);
virtual ~Index(); virtual ~Index();
void set_name(String name); void set_name(String name);
@ -45,7 +45,7 @@ protected:
virtual void visit_edges(Visitor&) override; virtual void visit_edges(Visitor&) override;
private: private:
Index(GC::Ref<ObjectStore>, String, KeyPath const&, bool, bool); Index(GC::Ref<ObjectStore>, String const&, KeyPath const&, bool, bool);
// An index [...] has a referenced object store. // An index [...] has a referenced object store.
GC::Ref<ObjectStore> m_object_store; GC::Ref<ObjectStore> m_object_store;