mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
benchmark: use non-deprecated WriteUtf8V2 method
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
@@ -23,7 +23,8 @@ void CallWithString(const FunctionCallbackInfo<Value>& args) {
|
||||
Local<String> str = args[0].As<String>();
|
||||
const size_t length = str->Utf8LengthV2(args.GetIsolate()) + 1;
|
||||
char* buf = new char[length];
|
||||
str->WriteUtf8(args.GetIsolate(), buf, length);
|
||||
str->WriteUtf8V2(
|
||||
args.GetIsolate(), buf, length, String::WriteFlags::kNullTerminate);
|
||||
delete[] buf;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user