-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer bug fix #6775
Buffer bug fix #6775
Changes from 3 commits
f998347
61a4129
bada963
e4b8572
c1d79eb
2db93e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -749,6 +749,11 @@ for (let i = 0; i < 256; i++) { | |
assert.equal(hexb2[i], hexb[i]); | ||
} | ||
|
||
//#6770 Test single hex character throws TypeError | ||
assert.throws(function() { | ||
Buffer.from('A', 'hex'); | ||
}, TypeError); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you put a test to verify there's no regression to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure! Is there a reason why hex throws an error for odd lengths but base64 doesn't? Edit: Don't worry, the final comment for #6107 goes into a bit. |
||
|
||
{ | ||
// test an invalid slice end. | ||
console.log('Try to slice off the end of the buffer'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can reference github issues in comments, but it is usually preferred to give the full URL for things like that so that it’s easier to look up and there is no ambiguity wrt the old issue tracker at https://github.com/nodejs/node-v0.x-archive/