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

Unified Diff: src/d8.cc

Issue 1895603002: [esnext] prototype runtime implementation for async functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AsyncFunction
Patch Set: Partially fix `throw` completions (resumption works, but no resumption doesn't) Created 4 years, 8 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/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index 169bc263934a8f1344419ac53ee0d88b8431d50f..0dd1ed8d66464ce84f18480b7316c25594d050da 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -886,6 +886,10 @@ void Shell::Version(const v8::FunctionCallbackInfo<v8::Value>& args) {
NewStringType::kNormal).ToLocalChecked());
}
+void Shell::FlushMicrotasks(const v8::FunctionCallbackInfo<v8::Value>& args) {
+ Isolate* isolate = args.GetIsolate();
+ isolate->RunMicrotasks();
caitp (gmail) 2016/04/16 18:33:03 This is useful for testing the async-await-basic.j
+}
void Shell::ReportException(Isolate* isolate, v8::TryCatch* try_catch) {
HandleScope handle_scope(isolate);
@@ -1203,6 +1207,11 @@ Local<ObjectTemplate> Shell::CreateGlobalTemplate(Isolate* isolate) {
.ToLocalChecked(),
os_templ);
+ global_template->Set(
+ String::NewFromUtf8(isolate, "flushMicrotasks", NewStringType::kNormal)
+ .ToLocalChecked(),
+ FunctionTemplate::New(isolate, FlushMicrotasks));
+
return global_template;
}

Powered by Google App Engine
This is Rietveld 408576698