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@cc03470

File tree

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

‎test/parallel/test-http-default-encoding.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-default-encoding.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ const http = require('http');
66
const expected = 'This is a unicode text: سلام';
77
let result = '';
88

9-
const server = http.Server(function(req, res) {
9+
const server = http.Server((req, res) => {
1010
req.setEncoding('utf8');
11-
req.on('data', function(chunk) {
11+
req.on('data', (chunk) => {
1212
result += chunk;
13-
}).on('end', function() {
13+
}).on('end', () => {
1414
server.close();
1515
res.writeHead(200);
1616
res.end('hello world\n');
@@ -23,15 +23,15 @@ server.listen(0, function() {
2323
port: this.address().port,
2424
path: '/',
2525
method: 'POST'
26-
}, function(res) {
26+
}, (res) => {
2727
console.log(res.statusCode);
2828
res.resume();
29-
}).on('error', function(e) {
29+
}).on('error', (e) => {
3030
console.log(e.message);
3131
process.exit(1);
3232
}).end(expected);
3333
});
3434

35-
process.on('exit', function() {
35+
process.on('exit', () => {
3636
assert.strictEqual(expected, result);
3737
});

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.