1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

LibJS: Make Value::to_property_key() return a JS::PropertyKey

Instead of returning JS::StringOrSymbol, which is a space-optimized type
used in Shape property tables, this now returns JS::PropertyKey which is
*not* space-optimized, but has other niceties like optimized storage of
numeric ("indexed") properties.
This commit is contained in:
Andreas Kling 2021-10-24 16:25:39 +02:00
parent 7ccb8c8609
commit 65a7296b8f
3 changed files with 3 additions and 3 deletions

View file

@ -668,7 +668,7 @@ ThrowCompletionOr<MarkedValueList> ProxyObject::internal_own_property_keys() con
auto trap_result_array = TRY(vm.call(*trap, &m_handler, &m_target));
// 8. Let trapResult be ? CreateListFromArrayLike(trapResultArray, « String, Symbol »).
HashTable<StringOrSymbol> unique_keys;
HashTable<PropertyKey> unique_keys;
auto trap_result = TRY(create_list_from_array_like(global_object, trap_result_array, [&](auto value) -> ThrowCompletionOr<void> {
auto& vm = global_object.vm();
if (!value.is_string() && !value.is_symbol())