Commit 12bad698 authored by Rémi Berson's avatar Rémi Berson Committed by James M Snell
Browse files

timers: fix clearInterval to work with timers from setTimeout

According to HTML Living Standard, "either method [clearInterval or
clearTimeout] can be used to clear timers created by setTimeout() or
setInterval().".

The current implementation of clearTimeout is already able to destroy a
timer created by setInterval, but not the other way around.

PR-URL: https://github.com/nodejs/node/pull/19952
Refs: https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval


Reviewed-By: default avatarAnatoli Papirovski <apapirovski@mac.com>
Reviewed-By: default avatarRuben Bridgewater <ruben@bridgewater.de>
Reviewed-By: default avatarJeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: default avatarTiancheng "Timothy" Gu <timothygu99@gmail.com>
parent aa5ae9e9
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment