-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
test, bechmark: use new Buffer API where appropriate #18980
Conversation
@@ -3,6 +3,7 @@ | |||
require('../common'); | |||
const assert = require('assert'); | |||
|
|||
// Tests deprecated Buffer API on a purpose |
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.
Maybe write this as "Tests the deprecated Buffer() constructor"
If you don't change it, "on a purpose" should be "on purpose"
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.
Technically, the first line of those two (Buffer(100)
) is not a constructor call by itself, it's the commit description which is a bit inaccurate there (but rewording will make it needlessly longer).
I will fix the language though, thanks!
For tests / benchmarks that are creating Buffer instances for any reason other than to test Buffer constructor, use the new Buffer.alloc/Buffer.from API instead of the deprecated API.
be71228
to
bc15526
Compare
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.
LGTM
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.
LGTM. We might actually introduce a linting rule so it does not sneak back in at some point.
CI https://ci.nodejs.org/job/node-test-pull-request/13428/ @ChALkeR please always start a CI after opening a PR :-) |
Landed in 8ed44ff |
For tests / benchmarks that are creating Buffer instances for any reason other than to test Buffer constructor, use the new Buffer.alloc/Buffer.from API instead of the deprecated API. PR-URL: #18980 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
For tests / benchmarks that are creating Buffer instances for any reason other than to test Buffer constructor, use the new Buffer.alloc/Buffer.from API instead of the deprecated API. PR-URL: nodejs#18980 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
For tests / benchmarks that are creating Buffer instances for any reason other than to test Buffer constructor, use the new Buffer.alloc/Buffer.from API instead of the deprecated API. PR-URL: nodejs#18980 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
If this needs to be backported to 8.x, a separate backport PR will be necessary. |
For tests / benchmarks that are creating Buffer instances for any reason other than to test Buffer constructor, use the new
Buffer.alloc
/Buffer.from
API instead of the deprecated API.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test, benchmark