From 31039dbf63dcaa70e3864a7a1bf06d5ce2f9e660 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 2 Jan 2021 06:15:38 -0800 Subject: [PATCH] doc: revise exit() and run() text in async_hooks.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Edit for brevity and clarity. Use present tense where possible. PR-URL: https://github.com/nodejs/node/pull/36738 Reviewed-By: Andrey Pechkurov Reviewed-By: Gerhard Stöbich --- doc/api/async_hooks.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 2f1ef23c64b894..99b8f038ddf211 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -1082,12 +1082,10 @@ This methods runs a function synchronously within a context and return its return value. The store is not accessible outside of the callback function or the asynchronous operations created within the callback. -Optionally, arguments can be passed to the function. They will be passed to -the callback function. +The optional `args` are passed to the callback function. -If the callback function throws an error, it will be thrown by `run` too. -The stacktrace will not be impacted by this call and the context will -be exited. +If the callback function throws an error, the error is thrown by `run()` too. +The stacktrace is not impacted by this call and the context is exited. Example: @@ -1117,12 +1115,10 @@ return value. The store is not accessible within the callback function or the asynchronous operations created within the callback. Any `getStore()` call done within the callback function will always return `undefined`. -Optionally, arguments can be passed to the function. They will be passed to -the callback function. +The optional `args` are passed to the callback function. -If the callback function throws an error, it will be thrown by `exit` too. -The stacktrace will not be impacted by this call and the context will be -re-entered. +If the callback function throws an error, the error is thrown by `exit()` too. +The stacktrace is not impacted by this call and the context is re-entered. Example: