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
Context
s.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines