diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js index 0a379a7632..1b6bbb00c9 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -89,7 +89,7 @@ function afterTransform(stream, er, data) { var cb = ts.writecb; if (!cb) - return this.emit('error', new Error('no writecb in Transform class')); + return stream.emit('error', new Error('no writecb in Transform class')); ts.writechunk = null; ts.writecb = null;