buffer: fix backwards incompatibility
4a86803f introduced a backwards incompatibility by accident and was not caught due to an existing test that wasn't strict enough.
This commit fixes both the backwards incompatibility and the test.
This changes does not affect performance.
CI: https://ci.nodejs.org/job/node-test-pull-request/7424/
/cc @trott
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
- buffer