Now the test/parallel/test-buffer-bindingobj-no-zerofill.js uses monkey-patches to simulate the situation when setupBufferJS() has an undefined zeroFill.
|
// Load from file system because internal buffer is already loaded and we're |
|
// testing code that runs on first load only. |
|
// Do not move this require() to top of file. It is important that |
|
// `require('internal/buffer').setupBufferJS` be monkey-patched before this |
|
// runs. |
|
const monkeyPatchedBuffer = require('../../lib/buffer'); |
But the monkey-patches are little bit tricky and crash the tests when we move buffer module to internalBinding (#22370 (comment))
We need replace it by a C++ addon test now. See conversation at 27e84ddd4e1#r19182129 and #11706.
/cc @Trott @bnoordhuis
Now the
test/parallel/test-buffer-bindingobj-no-zerofill.jsuses monkey-patches to simulate the situation whensetupBufferJS()has an undefined zeroFill.node/test/parallel/test-buffer-bindingobj-no-zerofill.js
Lines 29 to 34 in 49bfc37
But the monkey-patches are little bit tricky and crash the tests when we move buffer module to internalBinding (#22370 (comment))
We need replace it by a C++ addon test now. See conversation at 27e84ddd4e1#r19182129 and #11706.
/cc @Trott @bnoordhuis