OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 RUNTIME_FUNCTION(Runtime_AllowDynamicFunction) { | 498 RUNTIME_FUNCTION(Runtime_AllowDynamicFunction) { |
499 HandleScope scope(isolate); | 499 HandleScope scope(isolate); |
500 DCHECK_EQ(1, args.length()); | 500 DCHECK_EQ(1, args.length()); |
501 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); | 501 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); |
502 Handle<JSObject> global_proxy(target->global_proxy(), isolate); | 502 Handle<JSObject> global_proxy(target->global_proxy(), isolate); |
503 return *isolate->factory()->ToBoolean( | 503 return *isolate->factory()->ToBoolean( |
504 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); | 504 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); |
505 } | 505 } |
506 | 506 |
507 RUNTIME_FUNCTION(Runtime_CreateAsyncFromSyncIterator) { | 507 RUNTIME_FUNCTION(Runtime_CreateAsyncFromSyncIterator) { |
508 // TODO(caitp): split AsyncFromSyncIterator functionality out of | 508 HandleScope scope(isolate); |
509 // https://codereview.chromium.org/2622833002 | 509 DCHECK_EQ(1, args.length()); |
510 UNREACHABLE(); | 510 |
511 return isolate->heap()->undefined_value(); | 511 CONVERT_ARG_HANDLE_CHECKED(Object, sync_iterator, 0); |
| 512 |
| 513 if (!sync_iterator->IsJSReceiver()) { |
| 514 THROW_NEW_ERROR_RETURN_FAILURE( |
| 515 isolate, NewTypeError(MessageTemplate::kSymbolIteratorInvalid)); |
| 516 } |
| 517 |
| 518 return *isolate->factory()->NewJSAsyncFromSyncIterator( |
| 519 Handle<HeapObject>::cast(sync_iterator)); |
512 } | 520 } |
513 | 521 |
514 } // namespace internal | 522 } // namespace internal |
515 } // namespace v8 | 523 } // namespace v8 |
OLD | NEW |