[Pkg-javascript-commits] [node-module-deps] 204/444: populate streams in order, pass pkg through to readFile()

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:56 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 84314b2433dd24c5dc39ffc240960632ef3bea0d
Author: James Halliday <mail at substack.net>
Date:   Fri May 9 13:23:04 2014 -0700

    populate streams in order, pass pkg through to readFile()
---
 index.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/index.js b/index.js
index 0e67732..0e84b37 100644
--- a/index.js
+++ b/index.js
@@ -174,13 +174,13 @@ Deps.prototype.getTransforms = function (file, pkg) {
     var output = through();
     var dup = duplexer(input, output);
     
-    for (var i = 0; i < transforms.length; i++) {
+    for (var i = 0; i < transforms.length; i++) (function (i) {
         makeTransform(transforms[i], function (err, trs) {
             if (err) return dup.emit('error', err)
-            streams.push(trs);
+            streams[i] = trs;
             if (-- pending === 0) done();
         });
-    }
+    })(i);
     return dup;
     
     function done () {
@@ -254,9 +254,8 @@ Deps.prototype.walk = function (id, parent, cb) {
     
     self.resolve(id, parent, function (err, file, pkg) {
         if (err) return self.emit('error', err);
-        self.readFile(file).pipe(concat(function (body) {
+        self.readFile(file, pkg).pipe(concat(function (body) {
             var src = body.toString('utf8');
-console.log(src); 
             var deps = self.parseDeps(file, src);
             fromDeps(file, src, pkg, deps);
         }));

-- 
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