src: use Maybe<void> in ProcessEmitWarningSync
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com> PR-URL: https://github.com/nodejs/node/pull/57250 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
5401ac687c
commit
117c1ca9eb
@ -37,7 +37,7 @@ inline v8::Maybe<bool> ProcessEmitWarning(Environment* env,
|
||||
const char* fmt,
|
||||
Args&&... args);
|
||||
|
||||
v8::Maybe<bool> ProcessEmitWarningSync(Environment* env,
|
||||
v8::Maybe<void> ProcessEmitWarningSync(Environment* env,
|
||||
std::string_view message);
|
||||
v8::Maybe<bool> ProcessEmitExperimentalWarning(Environment* env,
|
||||
const std::string& warning);
|
||||
|
@ -10,6 +10,7 @@ using v8::Function;
|
||||
using v8::HandleScope;
|
||||
using v8::Isolate;
|
||||
using v8::Just;
|
||||
using v8::JustVoid;
|
||||
using v8::Local;
|
||||
using v8::Maybe;
|
||||
using v8::MaybeLocal;
|
||||
@ -19,7 +20,7 @@ using v8::Object;
|
||||
using v8::String;
|
||||
using v8::Value;
|
||||
|
||||
Maybe<bool> ProcessEmitWarningSync(Environment* env, std::string_view message) {
|
||||
Maybe<void> ProcessEmitWarningSync(Environment* env, std::string_view message) {
|
||||
Isolate* isolate = env->isolate();
|
||||
Local<Context> context = env->context();
|
||||
Local<String> message_string;
|
||||
@ -28,7 +29,7 @@ Maybe<bool> ProcessEmitWarningSync(Environment* env, std::string_view message) {
|
||||
NewStringType::kNormal,
|
||||
static_cast<int>(message.size()))
|
||||
.ToLocal(&message_string)) {
|
||||
return Nothing<bool>();
|
||||
return Nothing<void>();
|
||||
}
|
||||
|
||||
Local<Value> argv[] = {message_string};
|
||||
@ -39,9 +40,9 @@ Maybe<bool> ProcessEmitWarningSync(Environment* env, std::string_view message) {
|
||||
if (emit_function.As<Function>()
|
||||
->Call(context, v8::Undefined(isolate), arraysize(argv), argv)
|
||||
.IsEmpty()) {
|
||||
return Nothing<bool>();
|
||||
return Nothing<void>();
|
||||
}
|
||||
return Just(true);
|
||||
return JustVoid();
|
||||
}
|
||||
|
||||
MaybeLocal<Value> ProcessEmit(Environment* env,
|
||||
|
Loading…
x
Reference in New Issue
Block a user