diff options
Diffstat (limited to 'lib/timers.js')
-rw-r--r-- | lib/timers.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/timers.js b/lib/timers.js index 2744f231b5..32f6ccb00c 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -37,7 +37,7 @@ const internalUtil = require('internal/util'); const { createPromise, promiseResolve } = process.binding('util'); const assert = require('assert'); const util = require('util'); -const errors = require('internal/errors'); +const { ERR_INVALID_CALLBACK } = require('internal/errors').codes; const debug = util.debuglog('timer'); const { destroyHooksExist, @@ -375,7 +375,7 @@ exports.enroll = util.deprecate(enroll, function setTimeout(callback, after, arg1, arg2, arg3) { if (typeof callback !== 'function') { - throw new errors.TypeError('ERR_INVALID_CALLBACK'); + throw new ERR_INVALID_CALLBACK(); } var i, args; @@ -466,7 +466,7 @@ const clearTimeout = exports.clearTimeout = function(timer) { exports.setInterval = function(callback, repeat, arg1, arg2, arg3) { if (typeof callback !== 'function') { - throw new errors.TypeError('ERR_INVALID_CALLBACK'); + throw new ERR_INVALID_CALLBACK(); } var i, args; @@ -739,7 +739,7 @@ const Immediate = class Immediate { function setImmediate(callback, arg1, arg2, arg3) { if (typeof callback !== 'function') { - throw new errors.TypeError('ERR_INVALID_CALLBACK'); + throw new ERR_INVALID_CALLBACK(); } var i, args; |