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

Unified Diff: src/array-iterator.js

Issue 22715004: Version 3.20.15 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Add TypedArray API and correctness patches r16033 and r16084 Created 7 years, 4 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 | « src/arm/macro-assembler-arm.cc ('k') | src/ast.h » ('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 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() {
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698