Skip to content

Commit 12fe2d3

Browse files
vsemozhetbytMylesBorins
authored andcommitted
doc: add a note to buf.fill() description
PR-URL: #25547 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6b6c628 commit 12fe2d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: doc/api/buffer.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,9 @@ console.log(b.toString());
12351235
// Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
12361236
```
12371237

1238-
`value` is coerced to a `uint32` value if it is not a string or integer.
1238+
`value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
1239+
integer. If the resulting integer is greater than `255` (decimal), `buf` will be
1240+
filled with `0`.
12391241

12401242
If the final write of a `fill()` operation falls on a multi-byte character,
12411243
then only the bytes of that character that fit into `buf` are written:

0 commit comments

Comments
 (0)