summaryrefslogtreecommitdiff
path: root/test/parallel/test-buffer-zero-fill-reset.js
Commit message (Collapse)AuthorAgeFilesLines
* test: changed buffer-zero outputheeeunkimmm2017-10-081-1/+1
| | | | | | | Added interpolated strings to display the error value PR-URL: https://github.com/nodejs/node/pull/15926 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* buffer: add .from(), .alloc() and .allocUnsafe()James M Snell2016-03-161-1/+1
| | | | | | | | | | | | | | | Several changes: * Soft-Deprecate Buffer() constructors * Add `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()` * Add `--zero-fill-buffers` command line option * Add byteOffset and length to `new Buffer(arrayBuffer)` constructor * buffer.fill('') previously had no effect, now zero-fills * Update the docs PR-URL: https://github.com/nodejs/node/pull/4682 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
* lib,test: update let to const where applicableSakthipriyan Vairamani2015-10-271-1/+1
| | | | | | | | | | | | | As per the `prefer-const` eslint rule, few instances of `let` have been identified to be better with `const`. This patch updates all those instances. Refer: https://github.com/nodejs/node/issues/3118 PR-URL: https://github.com/nodejs/node/pull/3152 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
* buffer: don't set zero fill for zero-length bufferTrevor Norris2015-09-181-0/+19
Instantiating a Buffer of length zero would set the kNoZeroFill flag to true but never actually call ArrayBuffer::Allocator(). Which means the flag was never set back to false. The result was that the next allocation would unconditionally not be zero filled. Add test to ensure Uint8Array's are zero-filled after creating a Buffer of length zero. This test may falsely succeed, but will not falsely fail. Fix: https://github.com/nodejs/node/issues/2930 PR-URL: https://github.com/nodejs/node/pull/2931 Reviewed-By: Rod Vagg <rod@vagg.org>