Handle v8::MicrotasksScope in the main process
This commit is contained in:
parent
5826a8f9a9
commit
ee28f4fc32
7 changed files with 27 additions and 25 deletions
|
@ -16,11 +16,8 @@ v8::Local<v8::Value> CallEmitWithArgs(v8::Isolate* isolate,
|
|||
v8::Local<v8::Object> obj,
|
||||
ValueVector* args) {
|
||||
// Perform microtask checkpoint after running JavaScript.
|
||||
std::unique_ptr<v8::MicrotasksScope> script_scope(
|
||||
Locker::IsBrowserProcess() ?
|
||||
nullptr :
|
||||
new v8::MicrotasksScope(isolate,
|
||||
v8::MicrotasksScope::kRunMicrotasks));
|
||||
v8::MicrotasksScope script_scope(
|
||||
isolate, v8::MicrotasksScope::kRunMicrotasks);
|
||||
// Use node::MakeCallback to call the callback, and it will also run pending
|
||||
// tasks in Node.js.
|
||||
return node::MakeCallback(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue