diff --git a/lib/abstract.js b/lib/abstract.js index add48b9..5675d4a 100644 --- a/lib/abstract.js +++ b/lib/abstract.js @@ -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) { diff --git a/lib/reader.js b/lib/reader.js index 732eb68..4552013 100644 --- a/lib/reader.js +++ b/lib/reader.js @@ -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") }