buffer: use Utf8LengthV2() instead of Utf8Length()

`Utf8Length()` is deprecated and was replaced during the V8 update, but
a subsequent commit introduced a new occurrence.

Refs: https://github.com/nodejs/node/pull/58070
Refs: https://github.com/nodejs/node/pull/58048
PR-URL: https://github.com/nodejs/node/pull/58156
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Tobias Nießen authored and Michaël Zasso committed 2025-05-31 13:23:21 +02:00
1 parent 23416cce0a
commit 8b5ada4b31
1 file changed
+1 -1
+1 -1
View File
@@ -742,7 +742,7 @@ uint32_t FastByteLengthUtf8(
Local<String> sourceStr = sourceValue.As<String>();
if (!sourceStr->IsExternalOneByte()) {
return sourceStr->Utf8Length(isolate);
return sourceStr->Utf8LengthV2(isolate);
}
auto source = sourceStr->GetExternalOneByteStringResource();
// For short inputs, the function call overhead to simdutf is maybe