summaryrefslogtreecommitdiff
path: root/test/parallel/test-dgram-send-bad-arguments.js
diff options
context:
space:
mode:
authorAnna Zhao <annatangzhao@gmail.com>2018-10-12 10:06:42 -0700
committerRich Trott <rtrott@gmail.com>2018-10-14 16:59:21 -0700
commit6783eedcb93d84362422b6a5d3db4dacfc33f4b3 (patch)
treea866ebc9f87ee3c2b325109bddf54c3019e5d6ca /test/parallel/test-dgram-send-bad-arguments.js
parent8ce99faa5073298fcec9be91a30e3aa98a8620d3 (diff)
downloadandroid-node-v8-6783eedcb93d84362422b6a5d3db4dacfc33f4b3.tar.gz
android-node-v8-6783eedcb93d84362422b6a5d3db4dacfc33f4b3.tar.bz2
android-node-v8-6783eedcb93d84362422b6a5d3db4dacfc33f4b3.zip
test: change to arrow functions in send-bad-arguments
PR-URL: https://github.com/nodejs/node/pull/23483 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Diffstat (limited to 'test/parallel/test-dgram-send-bad-arguments.js')
-rw-r--r--test/parallel/test-dgram-send-bad-arguments.js12
1 files 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 e96a01de32..4eb7dca7a3 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);