Skip to content

Commit

Permalink
doc: declare path on example of async_hooks.executionAsyncId()
Browse files Browse the repository at this point in the history
Example is not runnable because `path` is used, but it's not
declared.

PR-URL: nodejs#48556
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
deokjinkim authored and pluris committed Aug 7, 2023
1 parent d6088ad commit 8f67ed4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ import { executionAsyncId } from 'node:async_hooks';
import fs from 'node:fs';

console.log(executionAsyncId()); // 1 - bootstrap
const path = '.';
fs.open(path, 'r', (err, fd) => {
console.log(executionAsyncId()); // 6 - open()
});
Expand All @@ -778,6 +779,7 @@ const async_hooks = require('node:async_hooks');
const fs = require('node:fs');

console.log(async_hooks.executionAsyncId()); // 1 - bootstrap
const path = '.';
fs.open(path, 'r', (err, fd) => {
console.log(async_hooks.executionAsyncId()); // 6 - open()
});
Expand Down

0 comments on commit 8f67ed4

Please sign in to comment.