-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: stricter from()
input validation
#26825
Conversation
So far we did not throw an error for all types of invalid input. Functions do not return a buffer anymore and `number` and `symbol` validation is also improved.
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
Recent code changes require this change.
Yeah I guess the function thing is technically semver-major but it is quite certainly an error and trap. |
@nodejs/buffer PTAL |
@targos @mcollina are you fine landing this as semver-patch? CITGM master https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1782/ |
I’m fine as patch. |
Landed in 75eaf25 |
So far we did not throw an error for all types of invalid input. Functions do not return a buffer anymore and `number` and `symbol` validation is also improved. PR-URL: #26825 Fixes: #26741 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
So far we did not throw an error for all types of invalid input. Functions do not return a buffer anymore and `number` and `symbol` validation is also improved. PR-URL: #26825 Fixes: #26741 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
So far we did not throw an error for all types of invalid input. Functions do not return a buffer anymore and `number` and `symbol` validation is also improved. PR-URL: #26825 Fixes: #26741 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
So far we did not throw an error for all types of invalid input.
Functions do not return a buffer anymore and
number
andsymbol
validation is also improved.
@cjihrig you opened your PR (#26743) to address the function part first. Please feel free to reopen your PR and I'll either rebase on top of your or just close mine if you would like to pull in my changes.
@ChALkeR you also said that you have a PR almost ready, I am happy to close this one.
@nodejs/tsc is this semver-major because of the function validation (if a function is passed in, it seems like a bug, so I am not sure)? The message part is AFAIK not semver-major.
Fixes: #26741
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes