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: refactor test-http-write-empty-string to use arrow functions · nodejs/node@4792bea

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-http-write-empty-string.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-http-write-empty-string.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-write-empty-string.js
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ const server = http.createServer(function(request, response) {
3838
this.close();
3939
});
4040

41-
server.listen(0, common.mustCall(function() {
42-
http.get({ port: this.address().port }, common.mustCall(function(res) {
41+
server.listen(0, common.mustCall(() => {
42+
http.get({ port: server.address().port }, common.mustCall((res) => {
4343
let response = '';
4444

4545
assert.strictEqual(res.statusCode, 200);
4646
res.setEncoding('ascii');
47-
res.on('data', function(chunk) {
47+
res.on('data', (chunk) => {
4848
response += chunk;
4949
});
50-
res.on('end', common.mustCall(function() {
50+
res.on('end', common.mustCall(() => {
5151
assert.strictEqual(response, '1\n2\n3\n');
5252
}));
5353
}));

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.