Skip to content

Commit 629132d

Browse files
deokjinkimtargos
authored andcommitted
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 f7d6e9b commit 629132d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

doc/api/async_hooks.md

Lines changed: 2 additions & 0 deletions
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)