Skip to content

Commit

Permalink
timers: reposition getTimers definition internally
Browse files Browse the repository at this point in the history
Just cleanup so the file makes more future sense.

PR-URL: #18065
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
  • Loading branch information
Fishrock123 committed Jan 26, 2018
1 parent a5a8118 commit 54fe0a6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/internal/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 54fe0a6

Please sign in to comment.