Skip to content

buffer: harden SlowBuffer creation

Now SlowBuffer creation throw misleading Error(which should be ERR_INVALID_ARG_TYPE IMHO) in our newest master since #26162 landed.

screen shot 2019-02-23 at 5 25 41 pm

So harden SlowBuffer creation again, make SlowBuffer function be consistent with the comment of Buffer.allocUnsafeSlow at the same time:

https://github.com/nodejs/node/blob/8ebd339031cf9826629ad780dd35fee130e95985/lib/buffer.js#L291-L299

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

Merge request reports

Loading