summaryrefslogtreecommitdiff
path: root/lib/_stream_transform.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_stream_transform.js')
-rw-r--r--lib/_stream_transform.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js
index 259774c45c..892c80459a 100644
--- a/lib/_stream_transform.js
+++ b/lib/_stream_transform.js
@@ -94,7 +94,6 @@ function Transform(options) {
this._transformState = new TransformState(this);
- // when the writable side finishes, then flush out anything remaining.
var stream = this;
// start out asking for a readable event once data is transformed.
@@ -113,6 +112,7 @@ function Transform(options) {
this._flush = options.flush;
}
+ // When the writable side finishes, then flush out anything remaining.
this.once('prefinish', function() {
if (typeof this._flush === 'function')
this._flush(function(er, data) {