Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: src/array-iterator.js

Issue 21180008: Update Array Iterator to use numeric indexes (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/array-iterator.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/array-iterator.js
diff --git a/src/array-iterator.js b/src/array-iterator.js
index 8f1ab47b8a2088fd72956be2e3fc8bae00ceeac4..defd7342ab2d4fb62cace6a0bb0e4aecbc457684 100644
--- a/src/array-iterator.js
+++ b/src/array-iterator.js
@@ -77,16 +77,15 @@ function ArrayIteratorNext() {
return CreateIteratorResultObject(void 0, true);
}
- var elementKey = ToString(index);
iterator[arrayIteratorNextIndexSymbol] = index + 1;
if (itemKind == ARRAY_ITERATOR_KIND_VALUES)
- return CreateIteratorResultObject(array[elementKey], false);
+ return CreateIteratorResultObject(array[index], false);
if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES)
- return CreateIteratorResultObject([elementKey, array[elementKey]], false);
+ return CreateIteratorResultObject([index, array[index]], false);
- return CreateIteratorResultObject(elementKey, false);
+ return CreateIteratorResultObject(index, false);
}
function ArrayEntries() {
« no previous file with comments | « no previous file | test/mjsunit/harmony/array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698