From 958df926be605888553380ac680be8d173dd8a7b Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Sat, 10 May 2025 14:49:59 +0800 Subject: [PATCH] buffer: give names to `Buffer.prototype.*Write()` functions --- 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 9707af66dff860..2d249ccdda5ae4 100644 --- a/lib/internal/buffer.js +++ b/lib/internal/buffer.js @@ -1043,7 +1043,7 @@ function addBufferPrototypeMethods(proto) { proto.hexSlice = hexSlice; proto.ucs2Slice = ucs2Slice; proto.utf8Slice = utf8Slice; - proto.asciiWrite = function(string, offset = 0, length = this.byteLength - offset) { + proto.asciiWrite = function asciiWrite(string, offset = 0, length = this.byteLength - offset) { if (offset < 0 || offset > this.byteLength) { throw new ERR_BUFFER_OUT_OF_BOUNDS('offset'); } @@ -1054,7 +1054,7 @@ function addBufferPrototypeMethods(proto) { }; proto.base64Write = base64Write; proto.base64urlWrite = base64urlWrite; - proto.latin1Write = function(string, offset = 0, length = this.byteLength - offset) { + proto.latin1Write = function latin1Write(string, offset = 0, length = this.byteLength - offset) { if (offset < 0 || offset > this.byteLength) { throw new ERR_BUFFER_OUT_OF_BOUNDS('offset'); } @@ -1065,7 +1065,7 @@ function addBufferPrototypeMethods(proto) { }; proto.hexWrite = hexWrite; proto.ucs2Write = ucs2Write; - proto.utf8Write = function(string, offset = 0, length = this.byteLength - offset) { + proto.utf8Write = function utf8Write(string, offset = 0, length = this.byteLength - offset) { if (offset < 0 || offset > this.byteLength) { throw new ERR_BUFFER_OUT_OF_BOUNDS('offset'); }