Skip to content

buffer: stricter `from()` input validation

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.

@cjihrig you opened your PR (https://github.com/nodejs/node/pull/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 (closed)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading