From afc811cc1cc166cad28e2516a4f7862a2e3202fe Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 18 May 2018 16:59:37 +0200 Subject: [PATCH] src: break out of timers loop if `!can_call_into_js()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, this turns into an infinite loop when the flag is set, because it makes `MakeCallback()` return immediately. Backport-PR-URL: https://github.com/nodejs/node/pull/21168 PR-URL: https://github.com/nodejs/node/pull/20884 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Anatoli Papirovski Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- src/timer_wrap.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index 88377a3e1b88cc..50541acc9b8a0d 100644 --- a/src/timer_wrap.cc +++ b/src/timer_wrap.cc @@ -148,6 +148,7 @@ class TimerWrap : public HandleWrap { .ToLocalChecked(); } while (ret->IsUndefined() && !env->tick_info()->has_thrown() && + env->can_call_into_js() && wrap->object()->Get(env->context(), env->owner_string()).ToLocalChecked() ->IsUndefined());