Commit 70904813 authored by Сковорода Никита Андреевич's avatar Сковорода Никита Андреевич Committed by Myles Borins
Browse files

buffer: backport new buffer constructor APIs to v4.x

This backports the new `Buffer.alloc()`, `Buffer.allocUnsafe()`,
`Buffer.from()`, and `Buffer.allocUnsafeSlow()` APIs for v4.

Some backported tests are disabled, but those are not related to the
new API.

Note that `Buffer.from(arrayBuffer[, byteOffset [, length]])` is not
supported in v4.x, only `Buffer.from(arrayBuffer)` is.

Refs: https://github.com/nodejs/node/pull/4682
Refs: https://github.com/nodejs/node/pull/5833
Refs: https://github.com/nodejs/node/pull/7475
PR-URL: https://github.com/nodejs/node/pull/7562


Reviewed-By: default avatarTrevor Norris <trev.norris@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarNikolai Vavilov <vvnicholas@gmail.com>
parent 200429e9
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment