From 65e225383e467233f532d7e2afbeb53723d4cfbf 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/23496 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat --- 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();