Skip to content

Commit

Permalink
src: break out of timers loop if !can_call_into_js()
Browse files Browse the repository at this point in the history
Otherwise, this turns into an infinite loop when the flag
is set, because it makes `MakeCallback()` return immediately.
  • Loading branch information
addaleax committed May 22, 2018
1 parent 23a56e0 commit 5f84afe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/timer_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ class TimerWrap : public HandleWrap {
do {
ret = wrap->MakeCallback(env->timers_callback_function(), 1, args)
.ToLocalChecked();
} while (ret->IsUndefined() && !env->tick_info()->has_thrown());
} while (ret->IsUndefined() &&
!env->tick_info()->has_thrown() &&
env->can_call_into_js());
}

static void Now(const FunctionCallbackInfo<Value>& args) {
Expand Down

0 comments on commit 5f84afe

Please sign in to comment.