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

Unified Diff: src/factory.cc

Issue 236143002: ES6: Add support for Map.prototype.forEach and Set.prototype.forEach (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index fc49e32537ebec9a4799012bc10b4b7ccbeffc72..04e9561af716293073774d234b34de1ed90cf136 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1996,4 +1996,23 @@ Handle<Object> Factory::ToBoolean(bool value) {
return value ? true_value() : false_value();
}
+Handle<JSObject> Factory::CreateIteratorResultObject(Handle<Object> value,
+ bool done) {
+ Handle<Map> map(isolate()->native_context()->iterator_result_map());
+ Handle<JSObject> result = NewJSObjectFromMap(map, NOT_TENURED, false);
+ JSObject::SetProperty(
+ result,
+ InternalizeOneByteString(STATIC_ASCII_VECTOR("value")),
adamk 2014/04/14 19:15:42 "value" and "done" are already available in the he
arv (Not doing code reviews) 2014/04/14 19:51:49 Done.
+ value,
+ NONE,
+ SLOPPY).Assert();
+ JSObject::SetProperty(
+ result,
+ InternalizeOneByteString(STATIC_ASCII_VECTOR("done")),
+ ToBoolean(done),
+ NONE,
+ SLOPPY).Assert();
+ return result;
+}
+
} } // namespace v8::internal

Powered by Google App Engine
This is Rietveld 408576698