Skip to content

buffer: use a default offset

If none is provided, use zero as a default offset for all read/write operations on the buffer.

This reverts some former changes to make sure the default offset for buffer read / write functions is set to zero. This was possible before due to the implicit type coercion.

I only added support for the functions that do not require a byteLength because writing e.g., buffer.readIntBe(undefined, 4) is very likely a bug in the users code and not expected to be zero.

At the same time I added a documentation-only deprecation for the default offset. There were six modules with > 10dm that used this notation and three of those merged my fix already.

Refs: #18395

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading