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

Unified Diff: src/runtime/runtime-internal.cc

Issue 2645313003: [async-iteration] implement Async-from-Sync Iterator (Closed)
Patch Set: attempt #3 to fix merge conflicts Created 3 years, 11 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/runtime/runtime-internal.cc
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc
index 2969edfc76c43b13eb5ace315fd0bf9c1c53e2b7..f7864324d6c27ea1674fdaeefa88ba443fa6ba5a 100644
--- a/src/runtime/runtime-internal.cc
+++ b/src/runtime/runtime-internal.cc
@@ -505,10 +505,18 @@ RUNTIME_FUNCTION(Runtime_AllowDynamicFunction) {
}
RUNTIME_FUNCTION(Runtime_CreateAsyncFromSyncIterator) {
- // TODO(caitp): split AsyncFromSyncIterator functionality out of
- // https://codereview.chromium.org/2622833002
- UNREACHABLE();
- return isolate->heap()->undefined_value();
+ HandleScope scope(isolate);
+ DCHECK_EQ(1, args.length());
+
+ CONVERT_ARG_HANDLE_CHECKED(Object, sync_iterator, 0);
+
+ if (!sync_iterator->IsJSReceiver()) {
+ THROW_NEW_ERROR_RETURN_FAILURE(
+ isolate, NewTypeError(MessageTemplate::kSymbolIteratorInvalid));
+ }
+
+ return *isolate->factory()->NewJSAsyncFromSyncIterator(
+ Handle<HeapObject>::cast(sync_iterator));
}
} // namespace internal
« src/builtins/builtins-async-iterator.cc ('K') | « src/objects-inl.h ('k') | src/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698