Skip to content

Commit 89f80cb

Browse files
committed
Address review comments
1 parent eaa14a7 commit 89f80cb

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

lib/Runtime/Library/ForInObjectEnumerator.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,7 @@ namespace Js
210210
return nullptr;
211211
}
212212

213-
// Ignore special properties (ex: Array.length)
214-
uint specialPropertyCount = this->shadowData->currentObject->GetSpecialPropertyCount();
215-
if (specialPropertyCount > 0)
216-
{
217-
PropertyId const* specialPropertyIds = this->shadowData->currentObject->GetSpecialPropertyIds();
218-
Assert(specialPropertyIds != nullptr);
219-
for (uint i = 0; i < specialPropertyCount; i++)
220-
{
221-
TestAndSetEnumerated(specialPropertyIds[i]);
222-
}
223-
}
213+
RecyclableObject* previousObject = this->shadowData->currentObject;
224214

225215
RecyclableObject * object;
226216
if (!this->enumeratingPrototype)
@@ -261,6 +251,21 @@ namespace Js
261251
}
262252
}
263253
while (true);
254+
255+
// Ignore special properties (ex: Array.length)
256+
if (previousObject != nullptr)
257+
{
258+
uint specialPropertyCount = previousObject->GetSpecialPropertyCount();
259+
if (specialPropertyCount > 0)
260+
{
261+
PropertyId const* specialPropertyIds = previousObject->GetSpecialPropertyIds();
262+
Assert(specialPropertyIds != nullptr);
263+
for (uint i = 0; i < specialPropertyCount; i++)
264+
{
265+
TestAndSetEnumerated(specialPropertyIds[i]);
266+
}
267+
}
268+
}
264269
}
265270
}
266271
}

0 commit comments

Comments
 (0)