doc: add a note to buf.fill() description

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Vse Mozhet Byt 2019-01-17 13:09:02 +02:00
parent 2e613a9c30
commit c1ac578881

View File

@ -1238,7 +1238,9 @@ console.log(b.toString());
// Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
```
`value` is coerced to a `uint32` value if it is not a string or integer.
`value` is coerced to a `uint32` value if it is not a string, `Buffer`, or
integer. If the resulting integer is greater than `255` (decimal), `buf` will be
filled with `0`.
If the final write of a `fill()` operation falls on a multi-byte character,
then only the bytes of that character that fit into `buf` are written: