From 8b5ada4b310b925dfbf61ca9a5a5d65b3906fff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Sat, 17 May 2025 15:21:31 +0100 Subject: [PATCH] buffer: use Utf8LengthV2() instead of Utf8Length() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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 Reviewed-By: Colin Ihrig Reviewed-By: Yagiz Nizipli Reviewed-By: James M Snell --- src/node_buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index f6329856e6e..1303cb57f0b 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -742,7 +742,7 @@ uint32_t FastByteLengthUtf8( Local sourceStr = sourceValue.As(); 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