diff options
author | Darshan Sen <raisinten@gmail.com> | 2022-03-09 01:40:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-09 01:40:28 +0300 |
commit | 6b004f1bb14a1f06066a087f1e1c12c577dc7568 (patch) | |
tree | 89be9adc798fc087fd6325f224a468fd5ec5c320 /src/crypto/crypto_ec.h | |
parent | 4d70dc7dc26ef365602452c9a6be3f63dfec5eba (diff) |
src,crypto: avoid tristate Maybe<bool> in ExportJWKEcKey()
The function currently uses the return value to convey whether an
exception was thrown while it was running by using either Just(true) or
Nothing<bool>(). Unfortunately, Maybe<bool> also has a third state -
Just(false), which doesn't make any sense here. So this change avoids
the possibility of a tristate return value by making use of Maybe<void>
which only has two valid states - JustVoid() / Nothing<void>(), which
fits right in.
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/42223
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/crypto/crypto_ec.h')
-rw-r--r-- | src/crypto/crypto_ec.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crypto/crypto_ec.h b/src/crypto/crypto_ec.h index 34d37c7e442..bc4160fc8be 100644 --- a/src/crypto/crypto_ec.h +++ b/src/crypto/crypto_ec.h @@ -144,7 +144,7 @@ struct ECKeyExportTraits final { using ECKeyExportJob = KeyExportJob<ECKeyExportTraits>; -v8::Maybe<bool> ExportJWKEcKey( +v8::Maybe<void> ExportJWKEcKey( Environment* env, std::shared_ptr<KeyObjectData> key, v8::Local<v8::Object> target); |