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.

Backport-PR-URL: #21168
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]>
  • Loading branch information
addaleax authored and MylesBorins committed Jun 6, 2018
1 parent 2c671ab commit afc811c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/timer_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit afc811c

Please sign in to comment.