Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit81cd84c

Browse files
tniessenmarco-ippolito
authored andcommitted
src: use Maybe<void> in node::crypto::error
With recent versions of V8, it is not necessary to use Maybe<bool>anymore.PR-URL:#53766Reviewed-By: Michaël Zasso <targos@protonmail.com>Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent9804731 commit81cd84c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

‎src/crypto/crypto_util.cc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ using v8::Exception;
2929
using v8::FunctionCallbackInfo;
3030
using v8::HandleScope;
3131
using v8::Isolate;
32-
using v8::Just;
32+
using v8::JustVoid;
3333
using v8::Local;
3434
using v8::Maybe;
3535
using v8::MaybeLocal;
@@ -457,9 +457,10 @@ ByteSource ByteSource::Foreign(const void* data, size_t size) {
457457
}
458458

459459
namespaceerror {
460-
Maybe<bool>Decorate(Environment* env, Local<Object> obj,
461-
unsignedlong err) {// NOLINT(runtime/int)
462-
if (err ==0)returnJust(true);// No decoration necessary.
460+
Maybe<void>Decorate(Environment* env,
461+
Local<Object> obj,
462+
unsignedlong err) {// NOLINT(runtime/int)
463+
if (err ==0)returnJustVoid();// No decoration necessary.
463464

464465
constchar* ls =ERR_lib_error_string(err);
465466
constchar* fs =ERR_func_error_string(err);
@@ -471,19 +472,19 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
471472
if (ls !=nullptr) {
472473
if (obj->Set(context, env->library_string(),
473474
OneByteString(isolate, ls)).IsNothing()) {
474-
return Nothing<bool>();
475+
return Nothing<void>();
475476
}
476477
}
477478
if (fs !=nullptr) {
478479
if (obj->Set(context, env->function_string(),
479480
OneByteString(isolate, fs)).IsNothing()) {
480-
return Nothing<bool>();
481+
return Nothing<void>();
481482
}
482483
}
483484
if (rs !=nullptr) {
484485
if (obj->Set(context, env->reason_string(),
485486
OneByteString(isolate, rs)).IsNothing()) {
486-
return Nothing<bool>();
487+
return Nothing<void>();
487488
}
488489

489490
// SSL has no API to recover the error name from the number, so we
@@ -556,10 +557,10 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
556557
if (obj->Set(env->isolate()->GetCurrentContext(),
557558
env->code_string(),
558559
OneByteString(env->isolate(), code)).IsNothing())
559-
return Nothing<bool>();
560+
return Nothing<void>();
560561
}
561562

562-
returnJust(true);
563+
returnJustVoid();
563564
}
564565
}// namespace error
565566

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp