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 — doc: use arrow function for anonymous callbacks · nodejs/node@a1a393b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • async_hooks.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/async_hooks.md‎

Copy file name to clipboardExpand all lines: doc/api/async_hooks.md
+3-4Lines changed: 3 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -479,13 +479,12 @@ The ID returned from `executionAsyncId()` is related to execution timing, not
479479
causality (which is covered by `triggerAsyncId()`):
480480

481481
```js
482-
const server = net.createServer(function onConnection(conn) {
482+
const server = net.createServer((conn) => {
483483
// Returns the ID of the server, not of the new connection, because the
484-
// onConnection callback runs in the execution scope of the server's
485-
// MakeCallback().
484+
// callback runs in the execution scope of the server's MakeCallback().
486485
async_hooks.executionAsyncId();
487486

488-
}).listen(port, function onListening() {
487+
}).listen(port, () => {
489488
// Returns the ID of a TickObject (i.e. process.nextTick()) because all
490489
// callbacks passed to .listen() are wrapped in a nextTick().
491490
async_hooks.executionAsyncId();

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.