Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
chakrashim, test: add shim for v8::Isolate::EnqueueMicrotask and make…
Browse files Browse the repository at this point in the history
… associated unit test pass on node-chakracore
  • Loading branch information
boingoing committed Nov 14, 2018
1 parent 2fa1792 commit d168295
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions deps/chakrashim/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -2959,6 +2959,7 @@ class V8_EXPORT Isolate {
void SetPromiseHook(PromiseHook hook);
void SetPromiseRejectCallback(PromiseRejectCallback callback);
void RunMicrotasks();
void EnqueueMicrotask(Local<Function> microtask);
void EnqueueMicrotask(MicrotaskCallback microtask, void* data = nullptr);
void SetMicrotasksPolicy(MicrotasksPolicy policy);
void SetAutorunMicrotasks(bool autorun);
Expand Down
4 changes: 4 additions & 0 deletions deps/chakrashim/src/v8isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ void Isolate::SetJitCodeEventHandler(JitCodeEventOptions options,
// need it because we do our own ETW tracing.
}

void Isolate::EnqueueMicrotask(Local<Function> microtask) {
jsrt::IsolateShim::FromIsolate(this)->QueueMicrotask(*microtask);
}

void Isolate::EnqueueMicrotask(MicrotaskCallback microtask, void* data) {
// CHAKRA-TODO: Current microTask implementation only support queueing
// javascript functions. Need to add support to queue native functions
Expand Down

0 comments on commit d168295

Please sign in to comment.