revisions to #534, sortBy(undefined)

This commit is contained in:
Jeremy Ashkenas
2012-04-02 13:16:58 -04:00
parent 60adb34d0c
commit d604895018
2 changed files with 5 additions and 2 deletions

View File

@@ -270,8 +270,8 @@
};
}).sort(function(left, right) {
var a = left.criteria, b = right.criteria;
if (_.isUndefined(a)) return 1;
if (_.isUndefined(b)) return -1;
if (a === void 0) return 1;
if (b === void 0) return -1;
return a < b ? -1 : a > b ? 1 : 0;
}), 'value');
};