summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2019-06-20 08:09:17 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-06-24 05:36:59 +0200
commitc6f968de718fc32b6eb4d48329b8191d863c4462 (patch)
treebea1c058251571b5826cd9f0d4b50daa9267538a /lib
parent7edd5f3bdd2faaf9072a6456dfed6207c41cce6a (diff)
downloadandroid-node-v8-c6f968de718fc32b6eb4d48329b8191d863c4462.tar.gz
android-node-v8-c6f968de718fc32b6eb4d48329b8191d863c4462.tar.bz2
android-node-v8-c6f968de718fc32b6eb4d48329b8191d863c4462.zip
crypto: move _impl call out of handleError funct
This commit moves the _impl function call out of the handleError function, which now only takes in an object as its parameter. PR-URL: https://github.com/nodejs/node/pull/28318 Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/crypto/keygen.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/internal/crypto/keygen.js b/lib/internal/crypto/keygen.js
index f646f436f7..0a4bde77fa 100644
--- a/lib/internal/crypto/keygen.js
+++ b/lib/internal/crypto/keygen.js
@@ -60,7 +60,7 @@ function generateKeyPair(type, options, callback) {
callback.call(wrap, null, pubkey, privkey);
};
- handleError(impl, wrap);
+ handleError(impl(wrap));
}
Object.defineProperty(generateKeyPair, customPromisifyArgs, {
@@ -70,11 +70,10 @@ Object.defineProperty(generateKeyPair, customPromisifyArgs, {
function generateKeyPairSync(type, options) {
const impl = check(type, options);
- return handleError(impl);
+ return handleError(impl());
}
-function handleError(impl, wrap) {
- const ret = impl(wrap);
+function handleError(ret) {
if (ret === undefined)
return; // async