Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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.
  • Loading branch information
danbev committed Jun 20, 2019
commit 247df3ce021c8e8f89e9005bef7b458ae353bb4c
7 changes: 3 additions & 4 deletions lib/internal/crypto/keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand All @@ -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

Expand Down