From cff85fd948eb13e3f46fea13b66db095ffeb1103 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Mon, 15 Jul 2024 14:10:24 -0700 Subject: [PATCH] Run generateKeyPair on next tick --- src/js/node/crypto.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/node/crypto.ts b/src/js/node/crypto.ts index 8a38faef89..cb3909945a 100644 --- a/src/js/node/crypto.ts +++ b/src/js/node/crypto.ts @@ -11938,9 +11938,9 @@ crypto_exports.generateKeyPairSync = _generateKeyPairSync; crypto_exports.generateKeyPair = function (algorithm, options, callback) { try { const result = _generateKeyPairSync(algorithm, options); - typeof callback === "function" && callback(null, result.publicKey, result.privateKey); + typeof callback === "function" && process.nextTick(callback, null, result.publicKey, result.privateKey); } catch (err) { - typeof callback === "function" && callback(err); + typeof callback === "function" && process.nextTick(callback, err); } };