summaryrefslogtreecommitdiff
path: root/src/node_task_queue.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-11-03 13:00:24 +0100
committerAnna Henningsen <anna@addaleax.net>2019-11-06 13:57:55 +0100
commitd80e49d6801501a0f2b93c442d5e425ed6fc73fb (patch)
tree959211f188647dab675a4980a2c0f65b9a37a34f /src/node_task_queue.cc
parent369803175307dae7fd6b983d9270619f11bd7214 (diff)
downloadandroid-node-v8-d80e49d6801501a0f2b93c442d5e425ed6fc73fb.tar.gz
android-node-v8-d80e49d6801501a0f2b93c442d5e425ed6fc73fb.tar.bz2
android-node-v8-d80e49d6801501a0f2b93c442d5e425ed6fc73fb.zip
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.cc16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/node_task_queue.cc b/src/node_task_queue.cc
index ef1aff6cd4..f418a27247 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());
}