Skip to content

buffer: throw exception when creating from non-Node.js Context

Throw an exception instead of crashing when attempting to create Buffer objects from a Context that is not associated with a Node.js Environment.

Possible alternatives for the future might be just returning a plain Uint8Array, or working on providing Buffer for all Contexts.

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