Skip to content

test: test buffer behavior when zeroFill undefined

Rodrigo Muino Tomonari requested to merge github/fork/Trott/buffer-addon into master

When ArrayBufferAllocator has an undefined zeroFill property, Buffer.allocUnsafe() should zero fill.

Refs: https://github.com/nodejs/node/commit/27e84ddd4e1#commitcomment-19182129

The || [0] (discussed in the Refs: above) is the only piece of code in buffer.js not covered by tests. Ideally, this test would probably be a C++ addon test, but until someone writes that test, this will at least confirm that the intended behavior is correct.

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

test buffer

Merge request reports

Loading