src: break out of timers loop if !can_call_into_js()
Otherwise, this turns into an infinite loop when the flag is set, because it makes `MakeCallback()` return immediately. PR-URL: https://github.com/nodejs/node/pull/20884 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
parent
c1012b4402
commit
694ac6de5b
@ -134,7 +134,9 @@ class TimerWrap : public HandleWrap {
|
|||||||
do {
|
do {
|
||||||
ret = wrap->MakeCallback(env->timers_callback_function(), 1, args)
|
ret = wrap->MakeCallback(env->timers_callback_function(), 1, args)
|
||||||
.ToLocalChecked();
|
.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) {
|
static void Now(const FunctionCallbackInfo<Value>& args) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user