Commit ac6ba6b6 authored by Rich Trott's avatar Rich Trott
Browse files

crypto: simplify KeyObject constructor

Inline a function that only gets called in the constructor. Make call to
`super()` more straightforward in the process by removing conditional
involving the function as it only ever returns `undefined` or else
throws. That made the code a little hard to understand, as without
looking at the function, one would likely expect it to return `true`
on success rather than `undefined`.

PR-URL: https://github.com/nodejs/node/pull/35064


Reviewed-By: default avatarTobias Nießen <tniessen@tnie.de>
Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
Reviewed-By: default avatarDenys Otrishko <shishugi@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
parent cb2b82bd
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment