diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-02-27 14:55:32 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-03-05 19:51:30 +0100 |
commit | 1e8d110e640c658e4f6ed7540db62d063269ba6c (patch) | |
tree | afe2636b1b190fee00006beaa484fa77d5949770 /lib/timers.js | |
parent | 023f49c5a938ef631260b76876155eaf957084be (diff) | |
download | android-node-v8-1e8d110e640c658e4f6ed7540db62d063269ba6c.tar.gz android-node-v8-1e8d110e640c658e4f6ed7540db62d063269ba6c.tar.bz2 android-node-v8-1e8d110e640c658e4f6ed7540db62d063269ba6c.zip |
lib: port errors to new system
This is a first batch of updates that touches non-underscored modules in
lib.
PR-URL: https://github.com/nodejs/node/pull/19034
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
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; |