Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/string_decoder.js')
-rw-r--r--lib/string_decoder.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/string_decoder.js b/lib/string_decoder.js
index a0bfd535ad8..16803921573 100644
--- a/lib/string_decoder.js
+++ b/lib/string_decoder.js
@@ -44,7 +44,7 @@ const StringDecoder = exports.StringDecoder = function(encoding) {
// Enough space to store all bytes of a single character. UTF-8 needs 4
// bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
- this.charBuffer = new Buffer(6);
+ this.charBuffer = Buffer.allocUnsafe(6);
// Number of bytes received for the current incomplete multi-byte character.
this.charReceived = 0;
// Number of bytes expected for the current incomplete multi-byte character.