Skip to content

Commit 54fe0a6

Browse files
committed
timers: reposition getTimers definition internally
Just cleanup so the file makes more future sense. PR-URL: #18065 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
1 parent a5a8118 commit 54fe0a6

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/internal/timers.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ module.exports = {
2929
validateTimerDuration
3030
};
3131

32+
var timers;
33+
function getTimers() {
34+
if (timers === undefined) {
35+
timers = require('timers');
36+
}
37+
return timers;
38+
}
39+
3240
// Timer constructor function.
3341
// The entire prototype is defined in lib/timers.js
3442
function Timeout(callback, after, args, isRepeat) {
@@ -66,13 +74,6 @@ function Timeout(callback, after, args, isRepeat) {
6674
}
6775
}
6876

69-
var timers;
70-
function getTimers() {
71-
if (timers === undefined) {
72-
timers = require('timers');
73-
}
74-
return timers;
75-
}
7677

7778
function setUnrefTimeout(callback, after, arg1, arg2, arg3) {
7879
// Type checking identical to setTimeout()

0 commit comments

Comments
 (0)