Skip to content

Commit

Permalink
Implement simple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-tymoshenko committed Nov 5, 2018
1 parent 95119eb commit 9207dfd
Show file tree
Hide file tree
Showing 4 changed files with 4,766 additions and 326 deletions.
3 changes: 2 additions & 1 deletion lib/writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class Writable extends EventEmitter {
}

error(err, cb) {
console.log(cb);
if (cb && typeof cb === 'function') {
process.nextTick(cb, err);
}
Expand Down Expand Up @@ -138,11 +137,13 @@ class Writable extends EventEmitter {
if (this.ended) {
const err = new Error('[ERR_STREAM_WRITE_AFTER_END]');
this.error(err, cb);
return;
}

if (this.destroyed) {
const err = new Error('[ERR_STREAM_DESTROYED]');
this.emit(err, cb);
return;
}

if (!encoding) {
Expand Down
Loading

0 comments on commit 9207dfd

Please sign in to comment.