-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: modernize and fix code examples in process.md #12381
Conversation
Add a line break, remove an unnecessary duplicate word.
@@ -231,7 +231,7 @@ For example: | |||
|
|||
```js | |||
process.on('unhandledRejection', (reason, p) => { | |||
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); | |||
console.log('Unhandled Rejection at:', p, 'reason:', reason); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Promise
is already present now in the output as a prefix for p
. Without this fix the output is:
Unhandled Rejection at: Promise Promise {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, my bad. Thanks for clarifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for not making this clearer before)
Landed in e72ea0d |
* Replace `var` by `const`. * Use `console.error()`. * Fix example file name mismatch. * Update output examples. * Fix output readability (add a line break, remove an unnecessary duplicate word). PR-URL: #12381 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Should be landed after #12725. |
Checklist
Affected core subsystem(s)
doc, process
var
byconst
.console.error()
.