Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index ca552fc60f6ba44140461666f730411a92de0fe4..f966177c6fd6d76f3d764bfeb3bab1b8bdf2d2c2 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -6664,6 +6664,18 @@ void Isolate::EnqueueMicrotask(Handle<Function> microtask) { |
} |
+void Isolate::EnqueueMicrotask(MicrotaskCallback microtask, void* data) { |
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
+ i::HandleScope scope(isolate); |
+ i::Handle<i::CallHandlerInfo> callback_info = |
dcarney
2014/06/02 07:22:10
if you're going to reuse the CallHandlerInfo struc
adamk
2014/06/02 16:41:50
I'm guessing this might be the source of my try jo
|
+ i::Handle<i::CallHandlerInfo>::cast( |
+ isolate->factory()->NewStruct(i::CALL_HANDLER_INFO_TYPE)); |
+ SET_FIELD_WRAPPED(callback_info, set_callback, microtask); |
+ SET_FIELD_WRAPPED(callback_info, set_data, data); |
+ isolate->EnqueueMicrotask(callback_info); |
+} |
+ |
+ |
void Isolate::SetAutorunMicrotasks(bool autorun) { |
reinterpret_cast<i::Isolate*>(this)->set_autorun_microtasks(autorun); |
} |