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 callback function to arrow function · nodejs/node@2d77241

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-http-date-header.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-http-date-header.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-date-header.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const http = require('http');
55

66
const testResBody = 'other stuff!\n';
77

8-
const server = http.createServer(function(req, res) {
8+
const server = http.createServer((req, res) => {
99
assert.ok(!('date' in req.headers),
1010
'Request headers contained a Date.');
1111
res.writeHead(200, {
@@ -16,16 +16,16 @@ const server = http.createServer(function(req, res) {
1616
server.listen(0);
1717

1818

19-
server.addListener('listening', function() {
19+
server.addListener('listening', () => {
2020
const options = {
21-
port: this.address().port,
21+
port: server.address().port,
2222
path: '/',
2323
method: 'GET'
2424
};
25-
const req = http.request(options, function(res) {
25+
const req = http.request(options, (res) => {
2626
assert.ok('date' in res.headers,
2727
'Response headers didn\'t contain a Date.');
28-
res.addListener('end', function() {
28+
res.addListener('end', () => {
2929
server.close();
3030
process.exit();
3131
});

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.