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 |