aboutsummaryrefslogtreecommitdiff
path: root/node_modules/end-of-stream
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/end-of-stream')
-rw-r--r--node_modules/end-of-stream/index.js8
-rw-r--r--node_modules/end-of-stream/package.json2
2 files changed, 7 insertions, 3 deletions
diff --git a/node_modules/end-of-stream/index.js b/node_modules/end-of-stream/index.js
index b3a906863..be426c227 100644
--- a/node_modules/end-of-stream/index.js
+++ b/node_modules/end-of-stream/index.js
@@ -39,6 +39,10 @@ var eos = function(stream, opts, callback) {
callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
};
+ var onerror = function(err) {
+ callback.call(stream, err);
+ };
+
var onclose = function() {
if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close'));
if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close'));
@@ -62,7 +66,7 @@ var eos = function(stream, opts, callback) {
stream.on('end', onend);
stream.on('finish', onfinish);
- if (opts.error !== false) stream.on('error', callback);
+ if (opts.error !== false) stream.on('error', onerror);
stream.on('close', onclose);
return function() {
@@ -75,7 +79,7 @@ var eos = function(stream, opts, callback) {
stream.removeListener('finish', onfinish);
stream.removeListener('exit', onexit);
stream.removeListener('end', onend);
- stream.removeListener('error', callback);
+ stream.removeListener('error', onerror);
stream.removeListener('close', onclose);
};
};
diff --git a/node_modules/end-of-stream/package.json b/node_modules/end-of-stream/package.json
index 81315b690..8d19493c9 100644
--- a/node_modules/end-of-stream/package.json
+++ b/node_modules/end-of-stream/package.json
@@ -1,6 +1,6 @@
{
"name": "end-of-stream",
- "version": "1.4.0",
+ "version": "1.4.1",
"description": "Call a callback when a readable/writable/duplex stream has completed or failed.",
"repository": {
"type": "git",