summaryrefslogtreecommitdiff
path: root/core/libdeno/api.cc
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2019-09-12 21:13:08 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-09-12 15:13:08 -0400
commitc03cdcc939f86c9865dc7a700782bdf558fa83f5 (patch)
tree941e9c9221cdea1e6df0eeee63defaf8a851381a /core/libdeno/api.cc
parent69e01c2374539e02956e643d87cd9a6afa805db9 (diff)
feat: add bindings to run microtasks from Isolate (#2793)
Diffstat (limited to 'core/libdeno/api.cc')
-rw-r--r--core/libdeno/api.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/libdeno/api.cc b/core/libdeno/api.cc
index 1e6b5dfbf..2e926f793 100644
--- a/core/libdeno/api.cc
+++ b/core/libdeno/api.cc
@@ -233,4 +233,13 @@ void deno_terminate_execution(Deno* d_) {
deno::DenoIsolate* d = reinterpret_cast<deno::DenoIsolate*>(d_);
d->isolate_->TerminateExecution();
}
+
+void deno_run_microtasks(Deno* d_, void* user_data) {
+ deno::DenoIsolate* d = reinterpret_cast<deno::DenoIsolate*>(d_);
+
+ deno::UserDataScope user_data_scope(d, user_data);
+ v8::Locker locker(d->isolate_);
+ v8::Isolate::Scope isolate_scope(d->isolate_);
+ d->isolate_->RunMicrotasks();
+}
}