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

Unified Diff: src/factory.cc

Issue 2645313003: [async-iteration] implement Async-from-Sync Iterator (Closed)
Patch Set: cleanmerge Created 3 years, 10 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/factory.h ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 217faca9b22de3b9b97432263e1c124cfa8adf06..69f1072a07a1b05accf6d00b65c793bb9eac3931 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1975,6 +1975,16 @@ Handle<JSIteratorResult> Factory::NewJSIteratorResult(Handle<Object> value,
return js_iter_result;
}
+Handle<JSAsyncFromSyncIterator> Factory::NewJSAsyncFromSyncIterator(
+ Handle<JSReceiver> sync_iterator) {
+ Handle<Map> map(isolate()->native_context()->async_from_sync_iterator_map());
+ Handle<JSAsyncFromSyncIterator> iterator =
+ Handle<JSAsyncFromSyncIterator>::cast(NewJSObjectFromMap(map));
+
+ iterator->set_sync_iterator(*sync_iterator);
+ return iterator;
+}
+
Handle<JSMap> Factory::NewJSMap() {
Handle<Map> map(isolate()->native_context()->js_map_map());
Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map));
« no previous file with comments | « src/factory.h ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698