Skip to content

Commit 694ac6d

Browse files
addaleaxapapirovski
authored andcommitted
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: #20884 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent c1012b4 commit 694ac6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/timer_wrap.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ class TimerWrap : public HandleWrap {
134134
do {
135135
ret = wrap->MakeCallback(env->timers_callback_function(), 1, args)
136136
.ToLocalChecked();
137-
} while (ret->IsUndefined() && !env->tick_info()->has_thrown());
137+
} while (ret->IsUndefined() &&
138+
!env->tick_info()->has_thrown() &&
139+
env->can_call_into_js());
138140
}
139141

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

0 commit comments

Comments
 (0)