Skip to content

Commit 7107405

Browse files
committed
crypto: remove unneeded guard committed
createCFRGRaw() will always return an object. The error for an undefined return value will never occur.
1 parent b014266 commit 7107405

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/internal/crypto/cfrg.js

-2
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,6 @@ async function cfrgImportKey(
291291
case 'raw': {
292292
verifyAcceptableCfrgKeyUse(name, 'public', usagesSet);
293293
keyObject = createCFRGRawKey(name, keyData, true);
294-
if (keyObject === undefined)
295-
throw lazyDOMException('Unable to import CFRG key', 'OperationError');
296294
break;
297295
}
298296
}

lib/internal/crypto/keys.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ for (const m of [[kKeyEncodingPKCS1, 'pkcs1'], [kKeyEncodingPKCS8, 'pkcs8'],
8585
encodingNames[m[0]] = m[1];
8686

8787
// Creating the KeyObject class is a little complicated due to inheritance
88-
// and that fact that KeyObjects should be transferrable between threads,
88+
// and the fact that KeyObjects should be transferrable between threads,
8989
// which requires the KeyObject base class to be implemented in C++.
9090
// The creation requires a callback to make sure that the NativeKeyObject
9191
// base class cannot exist without the other KeyObject implementations.

0 commit comments

Comments
 (0)