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

Unified Diff: src/builtins/builtins-function.cc

Issue 2622833002: WIP [esnext] implement async iteration proposal (Closed)
Patch Set: simplify AsyncIteratorValueUnwrap 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
« no previous file with comments | « src/builtins/builtins-async-iterator.cc ('k') | src/builtins/builtins-promise.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-function.cc
diff --git a/src/builtins/builtins-function.cc b/src/builtins/builtins-function.cc
index 818e09a722590e84d12357d19109683a06370bbc..ab915b0a675e6e5b8b5f8c20e553b50ef6063906 100644
--- a/src/builtins/builtins-function.cc
+++ b/src/builtins/builtins-function.cc
@@ -163,6 +163,24 @@ BUILTIN(AsyncFunctionConstructor) {
return *func;
}
+BUILTIN(AsyncGeneratorFunctionConstructor) {
+ HandleScope scope(isolate);
+ Handle<Object> maybe_func;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
+ isolate, maybe_func,
+ CreateDynamicFunction(isolate, args, "async function*"));
+ if (!maybe_func->IsJSFunction()) return *maybe_func;
+
+ // Do not lazily compute eval position for AsyncFunction, as they may not be
+ // determined after the function is resumed.
+ Handle<JSFunction> func = Handle<JSFunction>::cast(maybe_func);
+ Handle<Script> script = handle(Script::cast(func->shared()->script()));
+ int position = script->GetEvalPosition();
+ USE(position);
+
+ return *func;
+}
+
namespace {
Object* DoFunctionBind(Isolate* isolate, BuiltinArguments args) {
« no previous file with comments | « src/builtins/builtins-async-iterator.cc ('k') | src/builtins/builtins-promise.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698