Skip to content

Commit 8204b0f

Browse files
committed
timers: simplify clearTimeout & clearInterval
Remove unnecessary condition from timeout & interval clearing. PR-URL: #18579 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent c11cb03 commit 8204b0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/timers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ function rearm(timer, start = TimerWrap.now()) {
465465

466466

467467
const clearTimeout = exports.clearTimeout = function(timer) {
468-
if (timer && (timer[kOnTimeout] || timer._onTimeout)) {
469-
timer[kOnTimeout] = timer._onTimeout = null;
468+
if (timer && timer._onTimeout) {
469+
timer._onTimeout = null;
470470
if (timer instanceof Timeout) {
471471
timer.close(); // for after === 0
472472
} else {

0 commit comments

Comments
 (0)