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: replace callback with arrow functions · nodejs/node@1067653

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-https-close.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-https-close.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-https-close.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ const options = {
1313

1414
const connections = {};
1515

16-
const server = https.createServer(options, function(req, res) {
17-
const interval = setInterval(function() {
16+
const server = https.createServer(options, (req, res) => {
17+
const interval = setInterval(() => {
1818
res.write('data');
1919
}, 1000);
2020
interval.unref();
2121
});
2222

23-
server.on('connection', function(connection) {
23+
server.on('connection', (connection) => {
2424
const key = `${connection.remoteAddress}:${connection.remotePort}`;
25-
connection.on('close', function() {
25+
connection.on('close', () => {
2626
delete connections[key];
2727
});
2828
connections[key] = connection;
@@ -37,16 +37,16 @@ function shutdown() {
3737
}
3838
}
3939

40-
server.listen(0, function() {
40+
server.listen(0, () => {
4141
const requestOptions = {
4242
hostname: '127.0.0.1',
43-
port: this.address().port,
43+
port: server.address().port,
4444
path: '/',
4545
method: 'GET',
4646
rejectUnauthorized: false
4747
};
4848

49-
const req = https.request(requestOptions, function(res) {
49+
const req = https.request(requestOptions, (res) => {
5050
res.on('data', () => {});
5151
setImmediate(shutdown);
5252
});

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.