From af2ca7ce06dc081e0b4c12d65c8730b84fb6aa46 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Fri, 23 Sep 2016 11:47:59 -0700 Subject: [PATCH] test: use Buffer.alloc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-By: James M Snell Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Ilkka Myller Reviewed-By: Brian White Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig PR-URL: https://github.com/nodejs/node/pull/8748 --- test/inspector/inspector-helper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/inspector/inspector-helper.js b/test/inspector/inspector-helper.js index cf1c7f7afb..a4e1094340 100644 --- a/test/inspector/inspector-helper.js +++ b/test/inspector/inspector-helper.js @@ -90,13 +90,13 @@ function checkHttpResponse(port, path, callback) { } function makeBufferingDataCallback(dataCallback) { - let buffer = new Buffer(0); + let buffer = Buffer.alloc(0); return (data) => { const newData = Buffer.concat([buffer, data]); const str = newData.toString('utf8'); const lines = str.split('\n'); if (str.endsWith('\n')) - buffer = new Buffer(0); + buffer = Buffer.alloc(0); else buffer = Buffer.from(lines.pop(), 'utf8'); for (var line of lines) @@ -123,7 +123,7 @@ const TestSession = function(socket, harness) { this.expectedId_ = 1; this.lastMessageResponseCallback_ = null; - let buffer = new Buffer(0); + let buffer = Buffer.alloc(0); socket.on('data', (data) => { buffer = Buffer.concat([buffer, data]); let consumed;