@@ -28,17 +28,17 @@ const buf = Buffer.from('test');
28
28
const host = '127.0.0.1' ;
29
29
const sock = dgram . createSocket ( 'udp4' ) ;
30
30
31
- assert . throws ( function ( ) {
31
+ assert . throws ( ( ) => {
32
32
sock . send ( ) ;
33
33
} , TypeError ) ; // First argument should be a buffer.
34
34
35
35
// send(buf, offset, length, port, host)
36
- assert . throws ( function ( ) { sock . send ( buf , 1 , 1 , - 1 , host ) ; } , RangeError ) ;
37
- assert . throws ( function ( ) { sock . send ( buf , 1 , 1 , 0 , host ) ; } , RangeError ) ;
38
- assert . throws ( function ( ) { sock . send ( buf , 1 , 1 , 65536 , host ) ; } , RangeError ) ;
36
+ assert . throws ( ( ) => { sock . send ( buf , 1 , 1 , - 1 , host ) ; } , RangeError ) ;
37
+ assert . throws ( ( ) => { sock . send ( buf , 1 , 1 , 0 , host ) ; } , RangeError ) ;
38
+ assert . throws ( ( ) => { sock . send ( buf , 1 , 1 , 65536 , host ) ; } , RangeError ) ;
39
39
40
40
// send(buf, port, host)
41
- assert . throws ( function ( ) { sock . send ( 23 , 12345 , host ) ; } , TypeError ) ;
41
+ assert . throws ( ( ) => { sock . send ( 23 , 12345 , host ) ; } , TypeError ) ;
42
42
43
43
// send([buf1, ..], port, host)
44
- assert . throws ( function ( ) { sock . send ( [ buf , 23 ] , 12345 , host ) ; } , TypeError ) ;
44
+ assert . throws ( ( ) => { sock . send ( [ buf , 23 ] , 12345 , host ) ; } , TypeError ) ;
0 commit comments