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

Unified Diff: src/array-iterator.js

Issue 238063009: ES6: Add support for Map/Set forEach (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove explicit instantiation of private and functions in objects-inl.h Created 6 years, 8 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
Index: src/array-iterator.js
diff --git a/src/array-iterator.js b/src/array-iterator.js
index 3af659dbccb58d4ed7436010df26154bc6d74a18..10116b1d10b502c2079ce5e320db21b06ef60858 100644
--- a/src/array-iterator.js
+++ b/src/array-iterator.js
@@ -31,11 +31,6 @@
// in runtime.js:
// var $Array = global.Array;
-var ARRAY_ITERATOR_KIND_KEYS = 1;
-var ARRAY_ITERATOR_KIND_VALUES = 2;
-var ARRAY_ITERATOR_KIND_ENTRIES = 3;
-// The spec draft also has "sparse" but it is never used.
-
var arrayIteratorObjectSymbol = GLOBAL_PRIVATE("ArrayIterator#object");
var arrayIteratorNextIndexSymbol = GLOBAL_PRIVATE("ArrayIterator#next");
var arrayIterationKindSymbol = GLOBAL_PRIVATE("ArrayIterator#kind");
@@ -79,25 +74,25 @@ function ArrayIteratorNext() {
SET_PRIVATE(iterator, arrayIteratorNextIndexSymbol, index + 1);
- if (itemKind == ARRAY_ITERATOR_KIND_VALUES)
+ if (itemKind == ITERATOR_KIND_VALUES)
return CreateIteratorResultObject(array[index], false);
- if (itemKind == ARRAY_ITERATOR_KIND_ENTRIES)
+ if (itemKind == ITERATOR_KIND_ENTRIES)
return CreateIteratorResultObject([index, array[index]], false);
return CreateIteratorResultObject(index, false);
}
function ArrayEntries() {
- return CreateArrayIterator(this, ARRAY_ITERATOR_KIND_ENTRIES);
+ return CreateArrayIterator(this, ITERATOR_KIND_ENTRIES);
}
function ArrayValues() {
- return CreateArrayIterator(this, ARRAY_ITERATOR_KIND_VALUES);
+ return CreateArrayIterator(this, ITERATOR_KIND_VALUES);
}
function ArrayKeys() {
- return CreateArrayIterator(this, ARRAY_ITERATOR_KIND_KEYS);
+ return CreateArrayIterator(this, ITERATOR_KIND_KEYS);
}
function SetUpArrayIterator() {
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/bootstrapper.cc » ('j') | src/objects-printer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698