doc: edit for concision

This removes some wordy phrases (notably "it is important to note
that").

PR-URL: https://github.com/nodejs/node/pull/17891
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
Rich Trott 2017-12-27 19:21:06 -08:00
parent ecf6e79362
commit 26607b825e
6 changed files with 25 additions and 35 deletions

View File

@ -484,9 +484,8 @@ fs.open(path, 'r', (err, fd) => {
}); });
``` ```
It is important to note that the ID returned fom `executionAsyncId()` is related The ID returned fom `executionAsyncId()` is related to execution timing, not
to execution timing, not causality (which is covered by `triggerAsyncId()`). For causality (which is covered by `triggerAsyncId()`). For example:
example:
```js ```js
const server = net.createServer(function onConnection(conn) { const server = net.createServer(function onConnection(conn) {
@ -538,9 +537,9 @@ own resources.
The `init` hook will trigger when an `AsyncResource` is instantiated. The `init` hook will trigger when an `AsyncResource` is instantiated.
*Note*: It is important that `before`/`after` calls are unwound *Note*: `before` and `after` calls must be unwound in the same order that they
in the same order they are called. Otherwise an unrecoverable exception are called. Otherwise, an unrecoverable exception will occur and the process
will occur and the process will abort. will abort.
The following is an overview of the `AsyncResource` API. The following is an overview of the `AsyncResource` API.

View File

@ -312,11 +312,10 @@ location information will be displayed for that frame. Otherwise, the
determined function name will be displayed with location information appended determined function name will be displayed with location information appended
in parentheses. in parentheses.
It is important to note that frames are **only** generated for JavaScript Frames are only generated for JavaScript functions. If, for example, execution
functions. If, for example, execution synchronously passes through a C++ addon synchronously passes through a C++ addon function called `cheetahify` which
function called `cheetahify`, which itself calls a JavaScript function, the itself calls a JavaScript function, the frame representing the `cheetahify` call
frame representing the `cheetahify` call will **not** be present in the stack will not be present in the stack traces:
traces:
```js ```js
const cheetahify = require('./native-binding.node'); const cheetahify = require('./native-binding.node');

View File

@ -374,16 +374,11 @@ process.on('SIGINT', handle);
process.on('SIGTERM', handle); process.on('SIGTERM', handle);
``` ```
*Note*: An easy way to send the `SIGINT` signal is with `<Ctrl>-C` in most
terminal programs.
It is important to take note of the following:
* `SIGUSR1` is reserved by Node.js to start the [debugger][]. It's possible to * `SIGUSR1` is reserved by Node.js to start the [debugger][]. It's possible to
install a listener but doing so will _not_ stop the debugger from starting. install a listener but doing so will _not_ stop the debugger from starting.
* `SIGTERM` and `SIGINT` have default handlers on non-Windows platforms that * `SIGTERM` and `SIGINT` have default handlers on non-Windows platforms that
resets the terminal mode before exiting with code `128 + signal number`. If reset the terminal mode before exiting with code `128 + signal number`. If one
one of these signals has a listener installed, its default behavior will be of these signals has a listener installed, its default behavior will be
removed (Node.js will no longer exit). removed (Node.js will no longer exit).
* `SIGPIPE` is ignored by default. It can have a listener installed. * `SIGPIPE` is ignored by default. It can have a listener installed.
* `SIGHUP` is generated on Windows when the console window is closed, and on * `SIGHUP` is generated on Windows when the console window is closed, and on
@ -394,7 +389,7 @@ It is important to take note of the following:
installed its default behavior will be removed. installed its default behavior will be removed.
* `SIGTERM` is not supported on Windows, it can be listened on. * `SIGTERM` is not supported on Windows, it can be listened on.
* `SIGINT` from the terminal is supported on all platforms, and can usually be * `SIGINT` from the terminal is supported on all platforms, and can usually be
generated with `CTRL+C` (though this may be configurable). It is not generated generated with `<Ctrl>+C` (though this may be configurable). It is not generated
when terminal raw mode is enabled. when terminal raw mode is enabled.
* `SIGBREAK` is delivered on Windows when `<Ctrl>+<Break>` is pressed, on * `SIGBREAK` is delivered on Windows when `<Ctrl>+<Break>` is pressed, on
non-Windows platforms it can be listened on, but there is no way to send or non-Windows platforms it can be listened on, but there is no way to send or
@ -989,10 +984,10 @@ process.exit(1);
The shell that executed Node.js should see the exit code as `1`. The shell that executed Node.js should see the exit code as `1`.
It is important to note that calling `process.exit()` will force the process to Calling `process.exit()` will force the process to exit as quickly as possible
exit as quickly as possible *even if there are still asynchronous operations even if there are still asynchronous operations pending that have not yet
pending* that have not yet completed fully, *including* I/O operations to completed fully, including I/O operations to `process.stdout` and
`process.stdout` and `process.stderr`. `process.stderr`.
In most situations, it is not actually necessary to call `process.exit()` In most situations, it is not actually necessary to call `process.exit()`
explicitly. The Node.js process will exit on its own *if there is no additional explicitly. The Node.js process will exit on its own *if there is no additional

View File

@ -114,9 +114,8 @@ $ node repl_test.js
'message' 'message'
``` ```
It is important to note that context properties are *not* read-only by default. Context properties are not read-only by default. To specify read-only globals,
To specify read-only globals, context properties must be defined using context properties must be defined using `Object.defineProperty()`:
`Object.defineProperty()`:
```js ```js
const repl = require('repl'); const repl = require('repl');

View File

@ -1426,12 +1426,11 @@ successfully or failed with an error. The first argument passed to the
`callback` must be the `Error` object if the call failed or `null` if the `callback` must be the `Error` object if the call failed or `null` if the
write succeeded. write succeeded.
It is important to note that all calls to `writable.write()` that occur between All calls to `writable.write()` that occur between the time `writable._write()`
the time `writable._write()` is called and the `callback` is called will cause is called and the `callback` is called will cause the written data to be
the written data to be buffered. Once the `callback` is invoked, the stream will buffered. Once the `callback` is invoked, the stream will emit a [`'drain'`][]
emit a [`'drain'`][] event. If a stream implementation is capable of processing event. If a stream implementation is capable of processing multiple chunks of
multiple chunks of data at once, the `writable._writev()` method should be data at once, the `writable._writev()` method should be implemented.
implemented.
If the `decodeStrings` property is set in the constructor options, then If the `decodeStrings` property is set in the constructor options, then
`chunk` may be a string rather than a Buffer, and `encoding` will `chunk` may be a string rather than a Buffer, and `encoding` will

View File

@ -87,9 +87,8 @@ changes:
depending on whether code cache data is produced successfully. depending on whether code cache data is produced successfully.
Creating a new `vm.Script` object compiles `code` but does not run it. The Creating a new `vm.Script` object compiles `code` but does not run it. The
compiled `vm.Script` can be run later multiple times. It is important to note compiled `vm.Script` can be run later multiple times. The `code` is not bound to
that the `code` is not bound to any global object; rather, it is bound before any global object; rather, it is bound before each run, just for that run.
each run, just for that run.
### script.runInContext(contextifiedSandbox[, options]) ### script.runInContext(contextifiedSandbox[, options])
<!-- YAML <!-- YAML