Skip to content

Commit

Permalink
Fix iojs 1.6.3+
Browse files Browse the repository at this point in the history
Timer functions are now mounted directly on global as of iojs 1.6.3
See: nodejs/node#1280
  • Loading branch information
Qard committed Apr 7, 2015
1 parent 3f5dd46 commit 9310a00
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,23 @@ var asynchronizers = [
];
if (global.setImmediate) asynchronizers.push('setImmediate');

var timers = require('timers');
var patchGlobalTimers = global.setTimeout === timers.setTimeout;

massWrap(
require('timers'),
timers,
asynchronizers,
activatorFirst
);

if (patchGlobalTimers) {
massWrap(
global,
asynchronizers,
activatorFirst
);
}

var dns = require('dns');
massWrap(
dns,
Expand Down

0 comments on commit 9310a00

Please sign in to comment.