Index: src/d8.cc |
diff --git a/src/d8.cc b/src/d8.cc |
index 83bbd7e20f79933fea1539790e665dcfccf283da..3137ac2a9f66cc6ce154903030ea6a848f922d99 100644 |
--- a/src/d8.cc |
+++ b/src/d8.cc |
@@ -347,6 +347,7 @@ bool Shell::ExecuteString(Isolate* isolate, Handle<String> source, |
return false; |
} |
result = script->Run(); |
+ EmptyMessageQueues(isolate); |
data->realm_current_ = data->realm_switch_; |
} |
if (result.IsEmpty()) { |
@@ -1985,6 +1986,11 @@ void Shell::CollectGarbage(Isolate* isolate) { |
} |
+void Shell::EmptyMessageQueues(Isolate* isolate) { |
+ while (v8::platform::PumpMessageLoop(g_platform, isolate)) continue; |
+} |
+ |
+ |
#ifndef V8_SHARED |
bool Shell::SerializeValue(Isolate* isolate, Handle<Value> value, |
const ObjectList& to_transfer, |