فهرست منبع

LibJS: Call toString on the key, not on the argument in ToPropertyKey

As required by the specification:
https://tc39.es/ecma262/#sec-topropertykey
Idan Horowitz 4 سال پیش
والد
کامیت
ba807c2d44
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      Userland/Libraries/LibJS/Runtime/Value.cpp

+ 1 - 1
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