Remove deprecated Buffer constructor usage

Fixes #1709
This commit is contained in:
Nick O'Leary
2018-10-24 13:45:34 +01:00
parent 7dcca2c907
commit e4d518749f
13 changed files with 26 additions and 26 deletions

View File

@@ -506,7 +506,7 @@ describe('debug node', function() {
helper.load(debugNode, flow, function() {
var n1 = helper.getNode("n1");
websocket_test(function() {
n1.emit("input", {payload: new Buffer.from('HELLO', 'utf8')});
n1.emit("input", {payload: Buffer.from('HELLO', 'utf8')});
}, function(msg) {
JSON.parse(msg).should.eql([{
topic:"debug",

View File

@@ -177,7 +177,7 @@ describe('exec node', function() {
function(arg1, arg2, arg3, arg4) {
//console.log(arg1);
// arg3(error,stdout,stderr);
arg3("error",new Buffer([0x01,0x02,0x03,0x88]),new Buffer([0x01,0x02,0x03,0x88]));
arg3("error",Buffer.from([0x01,0x02,0x03,0x88]),Buffer.from([0x01,0x02,0x03,0x88]));
});
helper.load(execNode, flow, function() {
var n1 = helper.getNode("n1");
@@ -595,7 +595,7 @@ describe('exec node', function() {
}
catch(err) { done(err); }
});
n1.receive({payload:new Buffer([0x01,0x02,0x03,0x88])});
n1.receive({payload:Buffer.from([0x01,0x02,0x03,0x88])});
});
});

View File

@@ -251,7 +251,7 @@ describe('function node', function() {
testNonObjectMessage('return "foo"', done)
});
it('should drop and log non-object message types - buffer', function(done) {
testNonObjectMessage('return new Buffer("hello")', done)
testNonObjectMessage('return Buffer.from("hello")', done)
});
it('should drop and log non-object message types - array', function(done) {
testNonObjectMessage('return [[[1,2,3]]]', done)