From f112c06b3e132f20b613624f073a9e92a456ff9a Mon Sep 17 00:00:00 2001 From: Jayasankar Date: Sat, 17 Nov 2018 17:03:24 +0530 Subject: [PATCH] test:replace anonymous closure function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/24415 Reviewed-By: Michaƫl Zasso Reviewed-By: Ouyang Yadong Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil --- .../test-http-pipeline-socket-parser-typeerror.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/parallel/test-http-pipeline-socket-parser-typeerror.js b/test/parallel/test-http-pipeline-socket-parser-typeerror.js index 0cb20e76172766..8987b822c26496 100644 --- a/test/parallel/test-http-pipeline-socket-parser-typeerror.js +++ b/test/parallel/test-http-pipeline-socket-parser-typeerror.js @@ -20,7 +20,7 @@ let more; let done; const server = http - .createServer(function(req, res) { + .createServer((req, res) => { if (!once) server.close(); once = true; @@ -41,18 +41,18 @@ const server = http } done(); }) - .on('upgrade', function(req, socket) { - second.end(chunk, function() { + .on('upgrade', (req, socket) => { + second.end(chunk, () => { socket.end(); }); first.end('hello'); }) - .listen(0, function() { - const s = net.connect(this.address().port); - more = function() { + .listen(0, () => { + const s = net.connect(server.address().port); + more = () => { s.write('GET / HTTP/1.1\r\n\r\n'); }; - done = function() { + done = () => { s.write( 'GET / HTTP/1.1\r\n\r\n' + 'GET / HTTP/1.1\r\nConnection: upgrade\r\nUpgrade: ws\r\n\r\naaa'