Fix typos in build.js and ensure build tests pass.

Former-commit-id: 4c82850ce314e5a7072f90267c755d991f893442
This commit is contained in:
John-David Dalton
2013-06-23 19:33:45 -07:00
parent 12494f3008
commit e209fedb27

View File

@@ -824,8 +824,13 @@
if (result) { if (result) {
return result[1]; return result[1];
} }
// check for the `_.chain` alias if (methodName == 'chain') {
return methodName == 'chain' ? 'Chaining' : ''; return 'Chaining';
}
if (methodName == 'findWhere') {
return 'Collections';
}
return '';
} }
/** /**
@@ -2140,23 +2145,15 @@
// expand categories to methods // expand categories to methods
_.each([includeMethods, minusMethods, plusMethods], function(methodNames) { _.each([includeMethods, minusMethods, plusMethods], function(methodNames) {
var categories = _.intersection(methodNames, methodCategories); var categories = _.intersection(methodNames, methodCategories);
categories.forEach(function(category) { categories.forEach(function(category) {
var otherMethods = getMethodsByCategory(source, category); var otherMethods = getMethodsByCategory(source, category);
// add `chain` and `findWhere`
if (isUnderscore) {
if (_.contains(categories, 'Chaining') && !_.contains(otherMethods, 'chain')) {
otherMethods.push('chain');
}
if (_.contains(categories, 'Collections') && !_.contains(otherMethods, 'findWhere')) {
otherMethods.push('findWhere');
}
}
// limit method names to those available for specific builds // limit method names to those available for specific builds
if (isBackbone) { if (isBackbone) {
otherMethods = _.intersection(methodNames, backboneDependencies); otherMethods = _.intersection(otherMethods, backboneDependencies);
} else if (isUnderscore) { } else if (isUnderscore) {
otherMethods = _.intersection(methodNames, underscoreMethods); otherMethods = _.intersection(otherMethods, underscoreMethods);
} }
push.apply(methodNames, otherMethods); push.apply(methodNames, otherMethods);
}); });