GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: change anonymous function to arrow function · nodejs/node@8237601

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-http-client-timeout-agent.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-http-client-timeout-agent.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-client-timeout-agent.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.