diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-03 15:00:24 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-06 15:57:55 +0300 |
commit | d80e49d6801501a0f2b93c442d5e425ed6fc73fb (patch) | |
tree | 959211f188647dab675a4980a2c0f65b9a37a34f /src/node_task_queue.cc | |
parent | 369803175307dae7fd6b983d9270619f11bd7214 (diff) |
src: use callback scope for main script
This allows removing custom code for setting the current async ids
and running nextTicks.
PR-URL: https://github.com/nodejs/node/pull/30236
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_task_queue.cc')
-rw-r--r-- | src/node_task_queue.cc | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/node_task_queue.cc b/src/node_task_queue.cc index ef1aff6cd41..f418a272470 100644 --- a/src/node_task_queue.cc +++ b/src/node_task_queue.cc @@ -41,22 +41,6 @@ static void EnqueueMicrotask(const FunctionCallbackInfo<Value>& args) { isolate->EnqueueMicrotask(args[0].As<Function>()); } -// Should be in sync with runNextTicks in internal/process/task_queues.js -bool RunNextTicksNative(Environment* env) { - OnScopeLeave weakref_cleanup([&]() { env->RunWeakRefCleanup(); }); - - TickInfo* tick_info = env->tick_info(); - if (!tick_info->has_tick_scheduled() && !tick_info->has_rejection_to_warn()) - MicrotasksScope::PerformCheckpoint(env->isolate()); - if (!tick_info->has_tick_scheduled() && !tick_info->has_rejection_to_warn()) - return true; - - Local<Function> callback = env->tick_callback_function(); - CHECK(!callback.IsEmpty()); - return !callback->Call(env->context(), env->process_object(), 0, nullptr) - .IsEmpty(); -} - static void RunMicrotasks(const FunctionCallbackInfo<Value>& args) { MicrotasksScope::PerformCheckpoint(args.GetIsolate()); } |