[Pkg-javascript-commits] [node-module-deps] 30/444: fix for deps.length === 0, old bundle tests pass again

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:40 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 5b27244babef2568306e124fbff12733a684bada
Author: James Halliday <mail at substack.net>
Date:   Tue Feb 26 19:05:17 2013 -0800

    fix for deps.length === 0, old bundle tests pass again
---
 index.js | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/index.js b/index.js
index 9a203f6..19da475 100644
--- a/index.js
+++ b/index.js
@@ -58,18 +58,21 @@ module.exports = function (mains, opts) {
         deps.forEach(function (id) {
             walk(id, current, function (r) {
                 resolved[id] = r;
-                if (--p > 0) return;
-                
-                var rec = {
-                    id: file,
-                    source: src,
-                    deps: resolved
-                };
-                if (mains.indexOf(r) >= 0) {
-                    rec.entry = true;
-                }
-                output.queue(rec);
+                if (--p === 0) done();
             });
         });
+        if (deps.length === 0) done();
+        
+        function done () {
+            var rec = {
+                id: file,
+                source: src,
+                deps: resolved
+            };
+            if (mains.indexOf(file) >= 0) {
+                rec.entry = true;
+            }
+            output.queue(rec);
+        }
     }
 };

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