summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-06-15 12:46:35 +0300
committerLinus Groh <mail@linusgroh.de>2021-06-15 12:15:18 +0100
commitba807c2d44cec6f634bee57ba32e7fd153d5bb0b (patch)
treeffd5b2ab1fbd69b2d52dc9f26bf8738b8dd83ebc
parent9a0cbcc3d1f695298d3a00f08d27fba377bd894d (diff)
downloadserenity-ba807c2d44cec6f634bee57ba32e7fd153d5bb0b.zip
LibJS: Call toString on the key, not on the argument in ToPropertyKey
As required by the specification: https://tc39.es/ecma262/#sec-topropertykey
-rw-r--r--Userland/Libraries/LibJS/Runtime/Value.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp
index e180964082..2a77f30d93 100644
--- a/Userland/Libraries/LibJS/Runtime/Value.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Value.cpp
@@ -576,7 +576,7 @@ StringOrSymbol Value::to_property_key(GlobalObject& global_object) const
return {};
if (key.is_symbol())
return &key.as_symbol();
- return to_string(global_object);
+ return key.to_string(global_object);
}
i32 Value::to_i32_slow_case(GlobalObject& global_object) const