doc: remove redundant 'Example:' and similar notes#22537
doc: remove redundant 'Example:' and similar notes#22537vsemozhetbyt wants to merge 3 commits intonodejs:masterfrom vsemozhetbyt:doc-del-example-notes
Conversation
Some nits were also fixed in passing.
This comment has been minimized.
This comment has been minimized.
doc/api/dgram.md
Outdated
| ``` | ||
|
|
||
| Must be changed to pass a callback function to the [`dgram.Socket#bind()`][] | ||
| must be changed to pass a callback function to the [`dgram.Socket#bind()`][] |
There was a problem hiding this comment.
Rather than continuing the sentence after the example, it would probably be better to split it into two proper sentences. Not a blocking objection, though. Just an optional nit. (Maybe instead of Legacy code that assumes synchronous behavior, as in the following example: could be changed to Legacy code would use syncrhronous behavior: and line 564 can be changed to Such legacy code would need to be changed to pass a ...
Alternative: Given that this is about a change that appeared in Node.js v0.10, I wonder if it can be removed at this time? It's only going to be relevant to people who are porting v0.8.x code and earlier.
There was a problem hiding this comment.
Fixed the first way for now.
doc/api/errors.md
Outdated
| Thrown in case a function option does not return an expected value | ||
| type on execution. | ||
| For example when a function is expected to return a promise. | ||
| type on execution. For example, when a function is expected to return a promise. |
There was a problem hiding this comment.
I know this did not originate in this PR, but the second sentence is a fragment. Optional nit: Make it a complete sentence, probably by appending it to the previous sentence and changed For example to such as: ...type on execution, such as when a function is expect to return a promise.
This comment has been minimized.
This comment has been minimized.
doc/api/dgram.md
Outdated
| As of Node.js v0.10, [`dgram.Socket#bind()`][] changed to an asynchronous | ||
| execution model. Legacy code that assumes synchronous behavior, as in the | ||
| following example: | ||
| execution model. Legacy code would use syncrhronous behavior: |
There was a problem hiding this comment.
s/syncrhronous/synchronous/
| execution model. Legacy code would use synchronous behavior: | ||
|
|
||
| ```js | ||
| const s = dgram.createSocket('udp4'); |
There was a problem hiding this comment.
Super tiny Nit: If we say, this is some code which used to work in older versions, I think it would be better to change this const to var.
There was a problem hiding this comment.
It seems some latest versions before the change support const:
> process.versions
{ http_parser: '1.0',
node: '0.8.28',
v8: '3.11.10.26',
ares: '1.7.5-DEV',
uv: '0.8',
zlib: '1.2.3',
openssl: '1.0.0m' }
> const a = 1;
undefined
> a
1There was a problem hiding this comment.
But I can change (with linter disabling comment) if it makes the difference more obvious.
|
Landed in 1a25f96 |
Some nits were also fixed in passing. PR-URL: #22537 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Some nits were also fixed in passing. PR-URL: #22537 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Some nits were also fixed in passing. PR-URL: #22537 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Some nits were also fixed in passing. PR-URL: #22537 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesSome nits were also fixed in passing.
cc @nodejs/documentation, @Trott