From e209fedb27159b216fd5502859d6d1802bca326e Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 23 Jun 2013 19:33:45 -0700 Subject: [PATCH] Fix typos in build.js and ensure build tests pass. Former-commit-id: 4c82850ce314e5a7072f90267c755d991f893442 --- build.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/build.js b/build.js index 6f57d44e0..0d7c967a7 100755 --- a/build.js +++ b/build.js @@ -824,8 +824,13 @@ if (result) { return result[1]; } - // check for the `_.chain` alias - return methodName == 'chain' ? 'Chaining' : ''; + if (methodName == 'chain') { + return 'Chaining'; + } + if (methodName == 'findWhere') { + return 'Collections'; + } + return ''; } /** @@ -2140,23 +2145,15 @@ // expand categories to methods _.each([includeMethods, minusMethods, plusMethods], function(methodNames) { var categories = _.intersection(methodNames, methodCategories); + categories.forEach(function(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 if (isBackbone) { - otherMethods = _.intersection(methodNames, backboneDependencies); + otherMethods = _.intersection(otherMethods, backboneDependencies); } else if (isUnderscore) { - otherMethods = _.intersection(methodNames, underscoreMethods); + otherMethods = _.intersection(otherMethods, underscoreMethods); } push.apply(methodNames, otherMethods); });