timers: reposition getTimers definition internally

Just cleanup so the file makes more future sense.

PR-URL: https://github.com/nodejs/node/pull/18065
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This commit is contained in:
Jeremiah Senkpiel committed 2018-01-26 16:47:16 -05:00
1 parent a5a811811d
commit 54fe0a6cbb
1 file changed
+8 -7
+8 -7
View File
@@ -29,6 +29,14 @@ module.exports = {
validateTimerDuration
};
var timers;
function getTimers() {
if (timers === undefined) {
timers = require('timers');
}
return timers;
}
// Timer constructor function.
// The entire prototype is defined in lib/timers.js
function Timeout(callback, after, args, isRepeat) {
@@ -66,13 +74,6 @@ function Timeout(callback, after, args, isRepeat) {
}
}
var timers;
function getTimers() {
if (timers === undefined) {
timers = require('timers');
}
return timers;
}
function setUnrefTimeout(callback, after, arg1, arg2, arg3) {
// Type checking identical to setTimeout()