Skip to content

Commit

Permalink
doc: revise exit() and run() text in async_hooks.md
Browse files Browse the repository at this point in the history
Edit for brevity and clarity. Use present tense where possible.

PR-URL: #36738
Reviewed-By: Andrey Pechkurov <[email protected]>
Reviewed-By: Gerhard Stöbich <[email protected]>
  • Loading branch information
Trott authored and targos committed May 1, 2021
1 parent 844a156 commit 31039db
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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:

Expand Down

0 comments on commit 31039db

Please sign in to comment.