Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 5261b6a5ff931381d463e3fda522e23e24ad8389..09f6947aeb5d29d620d4c2668b648b073c811572 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -12474,7 +12474,7 @@ void Dictionary<Shape, Key>::CopyKeysTo( |
} |
-void StringDictionary::CopyEnumKeysTo(FixedArray* storage) { |
+FixedArray* StringDictionary::CopyEnumKeysTo(FixedArray* storage) { |
int length = storage->length(); |
ASSERT(length >= NumberOfEnumElements()); |
Heap* heap = GetHeap(); |
@@ -12501,6 +12501,7 @@ void StringDictionary::CopyEnumKeysTo(FixedArray* storage) { |
// together by shifting them to the left (maintaining the enumeration order), |
// and trimming of the right side of the array. |
if (properties < length) { |
+ if (properties == 0) return heap->empty_fixed_array(); |
properties = 0; |
for (int i = 0; i < length; ++i) { |
Object* value = storage->get(i); |
@@ -12511,6 +12512,7 @@ void StringDictionary::CopyEnumKeysTo(FixedArray* storage) { |
} |
RightTrimFixedArray<FROM_MUTATOR>(heap, storage, length - properties); |
} |
+ return storage; |
} |