Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup: address review comments
  • Loading branch information
vsemozhetbyt committed Aug 26, 2018
commit de6a65decdb109955399c936e0b713bf3550cdef
7 changes: 3 additions & 4 deletions doc/api/dgram.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,17 +552,16 @@ chained.
### Change to asynchronous `socket.bind()` behavior

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:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/syncrhronous/synchronous/


```js
const s = dgram.createSocket('udp4');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I can change (with linter disabling comment) if it makes the difference more obvious.

s.bind(1234);
s.addMembership('224.0.0.114');
```

must be changed to pass a callback function to the [`dgram.Socket#bind()`][]
function:
Such legacy code would need to be changed to pass a callback function to the
[`dgram.Socket#bind()`][] function:

```js
const s = dgram.createSocket('udp4');
Expand Down
2 changes: 1 addition & 1 deletion doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ type for one of its returned object properties on execution.
### ERR_INVALID_RETURN_VALUE

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, such as when a function is expected to return a promise.

<a id="ERR_INVALID_SYNC_FORK_INPUT"></a>
### ERR_INVALID_SYNC_FORK_INPUT
Expand Down