dgram: support Uint8Array input to send()#11985
Closed
addaleax wants to merge 2 commits intonodejs:masterfrom
Closed
dgram: support Uint8Array input to send()#11985addaleax wants to merge 2 commits intonodejs:masterfrom
addaleax wants to merge 2 commits intonodejs:masterfrom
Conversation
jasnell
approved these changes
Mar 22, 2017
lib/dgram.js
Outdated
Member
There was a problem hiding this comment.
Since the error message is changing anyway, can you s/buffer/Buffer here to make it consistent with the other error messages thrown in this module?
TimothyGu
approved these changes
Mar 22, 2017
cjihrig
approved these changes
Mar 22, 2017
d401ef1 to
f1478e9
Compare
Member
Author
joyeecheung
reviewed
Mar 24, 2017
| const port = client.address().port; | ||
| client.send(toSend[0], 0, toSend[0].length, port); | ||
| client.send(toSend[1], port); | ||
| client.send(new Uint8Array([...toSend[1]]), port); |
Member
There was a problem hiding this comment.
This is missing test cases for socket.send(u8a, offset, length, port) and socket.send(buffer, port).
Also, is new Uint8Array([...toSend[1]]) here the same as new Uint8Array(toSend[1])?
Member
Author
There was a problem hiding this comment.
@joyeecheung Right, thanks for pointing that out. I’ve updated the file so all the tests are run twice now, once with the original input types and once with Uint8Arrays.
lpinca
approved these changes
Mar 24, 2017
joyeecheung
approved these changes
Mar 25, 2017
Member
Author
|
Landed in 2dc1053 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #11954
Refs: #11961
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)