From ba807c2d44cec6f634bee57ba32e7fd153d5bb0b Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Tue, 15 Jun 2021 12:46:35 +0300 Subject: [PATCH] LibJS: Call toString on the key, not on the argument in ToPropertyKey As required by the specification: https://tc39.es/ecma262/#sec-topropertykey --- Userland/Libraries/LibJS/Runtime/Value.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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