Skip to content

Commit 91d2400

Browse files
buffer: give names to Buffer.prototype.*Write() functions
PR-URL: #58258 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jordan Harband <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ulises Gascón <[email protected]>
1 parent 5b134db commit 91d2400

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/buffer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ function addBufferPrototypeMethods(proto) {
10431043
proto.hexSlice = hexSlice;
10441044
proto.ucs2Slice = ucs2Slice;
10451045
proto.utf8Slice = utf8Slice;
1046-
proto.asciiWrite = function(string, offset = 0, length = this.byteLength - offset) {
1046+
proto.asciiWrite = function asciiWrite(string, offset = 0, length = this.byteLength - offset) {
10471047
if (offset < 0 || offset > this.byteLength) {
10481048
throw new ERR_BUFFER_OUT_OF_BOUNDS('offset');
10491049
}
@@ -1054,7 +1054,7 @@ function addBufferPrototypeMethods(proto) {
10541054
};
10551055
proto.base64Write = base64Write;
10561056
proto.base64urlWrite = base64urlWrite;
1057-
proto.latin1Write = function(string, offset = 0, length = this.byteLength - offset) {
1057+
proto.latin1Write = function latin1Write(string, offset = 0, length = this.byteLength - offset) {
10581058
if (offset < 0 || offset > this.byteLength) {
10591059
throw new ERR_BUFFER_OUT_OF_BOUNDS('offset');
10601060
}
@@ -1065,7 +1065,7 @@ function addBufferPrototypeMethods(proto) {
10651065
};
10661066
proto.hexWrite = hexWrite;
10671067
proto.ucs2Write = ucs2Write;
1068-
proto.utf8Write = function(string, offset = 0, length = this.byteLength - offset) {
1068+
proto.utf8Write = function utf8Write(string, offset = 0, length = this.byteLength - offset) {
10691069
if (offset < 0 || offset > this.byteLength) {
10701070
throw new ERR_BUFFER_OUT_OF_BOUNDS('offset');
10711071
}

0 commit comments

Comments
 (0)