Skip to content

Commit 2fc1abf

Browse files
targosaduh95
authored andcommitted
benchmark: use non-deprecated WriteUtf8V2 method
PR-URL: #60173 Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent cfc45d1 commit 2fc1abf

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)