Index: src/execution.cc |
diff --git a/src/execution.cc b/src/execution.cc |
index da2d880a4941ee88a8521530b5223dda3a1be395..6315307585126120c866dd3465e226d328b85672 100644 |
--- a/src/execution.cc |
+++ b/src/execution.cc |
@@ -368,6 +368,22 @@ void Execution::RunMicrotasks(Isolate* isolate) { |
} |
+void Execution::EnqueueExternalMicrotask(Isolate* isolate, |
+ v8::MicrotaskCallback callback) { |
+ bool threw = false; |
+ Handle<Object> handler = v8::FromCData(isolate, callback); |
+ Handle<Object> args[] = { handler }; |
+ Execution::Call( |
+ isolate, |
+ isolate->enqueue_external_microtask(), |
+ isolate->factory()->undefined_value(), |
+ 1, |
+ args, |
+ &threw); |
+ ASSERT(!threw); |
+} |
+ |
+ |
bool StackGuard::IsStackOverflow() { |
ExecutionAccess access(isolate_); |
return (thread_local_.jslimit_ != kInterruptLimit && |