Fix dependants not being correctly set in some edge cases.

This commit is contained in:
André Cruz
2013-07-19 13:45:49 +01:00
parent 7e41cd0d32
commit 3e3f5faacc

View File

@@ -357,16 +357,17 @@ Manager.prototype._parseDependencies = function (decEndpoint, pkgMeta, jsonKey)
}, this);
if (compatible) {
// If the compatible's target is equal, do not add to the resolved
// If the compatible target is equal, do not add to the resolved
if (compatible.target === childDecEndpoint.target) {
decEndpoint.dependencies[key] = compatible;
compatible.dependants.push(decEndpoint);
compatible.dependants = this._uniquify(compatible.dependants);
// Copy resolved info from the compatible one
// Otherwise copy resolved info from the compatible one
} else {
childDecEndpoint.canonicalDir = compatible.canonicalDir;
childDecEndpoint.pkgMeta = compatible.pkgMeta;
childDecEndpoint.dependencies = compatible.dependencies;
childDecEndpoint.dependants = [decEndpoint];
this._resolved[key].push(childDecEndpoint);
}
return;