Skip to content

buffer,errors: add missing n literal in range error string

This adds the missing n literal for BigInt range errors in buffers.

Here's an example from the REPL with arrows pointing at where the n literal is missing.

> const buffer = Buffer.alloc(1024)
undefined
> buffer.writeBigInt64BE(2n ** 64n)
Uncaught:
RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= -(2n ** 63n) and < 2 ** 63n. Received 18_446_744_073_709_551_616n
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>^
    at checkInt (internal/buffer.js:67:11)
    at writeBigU_Int64BE (internal/buffer.js:600:3)
    at Buffer.writeBigInt64BE (internal/buffer.js:631:10)
    at repl:1:8
    at Script.runInThisContext (vm.js:132:18)
    at REPLServer.defaultEval (repl.js:472:29)
    at bound (domain.js:430:14)
    at REPLServer.runBound [as eval] (domain.js:443:12)
    at REPLServer.onLine (repl.js:794:10)
    at REPLServer.emit (events.js:326:22) {
  code: 'ERR_OUT_OF_RANGE'
}

Merge request reports

Loading