Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: keep cif structs alive during gc
Up until now, test/callback.js assumed that the `cb.cif` object would not be garbage collected and was available to `Callback::Invoke`. That has never been a valid assumption, but as of nodejs/node#12141 Buffers created with `new Buffer(n)` each have their own `ArrayBuffer` which gets garbage-collected much more easily, which in turn would crash the test suite here. To (lazy-)fix this, assign `cb._cif` to some global variable that is guaranteed to stay alive.
- Loading branch information