LibWeb/HTML: Disable storage indexed properties to avoid duplicate keys

Storage keys are strings, even when they look numeric. Advertising
support for indexed properties caused numeric keys (e.g. "0") to be
exposed twice during enumeration: once via indexed property enumeration
and once via named properties.

Disable indexed property support while keeping the indexed setter
enabled, so assignments like storage[42] = "x" still work by coercing
the index to a string key, without introducing a separate indexed
property space.
This commit is contained in:
Shannon Booth
2026-01-31 19:39:18 +01:00
committed by Tim Flynn
parent 57339a21a1
commit f6e9d04603
Notes: github-actions[bot] 2026-02-06 10:48:22 +00:00
2 changed files with 3 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ Storage::Storage(JS::Realm& realm, Type type, GC::Ref<StorageAPI::StorageBottle>
, m_storage_bottle(move(storage_bottle))
{
m_legacy_platform_object_flags = LegacyPlatformObjectFlags {
.supports_indexed_properties = true,
.supports_indexed_properties = false,
.supports_named_properties = true,
.has_indexed_property_setter = true,
.has_named_property_setter = true,