summaryrefslogtreecommitdiff
path: root/src/timer_wrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/timer_wrap.cc')
-rw-r--r--src/timer_wrap.cc20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc
index 88377a3e1b..1a5a22c25e 100644
--- a/src/timer_wrap.cc
+++ b/src/timer_wrap.cc
@@ -62,7 +62,6 @@ class TimerWrap : public HandleWrap {
env->SetProtoMethod(constructor, "hasRef", HandleWrap::HasRef);
env->SetProtoMethod(constructor, "start", Start);
- env->SetProtoMethod(constructor, "stop", Stop);
target->Set(timerString, constructor->GetFunction());
@@ -125,32 +124,17 @@ class TimerWrap : public HandleWrap {
args.GetReturnValue().Set(err);
}
- static void Stop(const FunctionCallbackInfo<Value>& args) {
- TimerWrap* wrap;
- ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
-
- CHECK(HandleWrap::IsAlive(wrap));
-
- int err = uv_timer_stop(&wrap->handle_);
- args.GetReturnValue().Set(err);
- }
-
static void OnTimeout(uv_timer_t* handle) {
TimerWrap* wrap = static_cast<TimerWrap*>(handle->data);
Environment* env = wrap->env();
HandleScope handle_scope(env->isolate());
Context::Scope context_scope(env->context());
Local<Value> ret;
- Local<Value> args[1];
+ Local<Value> args[] = { env->GetNow() };
do {
- args[0] = env->GetNow();
ret = wrap->MakeCallback(env->timers_callback_function(), 1, args)
.ToLocalChecked();
- } while (ret->IsUndefined() &&
- !env->tick_info()->has_thrown() &&
- wrap->object()->Get(env->context(),
- env->owner_string()).ToLocalChecked()
- ->IsUndefined());
+ } while (ret->IsUndefined() && !env->tick_info()->has_thrown());
}
static void Now(const FunctionCallbackInfo<Value>& args) {