Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
Add .abort() method
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 26, 2012
1 parent 6634fa9 commit c56946f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/abstract.js
Expand Up @@ -20,6 +20,11 @@ Abstract.prototype.on = function (ev, fn) {
return this
}

Abstract.prototype.abort = function () {
this._aborted = true
this.emit("abort")
}

Abstract.prototype.destroy = function () {}

Abstract.prototype.warn = function (msg, code) {
Expand Down
2 changes: 1 addition & 1 deletion lib/reader.js
Expand Up @@ -191,7 +191,7 @@ Reader.prototype._stat = function (currentStat) {
// special handling for ProxyReaders
if (!me.filter.call(who, who, props)) {
if (!me._disowned) {
me._aborted = true
me.abort()
me.emit("end")
me.emit("close")
}
Expand Down

0 comments on commit c56946f

Please sign in to comment.