From 600148f501db048ad78020e6a3c3571f9b9eccc4 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 16 Jun 2013 20:20:51 -0700 Subject: [PATCH] Track property dependencies in build.js. Former-commit-id: 9ae72c4677f7340e53350702391aa46c328ab81c --- build.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/build.js b/build.js index 3781ad23d..978ef4ee5 100755 --- a/build.js +++ b/build.js @@ -217,6 +217,23 @@ 'findWhere': ['where'] }; + /** Used to track property dependencies */ + var propDependencyMap = { + 'at': ['support'], + 'bind': ['support'], + 'clone': ['support'], + 'isArguments': ['support'], + 'isEmpty': ['support'], + 'isEqual': ['support'], + 'isPlainObject': ['support'], + 'iteratorTemplate': ['support'], + 'keys': ['support'], + 'reduceRight': ['support'], + 'shimIsPlainObject': ['support'], + 'template': ['templateSettings'], + 'toArray': ['support'] + }; + /** Used to inline `iteratorTemplate` */ var iteratorOptions = [ 'args', @@ -2151,6 +2168,12 @@ if (isModern || isUnderscore) { dependencyMap.reduceRight = _.without(dependencyMap.reduceRight, 'isString'); + _.each(['at', 'clone', 'isArguments', 'isEmpty', 'isEqual', 'isPlainObject', 'reduceRight', 'shimIsPlainObject', 'toArray'], function(methodName) { + if (!(isUnderscore && useLodashMethod(methodName))) { + propDependencyMap[methodName] = _.without(propDependencyMap[methodName], 'support'); + } + }); + _.each(['assign', 'basicEach', 'defaults', 'forIn', 'forOwn', 'shimKeys'], function(methodName) { if (!(isUnderscore && useLodashMethod(methodName))) { dependencyMap[methodName] = _.without(dependencyMap[methodName], 'createIterator'); @@ -2181,6 +2204,10 @@ dependencyMap[methodName].push('forEach'); } }); + + if (!(isUnderscore && useLodashMethod('keys'))) { + propDependencyMap.keys = _.without(propDependencyMap.keys, 'support'); + } } } // add method names explicitly