Skip to content

Commit 520aee8

Browse files
committed
benchmark: use non-deprecated WriteUtf8V2 method
1 parent f8a43f6 commit 520aee8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

benchmark/napi/function_args/binding.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ void CallWithString(const FunctionCallbackInfo<Value>& args) {
2323
Local<String> str = args[0].As<String>();
2424
const size_t length = str->Utf8LengthV2(args.GetIsolate()) + 1;
2525
char* buf = new char[length];
26-
str->WriteUtf8(args.GetIsolate(), buf, length);
26+
str->WriteUtf8V2(
27+
args.GetIsolate(), buf, length, String::WriteFlags::kNullTerminate);
2728
delete[] buf;
2829
}
2930
}

0 commit comments

Comments
 (0)