From b215f797fcf3bfa6f8ac5171ba8f11990d62c286 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Thu, 17 Jan 2019 13:09:02 +0200 Subject: [PATCH 1/2] doc: add a note to `buf.fill()` description --- doc/api/buffer.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 1bfd30b1943e42..077153ea0545e6 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -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 resulted integer is more than `255` (decimal) the `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: From f54a9ffe5f96bfc8be7a69110a1de40373d1e888 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 17 Jan 2019 23:52:50 +0200 Subject: [PATCH 2/2] fixup: update doc/api/buffer.md Co-Authored-By: vsemozhetbyt --- doc/api/buffer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 077153ea0545e6..ad130f2aa2b5a7 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -1239,7 +1239,7 @@ console.log(b.toString()); ``` `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or -integer. If the resulted integer is more than `255` (decimal) the `buf` will be +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,