From e9962b9cf9175b1e385af85412e1489aee8a6a7b Mon Sep 17 00:00:00 2001 From: Anna Zhao Date: Fri, 12 Oct 2018 10:06:42 -0700 Subject: [PATCH] test: change to arrow functions in send-bad-arguments PR-URL: https://github.com/nodejs/node/pull/23483 Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell Reviewed-By: Shelley Vohr --- test/parallel/test-dgram-send-bad-arguments.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-dgram-send-bad-arguments.js b/test/parallel/test-dgram-send-bad-arguments.js index e96a01de3281f2..4eb7dca7a38e5d 100644 --- a/test/parallel/test-dgram-send-bad-arguments.js +++ b/test/parallel/test-dgram-send-bad-arguments.js @@ -28,17 +28,17 @@ const buf = Buffer.from('test'); const host = '127.0.0.1'; const sock = dgram.createSocket('udp4'); -assert.throws(function() { +assert.throws(() => { sock.send(); }, TypeError); // First argument should be a buffer. // send(buf, offset, length, port, host) -assert.throws(function() { sock.send(buf, 1, 1, -1, host); }, RangeError); -assert.throws(function() { sock.send(buf, 1, 1, 0, host); }, RangeError); -assert.throws(function() { sock.send(buf, 1, 1, 65536, host); }, RangeError); +assert.throws(() => { sock.send(buf, 1, 1, -1, host); }, RangeError); +assert.throws(() => { sock.send(buf, 1, 1, 0, host); }, RangeError); +assert.throws(() => { sock.send(buf, 1, 1, 65536, host); }, RangeError); // send(buf, port, host) -assert.throws(function() { sock.send(23, 12345, host); }, TypeError); +assert.throws(() => { sock.send(23, 12345, host); }, TypeError); // send([buf1, ..], port, host) -assert.throws(function() { sock.send([buf, 23], 12345, host); }, TypeError); +assert.throws(() => { sock.send([buf, 23], 12345, host); }, TypeError);