mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
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:
Notes:
github-actions[bot]
2026-02-06 10:48:22 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/f6e9d04603f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7705
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user