basic error reporting works

This commit is contained in:
Slava Kim
2014-05-08 15:02:31 -07:00
parent 3a61c50e97
commit 002138bee6
2 changed files with 9 additions and 2 deletions

View File

@@ -165,6 +165,7 @@ Tinytest.add("constraint solver - no constraint dependency - anything", function
test.isTrue(_.isString(versions.sparkle));
});
Tinytest.add("constraint solver - no constraint dependency - transitive dep still picked right", function (test) {
currentTest = test;
var versions = resolver.resolve({ "sparkle": "none", "sparky-forms": "1.1.2" }, { mode: "CONSERVATIVE" });

View File

@@ -287,13 +287,15 @@ ConstraintSolver.Resolver.prototype._propagateExactTransDeps =
transitiveConstraints = transitiveConstraints.union(uv.constraints);
});
var newChoices = exactTransitiveDepsVersions;
dependencies = dependencies.union(inexactTransitiveDeps);
constraints = constraints.union(transitiveConstraints);
choices = _.union(choices, exactTransitiveDepsVersions);
choices = _.union(choices, newChoices);
// Since exact transitive deps are put into choices, there is no need to
// keep them in dependencies.
_.each(choices, function (uv) {
_.each(newChoices, function (uv) {
dependencies = dependencies.remove(uv.name);
});
@@ -322,6 +324,10 @@ ConstraintSolver.Resolver.prototype._propagateExactTransDeps =
queue.push(dep);
isEnqueued[dep.name] = true;
});
// for error reporting
uv.constraints.each(function (c) {
constraintAncestor[c.toString()] = uv.name; });
}
// Update the constraintAncestor table