We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 555696d commit f0af3b0Copy full SHA for f0af3b0
doc/api/buffer.md
@@ -1177,8 +1177,12 @@ console.log(Buffer.allocUnsafe(3).fill('\u0222'));
1177
// Prints: <Buffer c8 a2 c8>
1178
```
1179
1180
-If `value` contains invalid characters, it is truncated; if no valid
1181
-fill data remains, no filling is performed:
+If `value` contains invalid characters, it is truncated.
+
1182
+If no valid fill data remains, then the buffer is either zero-filled or no
1183
+filling is performed, depending on the input type. That behavior is dictated by
1184
+compatibility reasons and was changed to throwing an exception in Node.js v10,
1185
+so it's not recommended to rely on that.
1186
1187
```js
1188
const buf = Buffer.allocUnsafe(5);
0 commit comments