| 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();
|
| +}
|
|
|
| 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;
|
| }
|
|
|
|
|