From 15374feac65eac9f2c6461c8417df9a20e4e16f2 Mon Sep 17 00:00:00 2001 From: H Adinarayana Date: Thu, 15 Oct 2020 17:37:43 +0530 Subject: [PATCH 1/4] test: replace anonymous function with arrow function --- test/parallel/test-http-pause.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-http-pause.js b/test/parallel/test-http-pause.js index 0294cf5625b5e8..6292654a819597 100644 --- a/test/parallel/test-http-pause.js +++ b/test/parallel/test-http-pause.js @@ -47,7 +47,7 @@ const server = http.createServer((req, res) => { }, 100); }); -server.listen(0, function() { +server.listen(0, () => { const req = http.request({ port: this.address().port, path: '/', From a8ddc7729cc7287f0258c9e8ba6c136e80f281f9 Mon Sep 17 00:00:00 2001 From: H Adinarayana Date: Fri, 16 Oct 2020 12:50:44 +0530 Subject: [PATCH 2/4] test: replace anonymous function with arrow function modified the file test-http-pause.js by replacing the function ()=> --- test/parallel/test-http-pause.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-http-pause.js b/test/parallel/test-http-pause.js index 6292654a819597..ef4c65a43858f3 100644 --- a/test/parallel/test-http-pause.js +++ b/test/parallel/test-http-pause.js @@ -49,7 +49,7 @@ const server = http.createServer((req, res) => { server.listen(0, () => { const req = http.request({ - port: this.address().port, + port: server.address().port, path: '/', method: 'POST' }, (res) => { From c3bb374a24de54cbdce846981b85614fb233ef32 Mon Sep 17 00:00:00 2001 From: H Adinarayana <72463095+adinhtdsibm@users.noreply.github.com> Date: Fri, 16 Oct 2020 14:07:37 +0530 Subject: [PATCH 3/4] Update test/parallel/test-http-pause.js Updating the changes as requested above. Co-authored-by: Antoine du Hamel --- test/parallel/test-http-pause.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-http-pause.js b/test/parallel/test-http-pause.js index ef4c65a43858f3..f911cfd2566c43 100644 --- a/test/parallel/test-http-pause.js +++ b/test/parallel/test-http-pause.js @@ -47,7 +47,9 @@ const server = http.createServer((req, res) => { }, 100); }); -server.listen(0, () => { +server.listen(0, function() { + // Anonymous function rather than arrow function to test `this` value. + assert.strictEqual(this, server); const req = http.request({ port: server.address().port, path: '/', From 734bed8f46a373c6e21a075ce007ac82982671ea Mon Sep 17 00:00:00 2001 From: H Adinarayana <72463095+adinhtdsibm@users.noreply.github.com> Date: Fri, 16 Oct 2020 14:08:11 +0530 Subject: [PATCH 4/4] Update test/parallel/test-http-pause.js Updated the changes as requested. Co-authored-by: Antoine du Hamel --- test/parallel/test-http-pause.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-http-pause.js b/test/parallel/test-http-pause.js index f911cfd2566c43..555eece2e3f13b 100644 --- a/test/parallel/test-http-pause.js +++ b/test/parallel/test-http-pause.js @@ -51,7 +51,7 @@ server.listen(0, function() { // Anonymous function rather than arrow function to test `this` value. assert.strictEqual(this, server); const req = http.request({ - port: server.address().port, + port: this.address().port, path: '/', method: 'POST' }, (res) => {