Closed vbfox closed 6 years ago
It's possible due to test runners like jest playing with the node runtime object.
The native module can't be required twice but the javascript one can. As the javascript one return a mutated version of the native one it create problems :
exports._writePointer = exports.writePointer exports.writePointer = function writePointer (buf, offset, ptr) { debug('writing pointer to buffer', buf, offset, ptr) exports._writePointer(buf, offset, ptr) exports._attach(buf, ptr) }
After 2+ executions of this code writePointer would call itself and produce a stack overflow exception.
writePointer
Additional info
It's possible due to test runners like jest playing with the node runtime object.
The native module can't be required twice but the javascript one can. As the javascript one return a mutated version of the native one it create problems :
After 2+ executions of this code
writePointer
would call itself and produce a stack overflow exception.Additional info