timers.js 997 B

123456789101112131415
  1. var timers = require("timers");
  2. var promisify = require("./_promisify.js");
  3. var bind = function(c, f) { return f && f.bind(c); };
  4. Object.defineProperties(module.exports, {
  5. //_unrefActive: // skipping
  6. active: { enumerable: true, value: bind(timers, timers.active) },
  7. clearImmediate: { enumerable: true, value: bind(timers, timers.clearImmediate) },
  8. clearInterval: { enumerable: true, value: bind(timers, timers.clearInterval) },
  9. clearTimeout: { enumerable: true, value: bind(timers, timers.clearTimeout) },
  10. enroll: { enumerable: true, value: bind(timers, timers.enroll) },
  11. setImmediate: { enumerable: true, value: promisify(timers, timers.setImmediate, 0, {"noError":true,"callbackIsFirstArg":true}) },
  12. setInterval: { enumerable: true, value: bind(timers, timers.setInterval) },
  13. setTimeout: { enumerable: true, value: promisify(timers, timers.setTimeout, 0, {"noError":true,"callbackIsFirstArg":true}) },
  14. unenroll: { enumerable: true, value: bind(timers, timers.unenroll) },
  15. });