@@ -32,7 +32,7 @@ const options = {
3232 host : '127.0.0.1' ,
3333} ;
3434
35- const server = http . createServer ( function ( req , res ) {
35+ const server = http . createServer ( ( req , res ) => {
3636 const m = / \/ ( .* ) / . exec ( req . url ) ;
3737 const reqid = parseInt ( m [ 1 ] , 10 ) ;
3838 if ( reqid % 2 ) {
@@ -51,7 +51,7 @@ server.listen(0, options.host, function() {
5151 options . path = `/${ requests_sent } ` ;
5252 const req = http . request ( options ) ;
5353 req . id = requests_sent ;
54- req . on ( 'response' , function ( res ) {
54+ req . on ( 'response' , ( res ) => {
5555 res . on ( 'data' , function ( data ) {
5656 console . log ( `res#${ this . req . id } data:${ data } ` ) ;
5757 } ) ;
@@ -78,7 +78,7 @@ server.listen(0, options.host, function() {
7878
7979 setTimeout ( function maybeDone ( ) {
8080 if ( requests_done >= requests_sent ) {
81- setTimeout ( function ( ) {
81+ setTimeout ( ( ) => {
8282 server . close ( ) ;
8383 } , 100 ) ;
8484 } else {
@@ -87,7 +87,7 @@ server.listen(0, options.host, function() {
8787 } , 100 ) ;
8888} ) ;
8989
90- process . on ( 'exit' , function ( ) {
90+ process . on ( 'exit' , ( ) => {
9191 console . error ( `done=${ requests_done } sent=${ requests_sent } ` ) ;
9292 // check that timeout on http request was not called too much
9393 assert . strictEqual ( requests_done , requests_sent ) ;
0 commit comments