Skip to content

Commit 10bff7a

Browse files
vsemozhetbytaddaleax
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 b8d780c commit 10bff7a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/api/buffer.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,9 @@ console.log(b.toString());
12381238
// Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
12391239
```
12401240

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

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

0 commit comments

Comments
 (0)