From b9a16e97e01e054206d9079bd852f6e21be631a4 Mon Sep 17 00:00:00 2001 From: Livia Medeiros Date: Mon, 12 May 2025 16:02:23 +0900 Subject: [PATCH] buffer: give names to `Buffer.prototype.*Write()` functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/58258 Reviewed-By: Antoine du Hamel Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Jordan Harband Reviewed-By: Darshan Sen Reviewed-By: James M Snell Reviewed-By: Ulises Gascón --- lib/internal/buffer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/buffer.js b/lib/internal/buffer.js index 20b22ad5293..372f20c7bb2 100644 --- a/lib/internal/buffer.js +++ b/lib/internal/buffer.js @@ -1036,7 +1036,7 @@ function addBufferPrototypeMethods(proto) { proto.hexSlice = hexSlice; proto.ucs2Slice = ucs2Slice; proto.utf8Slice = utf8Slice; - proto.asciiWrite = function(string, offset = 0, length = this.byteLength) { + proto.asciiWrite = function asciiWrite(string, offset = 0, length = this.byteLength) { if (offset < 0 || offset > this.byteLength) { throw new ERR_BUFFER_OUT_OF_BOUNDS('offset'); } @@ -1047,7 +1047,7 @@ function addBufferPrototypeMethods(proto) { }; proto.base64Write = base64Write; proto.base64urlWrite = base64urlWrite; - proto.latin1Write = function(string, offset = 0, length = this.byteLength) { + proto.latin1Write = function latin1Write(string, offset = 0, length = this.byteLength) { if (offset < 0 || offset > this.byteLength) { throw new ERR_BUFFER_OUT_OF_BOUNDS('offset'); } @@ -1058,7 +1058,7 @@ function addBufferPrototypeMethods(proto) { }; proto.hexWrite = hexWrite; proto.ucs2Write = ucs2Write; - proto.utf8Write = function(string, offset = 0, length = this.byteLength) { + proto.utf8Write = function utf8Write(string, offset = 0, length = this.byteLength) { if (offset < 0 || offset > this.byteLength) { throw new ERR_BUFFER_OUT_OF_BOUNDS('offset'); }