Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix case where dependencies are rendered out of order

all tests passing again.
  • Loading branch information...
commit 8e3eb309409c04d8c3fb050aab2492de305b7cca 1 parent 9604fc1
Andrew Kelley authored
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/jspackage.js
14 lib/jspackage.js
View
@@ -198,9 +198,15 @@ function resolveDepend(dep, doneResolvingDepend){
}
function resolveDependencyChain(root, doneResolvingDependencyChain){
var files = [];
- var seen = {};
processNode(root, function(err){
- doneResolvingDependencyChain(err, files);
+ // remove duplicates
+ var seen = {};
+ var uniqueFiles = files.filter(function(file) {
+ var notDupe = !seen[file.path];
+ seen[file.path] = true;
+ return notDupe;
+ });
+ doneResolvingDependencyChain(err, uniqueFiles);
});
function processNode(node, doneProcessingNode){
async.map(node.deps, resolveDepend, function(err, resolved_deps){
@@ -213,10 +219,6 @@ function resolveDependencyChain(root, doneResolvingDependencyChain){
for (i$ = 0, len$ = resolved_deps.length; i$ < len$; ++i$) {
var dep = resolved_deps[i$];
var file = cached_files[dep.path];
- if (seen[file.path] != null) {
- continue;
- }
- seen[file.path] = true;
funcs.push(async.apply(processNode, file));
}
async.parallel(funcs, function(err, results){
Please sign in to comment.
Something went wrong with that request. Please try again.