Index: runtime/vm/dart_entry.cc |
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc |
index 5f029e9f1d437324a90ba764665fe294c0ac1560..1053404fda494ed42346e4db8766c5160386d7e6 100644 |
--- a/runtime/vm/dart_entry.cc |
+++ b/runtime/vm/dart_entry.cc |
@@ -558,6 +558,20 @@ RawObject* DartLibraryCalls::HandleMessage(const Object& handler, |
} |
+RawObject* DartLibraryCalls::DrainMicrotaskQueue() { |
+ Isolate* isolate = Isolate::Current(); |
+ Library& isolate_lib = Library::Handle(isolate, Library::IsolateLibrary()); |
+ ASSERT(!isolate_lib.IsNull()); |
+ Function& function = Function::Handle(isolate, |
+ isolate_lib.LookupFunctionAllowPrivate( |
+ Symbols::_runPendingImmediateCallback())); |
+ const Object& result = Object::Handle(isolate, |
+ DartEntry::InvokeFunction(function, Object::empty_array())); |
+ ASSERT(result.IsNull() || result.IsError()); |
+ return result.raw(); |
+} |
+ |
+ |
RawObject* DartLibraryCalls::MapSetAt(const Instance& map, |
const Instance& key, |
const Instance& value) { |