summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/JSObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSObject.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/JSObject.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp
index 72cbb022a..290a3ab16 100644
--- a/Source/JavaScriptCore/runtime/JSObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSObject.cpp
@@ -1513,10 +1513,12 @@ void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNa
void JSObject::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
getClassPropertyNames(exec, object->classInfo(), propertyNames, mode, object->staticFunctionsReified());
- size_t preStructurePropertyNamesCount = propertyNames.size();
+
+ bool canCachePropertiesFromStructure = !propertyNames.size();
object->structure()->getPropertyNamesFromStructure(exec->globalData(), propertyNames, mode);
- size_t numCacheableSlots = preStructurePropertyNamesCount ? 0 : propertyNames.size();
- propertyNames.setNumCacheableSlots(numCacheableSlots);
+
+ if (canCachePropertiesFromStructure)
+ propertyNames.setNumCacheableSlots(propertyNames.size());
}
double JSObject::toNumber(ExecState* exec) const