Skip to content

Commit c01c72b

Browse files
targosaduh95
authored andcommitted
benchmark: use non-deprecated WriteUtf8V2 method
PR-URL: #60173 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 80fdb3d commit c01c72b

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)