From 9e8c9be3ff07845320c350fa3b2097cfbdada85e Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Wed, 20 Mar 2019 12:12:48 +0100 Subject: 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 Reviewed-By: James M Snell --- lib/internal/timers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/internal/timers.js') diff --git a/lib/internal/timers.js b/lib/internal/timers.js index c8d8e5a6c3..d485c3ff65 100644 --- a/lib/internal/timers.js +++ b/lib/internal/timers.js @@ -359,7 +359,7 @@ function setUnrefTimeout(callback, after) { } // Type checking used by timers.enroll() and Socket#setTimeout() -function validateTimerDuration(msecs, name) { +function getTimerDuration(msecs, name) { validateNumber(msecs, name); if (msecs < 0 || !isFinite(msecs)) { throw new ERR_OUT_OF_RANGE(name, 'a non-negative finite number', msecs); @@ -586,7 +586,7 @@ module.exports = { kRefed, initAsyncResource, setUnrefTimeout, - validateTimerDuration, + getTimerDuration, immediateQueue, getTimerCallbacks, immediateInfoFields: { -- cgit v1.2.3