Index: src/array-iterator.js |
diff --git a/src/array-iterator.js b/src/array-iterator.js |
index defd7342ab2d4fb62cace6a0bb0e4aecbc457684..8f1ab47b8a2088fd72956be2e3fc8bae00ceeac4 100644 |
--- a/src/array-iterator.js |
+++ b/src/array-iterator.js |
@@ -77,15 +77,16 @@ function ArrayIteratorNext() { |
return CreateIteratorResultObject(void 0, true); |
} |
+ var elementKey = ToString(index); |
iterator[arrayIteratorNextIndexSymbol] = index + 1; |
if (itemKind == ARRAY_ITERATOR_KIND_VALUES) |
- return CreateIteratorResultObject(array[index], false); |
+ return CreateIteratorResultObject(array[elementKey], false); |
if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES) |
- return CreateIteratorResultObject([index, array[index]], false); |
+ return CreateIteratorResultObject([elementKey, array[elementKey]], false); |
- return CreateIteratorResultObject(index, false); |
+ return CreateIteratorResultObject(elementKey, false); |
} |
function ArrayEntries() { |