aboutsummaryrefslogtreecommitdiff
path: root/lib/timers.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-03-20 12:12:48 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2019-03-27 17:05:14 +0100
commit9e8c9be3ff07845320c350fa3b2097cfbdada85e (patch)
tree6318cf01e3b6c8407c6fdce3b35681d09dd8be8c /lib/timers.js
parent6c913fb0287fa7f823fcd0fbe7035bac3c4f75ec (diff)
downloadandroid-node-v8-9e8c9be3ff07845320c350fa3b2097cfbdada85e.tar.gz
android-node-v8-9e8c9be3ff07845320c350fa3b2097cfbdada85e.tar.bz2
android-node-v8-9e8c9be3ff07845320c350fa3b2097cfbdada85e.zip
timers: rename validateTimerDuration to getTimerDuration
The function did not only validate the timer but it caused side effects like a warning and potentially returned a different value than the input value. Thus the name `validate` did not seem to be appropriate. PR-URL: https://github.com/nodejs/node/pull/26809 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/timers.js')
-rw-r--r--lib/timers.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/timers.js b/lib/timers.js
index dff7eb4994..8dc8b8877b 100644
--- a/lib/timers.js
+++ b/lib/timers.js
@@ -36,7 +36,7 @@ const {
},
kRefed,
initAsyncResource,
- validateTimerDuration,
+ getTimerDuration,
timerListMap,
timerListQueue,
immediateQueue,
@@ -102,7 +102,7 @@ function unenroll(item) {
// This function does not start the timer, see `active()`.
// Using existing objects as timers slightly reduces object overhead.
function enroll(item, msecs) {
- msecs = validateTimerDuration(msecs, 'msecs');
+ msecs = getTimerDuration(msecs, 'msecs');
// If this item was already in a list somewhere
// then we should unenroll it from that