From a675c3d3b79c6c30e494c2c90954bab3fde1ae83 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Wed, 12 Jul 2017 21:11:32 +0300 Subject: [PATCH] util: remove redundant declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This module is already required in the top scope (Line 3). PR-URL: https://github.com/nodejs/node/pull/14199 Reviewed-By: Rich Trott Reviewed-By: Refael Ackermann Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Timothy Gu Reviewed-By: James M Snell --- lib/internal/util.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/util.js b/lib/internal/util.js index a77089b6833cd1..091706d4fdb289 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -202,10 +202,8 @@ const kCustomPromisifiedSymbol = Symbol('util.promisify.custom'); const kCustomPromisifyArgsSymbol = Symbol('customPromisifyArgs'); function promisify(orig) { - if (typeof orig !== 'function') { - const errors = require('internal/errors'); + if (typeof orig !== 'function') throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'function'); - } if (orig[kCustomPromisifiedSymbol]) { const fn = orig[kCustomPromisifiedSymbol];