[Pkg-javascript-commits] [node-module-deps] 305/444: Fix for Deps.readFile emitting file errors on the wrong emitter.

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:48:07 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-module-deps.

commit a8716b18aecb10f68af433e97b3ab918f5ae6924
Author: Joris van der Wel <joris at jorisvanderwel.com>
Date:   Wed Sep 3 23:23:30 2014 +0200

    Fix for Deps.readFile emitting file errors on the wrong emitter.
---
 index.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index 95bea57..b7efde3 100644
--- a/index.js
+++ b/index.js
@@ -130,6 +130,7 @@ Deps.prototype.resolve = function (id, parent, cb) {
 };
 
 Deps.prototype.readFile = function (file, id, pkg) {
+    var self = this;
     var tr = through();
     if (this.cache && this.cache[file]) {
         tr.push(this.cache[file].source);
@@ -137,7 +138,7 @@ Deps.prototype.readFile = function (file, id, pkg) {
         return tr;
     }
     var rs = fs.createReadStream(file);
-    rs.on('error', function (err) { tr.emit('error', err) });
+    rs.on('error', function (err) { self.emit('error', err) });
     this.emit('file', file, id);
     return rs;
 };

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git



More information about the Pkg-javascript-commits mailing list