Skip to content

Commit 388c7d9

Browse files
deokjinkimRafaelGSS
authored andcommittedAug 15, 2023
doc: declare path on example of async_hooks.executionAsyncId()
Example is not runnable because `path` is used, but it's not declared. PR-URL: #48556 Reviewed-By: Luigi Pinca <[email protected]>
1 parent 41929a2 commit 388c7d9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎doc/api/async_hooks.md

+2
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,7 @@ import { executionAsyncId } from 'node:async_hooks';
768768
import fs from 'node:fs';
769769

770770
console.log(executionAsyncId()); // 1 - bootstrap
771+
const path = '.';
771772
fs.open(path, 'r', (err, fd) => {
772773
console.log(executionAsyncId()); // 6 - open()
773774
});
@@ -778,6 +779,7 @@ const async_hooks = require('node:async_hooks');
778779
const fs = require('node:fs');
779780

780781
console.log(async_hooks.executionAsyncId()); // 1 - bootstrap
782+
const path = '.';
781783
fs.open(path, 'r', (err, fd) => {
782784
console.log(async_hooks.executionAsyncId()); // 6 - open()
783785
});

0 commit comments

Comments
 (0)