Unverified Commit cca03720 authored by Denys Otrishko's avatar Denys Otrishko Committed by Myles Borins
Browse files

timers: allow timers to be used as primitives



This allows timers to be matched to numeric Ids and therefore used
as keys of an Object, passed and stored without storing the Timer instance.

clearTimeout/clearInterval is modified to support numeric/string Ids.

Co-authored-by: default avatarBradley Farias <bradley.meck@gmail.com>
Co-authored-by: default avatarAnatoli Papirovski <apapirovski@mac.com>

Refs: https://github.com/nodejs/node/pull/21152

Backport-PR-URL: https://github.com/nodejs/node/pull/34482
PR-URL: https://github.com/nodejs/node/pull/34017
Backport-PR-URL: https://github.com/nodejs/node/pull/34482


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarBradley Farias <bradley.meck@gmail.com>
Reviewed-By: default avatarJeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarTrivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: default avatarYongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: default avatarBenjamin Gruenbaum <benjamingr@gmail.com>
Signed-off-by: default avatarDenys Otrishko <shishugi@gmail.com>
parent b30b5187
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