Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-05-18 17:59:37 +0300
committerAnatoli Papirovski <apapirovski@mac.com>2018-05-31 12:53:30 +0300
commit694ac6de5ba2591c8d3d56017b2423bd3e39f769 (patch)
tree169ce1c5aa7103fd9434d46e02e1de0d25925130 /src/timer_wrap.cc
parentc1012b440203b2ab42b350b0300eb3bc8ec36381 (diff)
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>
Diffstat (limited to 'src/timer_wrap.cc')
-rw-r--r--src/timer_wrap.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc
index 1a5a22c25ee..b87430dad8a 100644
--- a/src/timer_wrap.cc
+++ b/src/timer_wrap.cc
@@ -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) {