From 1e542f8371cafe338ef44838754f68ed89e9c088 Mon Sep 17 00:00:00 2001 From: Greg Goforth Date: Fri, 12 Oct 2018 10:12:42 -0700 Subject: [PATCH] test: modernized test to use arrow functions. --- test/parallel/test-dgram-send-callback-multi-buffer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-dgram-send-callback-multi-buffer.js b/test/parallel/test-dgram-send-callback-multi-buffer.js index f77b5618450095..09f01f6e8adccc 100644 --- a/test/parallel/test-dgram-send-callback-multi-buffer.js +++ b/test/parallel/test-dgram-send-callback-multi-buffer.js @@ -6,19 +6,19 @@ const dgram = require('dgram'); const client = dgram.createSocket('udp4'); -const messageSent = common.mustCall(function messageSent(err, bytes) { +const messageSent = common.mustCall((err, bytes) => { assert.strictEqual(bytes, buf1.length + buf2.length); }); const buf1 = Buffer.alloc(256, 'x'); const buf2 = Buffer.alloc(256, 'y'); -client.on('listening', function() { - const port = this.address().port; +client.on('listening', () => { + const port = client.address().port; client.send([buf1, buf2], port, common.localhostIPv4, messageSent); }); -client.on('message', common.mustCall(function onMessage(buf, info) { +client.on('message', common.mustCall((buf, info) => { const expected = Buffer.concat([buf1, buf2]); assert.ok(buf.equals(expected), 'message was received correctly'); client.close();