Skip to content

Commit 29355d6

Browse files
committed
src: use String::NewFromUtf8 in ProcessEmitWarningGeneric
1 parent d9add75 commit 29355d6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/node_process_events.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,12 @@ Maybe<bool> ProcessEmitWarningGeneric(Environment* env,
5656
return Nothing<bool>();
5757
}
5858
if (type != nullptr) {
59-
if (!String::NewFromOneByte(env->isolate(),
60-
reinterpret_cast<const uint8_t*>(type),
61-
NewStringType::kNormal)
62-
.ToLocal(&args[argc++])) {
59+
if (!String::NewFromUtf8(env->isolate(), type, NewStringType::kNormal)
60+
.ToLocal(&args[argc++])) {
6361
return Nothing<bool>();
6462
}
6563
if (code != nullptr &&
66-
!String::NewFromOneByte(env->isolate(),
67-
reinterpret_cast<const uint8_t*>(code),
68-
NewStringType::kNormal)
64+
!String::NewFromUtf8(env->isolate(), code, NewStringType::kNormal)
6965
.ToLocal(&args[argc++])) {
7066
return Nothing<bool>();
7167
}

0 commit comments

Comments
 (0)