summaryrefslogtreecommitdiff
path: root/lib/string_decoder.js
diff options
context:
space:
mode:
authorJackson Tian <shyvo1987@gmail.com>2016-04-25 10:36:57 +0800
committerJackson Tian <shyvo1987@gmail.com>2016-04-27 13:23:41 +0800
commite556dd3856d42ae8e94e27846b8cf7c1dfff05d3 (patch)
tree43801cfa990096ed1e9ad5451d76ca231647b67f /lib/string_decoder.js
parentcee4c25c9281d106f80b20ba7854bf9003f9357a (diff)
downloadandroid-node-v8-e556dd3856d42ae8e94e27846b8cf7c1dfff05d3.tar.gz
android-node-v8-e556dd3856d42ae8e94e27846b8cf7c1dfff05d3.tar.bz2
android-node-v8-e556dd3856d42ae8e94e27846b8cf7c1dfff05d3.zip
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>
Diffstat (limited to 'lib/string_decoder.js')
-rw-r--r--lib/string_decoder.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/string_decoder.js b/lib/string_decoder.js
index 1680392157..4047489e6c 100644
--- a/lib/string_decoder.js
+++ b/lib/string_decoder.js
@@ -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 = '';