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

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

Issue 2622833002: WIP [esnext] implement async iteration proposal (Closed)
Patch Set: Fix minor parsing bug, add some local test262 tests 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-generator.cc
diff --git a/src/runtime/runtime-generator.cc b/src/runtime/runtime-generator.cc
index 81c66408d363955522d998639132ba848d52dcfe..fe452fed8e1a75f0e8b8e7c7c5c84cf3c2c323c3 100644
--- a/src/runtime/runtime-generator.cc
+++ b/src/runtime/runtime-generator.cc
@@ -69,6 +69,27 @@ RUNTIME_FUNCTION(Runtime_GeneratorGetInputOrDebugPos) {
return generator->input_or_debug_pos();
}
+RUNTIME_FUNCTION(Runtime_GeneratorGetAwaitInput) {
+ HandleScope scope(isolate);
+ DCHECK_EQ(1, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0);
+
+ return generator->await_input();
+}
+
+RUNTIME_FUNCTION(Runtime_GeneratorSaveInputForAwait) {
+ HandleScope scope(isolate);
+ DCHECK_EQ(1, args.length());
+ CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0);
+
+ // Generator must be executing
+ DCHECK_EQ(generator->continuation(), JSGeneratorObject::kGeneratorExecuting);
+
+ generator->set_await_input(generator->input_or_debug_pos());
+
+ return isolate->heap()->undefined_value();
+}
+
RUNTIME_FUNCTION(Runtime_GeneratorGetResumeMode) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());

Powered by Google App Engine
This is Rietveld 408576698