From 8f67ed40e48fe1f6ef50a11b530ac8946e991753 Mon Sep 17 00:00:00 2001 From: Deokjin Kim Date: Wed, 19 Jul 2023 05:00:50 +0900 Subject: [PATCH] doc: declare `path` on example of `async_hooks.executionAsyncId()` Example is not runnable because `path` is used, but it's not declared. PR-URL: https://github.com/nodejs/node/pull/48556 Reviewed-By: Luigi Pinca --- doc/api/async_hooks.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 1b408ba97b717c..a5571c30be575d 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -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() }); @@ -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() });