Skip to content

test,doc: clarify `buf.indexOf(num)` input range

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

buffer

Description of change

Hopefully clarify the behaviour of buffer.indexOf() and buffer.includes() for numbers in that they will be truncated to uint8s.

Add tests for that behaviour.

Fixes: https://github.com/nodejs/node/issues/7591

CI: https://ci.nodejs.org/job/node-test-commit/4022/

Merge request reports

Loading