Skip to content
Closed
Changes from all commits
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
test: replace port in dgram cd address empty test
Replaced common.PORT in the following test.
test-dgram-send-callback-buffer-empty-address.js

Ref: #12376
  • Loading branch information
vieiraarturg committed May 11, 2017
commit 459f7936912558d44a268efd84d99555631cab4c
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const onMessage = common.mustCall(function(err, bytes) {
client.close();
});

client.send(buf, common.PORT, onMessage);
client.bind(0, () => client.send(buf, client.address().port, onMessage));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably a good idea to wrap the callback in common.mustCall().

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.

Not a bad idea. onMessage() is wrapped in a mustCall(), so in this case not strictly necessary. No strong preference.

Copy link
Copy Markdown
Member

@Trott Trott May 11, 2017

Choose a reason for hiding this comment

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

Ah, yeah, if onMessage is already wrapped then the additional wrapping suggested by me above is actually not needed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah I also find common.mustCall() a bit redundant here which is the reason why I didn't suggest it in the first place.