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

Unified Diff: src/collection.js

Issue 289503002: ES6 Map/Set iterators/forEach improvements (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git rebase to fix merge conflict Created 6 years, 7 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 | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/collection.js
diff --git a/src/collection.js b/src/collection.js
index b201d57bc5ceef6883305a1558df210fdc3e7b8a..fefc7a0499db3c71ea1585ab2eb5a8767af755f9 100644
--- a/src/collection.js
+++ b/src/collection.js
@@ -106,12 +106,8 @@ function SetForEach(f, receiver) {
var iterator = %SetCreateIterator(this, ITERATOR_KIND_VALUES);
var entry;
- try {
- while (!(entry = %SetIteratorNext(iterator)).done) {
- %_CallFunction(receiver, entry.value, entry.value, this, f);
- }
- } finally {
- %SetIteratorClose(iterator);
+ while (!(entry = %SetIteratorNext(iterator)).done) {
+ %_CallFunction(receiver, entry.value, entry.value, this, f);
}
}
@@ -219,12 +215,8 @@ function MapForEach(f, receiver) {
var iterator = %MapCreateIterator(this, ITERATOR_KIND_ENTRIES);
var entry;
- try {
- while (!(entry = %MapIteratorNext(iterator)).done) {
- %_CallFunction(receiver, entry.value[1], entry.value[0], this, f);
- }
- } finally {
- %MapIteratorClose(iterator);
+ while (!(entry = %MapIteratorNext(iterator)).done) {
+ %_CallFunction(receiver, entry.value[1], entry.value[0], this, f);
}
}
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698