You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read the source code of lib/_stream_writable.js. I have a doubt about the meaning of state.errorEmitted.
Why do we set state.errorEmitted to true in some situations of stream.emit('error'), but doesn't set it in other situations. Moreover, it doesn't achieve emitting 'error' event only one time. For example, as shown below, the code will emit 'error' event two times :
const { Writable } = require('stream');
w = new Writable();
w.on('error', error => {
console.log('on error.', error);
});
w.write(null);
w.write(null);