This backports the new `Buffer.allocUnsafeSlow()` API for v5.
This backport includes the new API, test cases, and docs additions.
Already present API and testcases were not changed.
PR-URL: https://github.com/nodejs/node/pull/7169
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Correct alignment on variable assignments that span multiple lines in
preparation for lint rule to enforce such alignment.
PR-URL: https://github.com/nodejs/node/pull/6242
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Reviewed-By: James M Snell <jasnell@gmail.com>
ParseArrayIndex() was requesting a Uint32Value(), but assigning it to an
in32_t. This caused slight differences in error message reported in edge
cases of argument parsing. Fixed by getting the IntegerValue() before
checking if the value is < 0. Added test of API that was affected.
PR-URL: https://github.com/nodejs/node/pull/6084
Reviewed-By: James M Snell <jasnell@gmail.com>
This backports the new `Buffer.alloc()`, `Buffer.allocUnsafe()`,
and `Buffer.from()` APIs for v5.
Also included in this backport is the change that allows fill('')
to zero-fill (as opposed to doing nothing) and the additional
`byteOffset` and `length` arguments for `Buffer(arrayBuffer)` and
`Buffer.from(arrayBuffer)`.
This backport includes the new test cases.
This backport *does not* update all of the internal uses of the
existing `Buffer()` constructor.
This backport also *does not* include the soft deprecation of the
existing `Buffer()` constructor.
PR-URL: https://github.com/nodejs/node/pull/5763
Reviewed-By: Trevor Norris <trev.norris@gmail.com>