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.
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), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines