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>
This commit is contained in:
parent
7edd5f3bdd
commit
c6f968de71
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user