mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
doc: use Buffer.from() instead of new Buffer()
Use new API of Buffer to developers in most documents. PR-URL: https://github.com/nodejs/node/pull/6367 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
This commit is contained in:
1 parent
cbbe95e1e1
commit
19fb1345ba
7 files changed
+13
-13
No files matched your search
@@ -58,8 +58,8 @@ const StringDecoder = exports.StringDecoder = function(encoding) {
|
||||
// returned when calling write again with the remaining bytes.
|
||||
//
|
||||
// Note: Converting a Buffer containing an orphan surrogate to a String
|
||||
// currently works, but converting a String to a Buffer (via `new Buffer`, or
|
||||
// Buffer#write) will replace incomplete surrogates with the unicode
|
||||
// currently works, but converting a String to a Buffer (via `Buffer.from()`,
|
||||
// or Buffer#write) will replace incomplete surrogates with the unicode
|
||||
// replacement character. See https://codereview.chromium.org/121173009/ .
|
||||
StringDecoder.prototype.write = function(buffer) {
|
||||
var charStr = '';
|
||||
|
||||
Reference in new issue
Block a user