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/collection-iterator.js

Issue 1302173007: [es6] Introduce a dedicated JSIteratorResult type. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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/bootstrapper.cc ('k') | src/contexts.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/collection-iterator.js
diff --git a/src/collection-iterator.js b/src/collection-iterator.js
index 9cfe31e9edeaba36ed417a3c2e136da23f79f9e3..c799d6f9cd2585845248898169ae0f0a5f7898c0 100644
--- a/src/collection-iterator.js
+++ b/src/collection-iterator.js
@@ -32,21 +32,21 @@ function SetIteratorNextJS() {
}
var value_array = [UNDEFINED, UNDEFINED];
- var entry = {value: value_array, done: false};
+ var result = %_CreateIterResultObject(value_array, false);
switch (%SetIteratorNext(this, value_array)) {
case 0:
- entry.value = UNDEFINED;
- entry.done = true;
+ result.value = UNDEFINED;
+ result.done = true;
break;
case ITERATOR_KIND_VALUES:
- entry.value = value_array[0];
+ result.value = value_array[0];
break;
case ITERATOR_KIND_ENTRIES:
value_array[1] = value_array[0];
break;
}
- return entry;
+ return result;
}
@@ -104,22 +104,22 @@ function MapIteratorNextJS() {
}
var value_array = [UNDEFINED, UNDEFINED];
- var entry = {value: value_array, done: false};
+ var result = %_CreateIterResultObject(value_array, false);
switch (%MapIteratorNext(this, value_array)) {
case 0:
- entry.value = UNDEFINED;
- entry.done = true;
+ result.value = UNDEFINED;
+ result.done = true;
break;
case ITERATOR_KIND_KEYS:
- entry.value = value_array[0];
+ result.value = value_array[0];
break;
case ITERATOR_KIND_VALUES:
- entry.value = value_array[1];
+ result.value = value_array[1];
break;
// ITERATOR_KIND_ENTRIES does not need any processing.
}
- return entry;
+ return result;
}
« no previous file with comments | « src/bootstrapper.cc ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698