Skip to content

Commit

Permalink
conversion error in UTF-8 string creation
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcanaltin committed Feb 12, 2025
1 parent 05c573f commit 17eb1d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/node_process_events.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ using v8::Value;
Maybe<bool> ProcessEmitWarningSync(Environment* env, std::string_view message) {
Isolate* isolate = env->isolate();
Local<Context> context = env->context();
Local<String> message_string = OneByteString(isolate, message);
v8::Local<v8::String> message_string =
v8::String::NewFromUtf8(isolate,
message.data(),
v8::NewStringType::kNormal,
static_cast<int>(message.size()))
.ToLocalChecked();

Local<Value> argv[] = {message_string};
Local<Function> emit_function = env->process_emit_warning_sync();
Expand Down

0 comments on commit 17eb1d4

Please sign in to comment.