| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Or Buffer.isBuffer?
Sorry, something went wrong.
There was a problem hiding this comment.
I chose instanceof for consistency (Buffer.isBuffer is never used in this file).
Sorry, something went wrong.
There was a problem hiding this comment.
I was suggesting that because, if we change how we detect Buffers (which will be implemented in isBuffer) later on, then we don't have to change this line.
Sorry, something went wrong.
There was a problem hiding this comment.
OK, I changed it.
Sorry, something went wrong.
|
LGTM with one comment. |
Sorry, something went wrong.
|
LGTM with cjihrig's comment |
Sorry, something went wrong.
Sorry, something went wrong.
|
Marking semver-major because of the error message change. |
Sorry, something went wrong.
|
I'm not sure I would classify this as semver-major. This isn't a change to an existing error message. Every bug fix is technically a behavior change. |
Sorry, something went wrong.
|
I agree with you. Then it would be a candidate for LTS ? |
Sorry, something went wrong.
|
Overall, This looks to me as just an error message change. Does this qualify for backporting? @jasnell @thealphanerd |
Sorry, something went wrong.
|
The existing code was already checking for an array, and throwing this same error. It was a bug on our part that we didn't do adequate checking. |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
Without this change, if any of the elements in the list to be concatenated is not a Buffer instance, the method fails with "buf.copy is not a function". Make an isBuffer check before using the copy method so that we can throw with a better message. Fixes: nodejs#4949 PR-URL: nodejs#4951 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
|
@nodejs/lts this commit adds a new error string "list" argument must be an Array of Buffers, in addition to an existing list argument must be an Array of Buffers on everything but master due to a semver-major change to error messages. To remain consistent with the existing error message and to not introduce a new one that's different to the existing by two " characters, this commit should be changed to remove the "'s from lib/buffer.js as well as test/parallel/test-buffer-concat.js when cherry-picking. |
Sorry, something went wrong.
Without this change, if any of the elements in the list to be concatenated is not a Buffer instance, the method fails with "buf.copy is not a function". Make an isBuffer check before using the copy method so that we can throw with a better message. Fixes: #4949 PR-URL: #4951 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
|
@rvagg in that case shouldn't it just be changed in master as well? seems strange to only change it on cherry-pick. |
Sorry, something went wrong.
|
@trevnorris no because master has a change that unifies all error messages, giving them consistent formatting. So what's in this is correct and nice and consistent with the rest of the codebase but that's not true of v5.x and v4.x where we need to be internally consistent with this particular file and this particular function. |
Sorry, something went wrong.
|
#3374 thar it is, I think there may be more work ontop of that as well |
Sorry, something went wrong.
|
Removed lts-watch-v4.x, this is breaking in userland, see rvagg/bl#26, moscajs/mosca#412 |
Sorry, something went wrong.
|
Should we label it as dont-land-on-v4.x then ? |
Sorry, something went wrong.
|
sure, done, but tbh I'm not sure if that's even used, @thealphanerd can you clarify how we should be using lts-watch-v4.x and/or dont-land-on-v4.x? |
Sorry, something went wrong.
|
@rvagg we definitely use dont-land-on-v4.x lts-watch is applied when a PR needs to be reviewed dont-land is added when we know a commit will not be backported. dont-land is particularly useful when doing audits of master to make sure we didn't miss anything |
Sorry, something went wrong.
Without this change, if any of the elements in the list to be concatenated is not a Buffer instance, the method fails with "buf.copy is not a function". Make an isBuffer check before using the copy method so that we can throw with a better message. Fixes: nodejs#4949 PR-URL: nodejs#4951 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
| Back | FazBrowse Home | New Git URL |
buffer: validate list elements in Buffer.concat
Without this change, if any of the elements in the list to be concatenated
is not a Buffer instance, the method fails with "buf.copy is not a function".
Make an instanceof check before using the copy method so that we can throw
a with a better message.
Fixes: #4949