Skip to content

Commit 0e9faf2

Browse files
committed
[MERGE #5683 @VSadov] Do not lose property string in ToPropertyKey
Merge pull request #5683 from VSadov:propString Looks like the intent of the method is to set propString to a property string if the argument happen to be one. It does not do that now. Possibly due to a typo. In particular, methods such as HasOwnProperty check if propString is returned and would use its inline caches, but since the property string is not returned, the optimization cannot work.
2 parents 1987607 + a86b33a commit 0e9faf2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Runtime/Language/JavascriptConversion.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ using namespace Js;
285285
// For all other types, convert the key into a string and use that as the property name
286286
JavascriptString * propName = JavascriptConversion::ToString(key, scriptContext);
287287
propName->GetPropertyRecord(propertyRecord);
288+
if (PropertyString::Is(propName))
289+
{
290+
propertyString = PropertyString::UnsafeFromVar(propName);
291+
}
288292
}
289293

290294
if (propString)

0 commit comments

Comments
 (0)