[Pkg-javascript-commits] [node-module-deps] 258/444: passing source test

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:48:01 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 a6a8c1dc881c8b231c9cc38ec458cca5a3180525
Author: James Halliday <mail at substack.net>
Date:   Sun Jul 20 03:56:15 2014 -0700

    passing source test
---
 index.js       | 9 +++++++--
 test/source.js | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index cf59d76..3384cac 100644
--- a/index.js
+++ b/index.js
@@ -238,14 +238,19 @@ Deps.prototype.walk = function (id, parent, cb) {
         }
         self.visited[file] = true;
         
+        if (rec.source) return fromSource(rec.source);
+        
         var c = self.cache && self.cache[file];
         if (c) return fromDeps(file, c.source, c.package, Object.keys(c.deps));
         
         self.readFile(file, pkg).pipe(concat(function (body) {
-            var src = body.toString('utf8');
+            fromSource(body.toString('utf8'));
+        }));
+        
+        function fromSource (src) {
             var deps = self.parseDeps(file, src);
             if (deps) fromDeps(file, src, pkg, deps);
-        }));
+        }
     });
     
     function fromDeps (file, src, pkg, deps) {
diff --git a/test/source.js b/test/source.js
index b554f46..2023323 100644
--- a/test/source.js
+++ b/test/source.js
@@ -32,7 +32,7 @@ test('source', function (t) {
                 id: files.main,
                 source: sources.main,
                 entry: true,
-                deps: { './foo': files.foo }
+                deps: { './foo': files.foo, './extra.js': files.extra }
             },
             {
                 id: files.foo,

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