Chromium Code Reviews| Index: src/runtime/runtime-internal.cc |
| diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc |
| index a1b8756036a3ad274f59f358d613ea943a4657f7..8a554390c3aa845a0e28759b133bd3680fed97e4 100644 |
| --- a/src/runtime/runtime-internal.cc |
| +++ b/src/runtime/runtime-internal.cc |
| @@ -511,10 +511,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)); |
|
jgruber
2017/02/17 12:28:23
We just asserted it's a JSReceiver - can we make t
caitp
2017/02/17 14:56:11
This _may_ be a problem for heap verifier, if veri
|
| } |
| } // namespace internal |