diff options
author | Andreas Kling <kling@serenityos.org> | 2021-10-24 16:25:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-10-24 17:18:09 +0200 |
commit | 65a7296b8f4431eea275b31c1490abd72b1af7c1 (patch) | |
tree | 6d4ad41cd9facf7133d9c92d8a527fe66b8e9dcb /Userland/Libraries/LibJS/Runtime/Value.cpp | |
parent | 7ccb8c86093bb05dc25f6a261bb048d1d590eebf (diff) | |
download | serenity-65a7296b8f4431eea275b31c1490abd72b1af7c1.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Value.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Value.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 44474144b2..2e059e092f 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -559,7 +559,7 @@ ThrowCompletionOr<double> Value::to_double(GlobalObject& global_object) const } // 7.1.19 ToPropertyKey ( argument ), https://tc39.es/ecma262/#sec-topropertykey -ThrowCompletionOr<StringOrSymbol> Value::to_property_key(GlobalObject& global_object) const +ThrowCompletionOr<PropertyKey> Value::to_property_key(GlobalObject& global_object) const { auto key = TRY(to_primitive(global_object, PreferredType::String)); if (key.is_symbol()) |