Explorar el Código

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 hace 4 años
padre
commit
ba807c2d44
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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