Small clean ups

This commit is contained in:
Slava Kim
2014-06-11 15:05:38 -07:00
committed by David Glasser
parent 16cca65136
commit bc99786c91

View File

@@ -92,8 +92,8 @@ ConstraintSolver.ConstraintsList.prototype.forPackage = function (name, iter) {
// doesn't break on the false return value
ConstraintSolver.ConstraintsList.prototype.each = function (iter) {
var self = this;
mori.each(self.byName, function (coll) {
mori.each(mori.last(coll), function (exactInexactColl) {
mori.each(self.byName, function (nameAndColl) {
mori.each(mori.last(nameAndColl), function (exactInexactColl) {
mori.each(mori.last(exactInexactColl), function (c) {
iter(mori.last(c));
});
@@ -213,7 +213,7 @@ ConstraintSolver.ConstraintsList.prototype.edgeMatchingVersionsFor =
// there is some exact constraint, the choice is obvious
if (exact) {
var uv = exact.getSatisfyingUnitVersion(resolver);
if (_.isEmpty(self.violatedConstraints(uv)))
if (uv && _.isEmpty(self.violatedConstraints(uv)))
return { earliest: uv, latest: uv };
else
return { earliest: null, latest: null };