Skip to content

Commit f112c06

Browse files
Jayasankar-mrvagg
authored andcommitted
test:replace anonymous closure function
PR-URL: #24415 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ouyang Yadong <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent 6dd2925 commit f112c06

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎test/parallel/test-http-pipeline-socket-parser-typeerror.js‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let more;
2020
letdone;
2121

2222
constserver=http
23-
.createServer(function(req,res){
23+
.createServer((req,res)=>{
2424
if(!once)server.close();
2525
once=true;
2626

@@ -41,18 +41,18 @@ const server = http
4141
}
4242
done();
4343
})
44-
.on('upgrade',function(req,socket){
45-
second.end(chunk,function(){
44+
.on('upgrade',(req,socket)=>{
45+
second.end(chunk,()=>{
4646
socket.end();
4747
});
4848
first.end('hello');
4949
})
50-
.listen(0,function(){
51-
consts=net.connect(this.address().port);
52-
more=function(){
50+
.listen(0,()=>{
51+
consts=net.connect(server.address().port);
52+
more=()=>{
5353
s.write('GET / HTTP/1.1\r\n\r\n');
5454
};
55-
done=function(){
55+
done=()=>{
5656
s.write(
5757
'GET / HTTP/1.1\r\n\r\n'+
5858
'GET / HTTP/1.1\r\nConnection: upgrade\r\nUpgrade: ws\r\n\r\naaa'

0 commit comments

Comments
(0)