summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorkoki-oshima <koki.oshima@weblio.co.jp>2018-11-24 16:35:20 +0900
committerRich Trott <rtrott@gmail.com>2018-11-25 20:32:02 -0800
commite958ee7a70d0af136fae8a708882cccdd4601658 (patch)
treecbc1c8920ebc08b1353efe625fdfb82528eee50e /doc
parent92986837ff0904af34b63f0849f9b5a05b76137c (diff)
downloadnode-new-e958ee7a70d0af136fae8a708882cccdd4601658.tar.gz
doc: use arrow function for anonymous callbacks
PR-URL: https://github.com/nodejs/node/pull/24606 Reviewed-By: Ron Korving <ron@ronkorving.nl> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/async_hooks.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md
index b1abfc63a2..c1acaadcbb 100644
--- a/doc/api/async_hooks.md
+++ b/doc/api/async_hooks.md
@@ -478,13 +478,12 @@ The ID returned from `executionAsyncId()` is related to execution timing, not
causality (which is covered by `triggerAsyncId()`):
```js
-const server = net.createServer(function onConnection(conn) {
+const server = net.createServer((conn) => {
// Returns the ID of the server, not of the new connection, because the
- // onConnection callback runs in the execution scope of the server's
- // MakeCallback().
+ // callback runs in the execution scope of the server's MakeCallback().
async_hooks.executionAsyncId();
-}).listen(port, function onListening() {
+}).listen(port, () => {
// Returns the ID of a TickObject (i.e. process.nextTick()) because all
// callbacks passed to .listen() are wrapped in a nextTick().
async_hooks.executionAsyncId();