Skip to content

Commit c6f968d

Browse files
committed
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: #28318 Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 7edd5f3 commit c6f968d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/internal/crypto/keygen.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function generateKeyPair(type, options, callback) {
6060
callback.call(wrap, null, pubkey, privkey);
6161
};
6262

63-
handleError(impl, wrap);
63+
handleError(impl(wrap));
6464
}
6565

6666
Object.defineProperty(generateKeyPair, customPromisifyArgs, {
@@ -70,11 +70,10 @@ Object.defineProperty(generateKeyPair, customPromisifyArgs, {
7070

7171
function generateKeyPairSync(type, options) {
7272
const impl = check(type, options);
73-
return handleError(impl);
73+
return handleError(impl());
7474
}
7575

76-
function handleError(impl, wrap) {
77-
const ret = impl(wrap);
76+
function handleError(ret) {
7877
if (ret === undefined)
7978
return; // async
8079

0 commit comments

Comments
 (0)