Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
timers: reposition getTimers definition internally
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
commit 587c6a5b601aef5c94c68a3e04303d3ec950ab89
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