[Pkg-javascript-commits] [node-module-deps] 212/444: fixed cycle test

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 76b7dc3aeac85535b6b8c9f4c9dda04fec3bf51f
Author: James Halliday <mail at substack.net>
Date:   Fri May 9 14:40:12 2014 -0700

    fixed cycle test
---
 index.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/index.js b/index.js
index 70648fe..5ee38b7 100644
--- a/index.js
+++ b/index.js
@@ -258,6 +258,12 @@ Deps.prototype.walk = function (id, parent, cb) {
     
     self.resolve(id, parent, function (err, file, pkg) {
         if (err) return self.emit('error', err);
+        if (self.visited[file]) {
+            if (-- self.pending === 0) self.push(null);
+            return cb(null, file);
+        }
+        self.visited[file] = true;
+        
         self.readFile(file, pkg).pipe(concat(function (body) {
             var src = body.toString('utf8');
             var deps = self.parseDeps(file, src);

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