Make remove compiling from _.merge, _.countBy, _.groupBy, _.pick, _.omit, and _.sortBy.

Former-commit-id: 52b245e69629e7a9fbe5f0dcbdfafabcd75d9dfc
This commit is contained in:
John-David Dalton
2012-10-13 00:03:40 -07:00
parent 10c87012be
commit 1dda31a28c
3 changed files with 144 additions and 170 deletions

View File

@@ -71,7 +71,7 @@
'compact': [],
'compose': [],
'contains': [],
'countBy': ['identity'],
'countBy': ['forEach', 'identity'],
'debounce': [],
'defaults': ['isArguments'],
'defer': [],
@@ -88,7 +88,7 @@
'forIn': ['identity', 'isArguments'],
'forOwn': ['identity', 'isArguments'],
'functions': ['isArguments', 'isFunction'],
'groupBy': ['identity'],
'groupBy': ['forEach', 'identity'],
'has': [],
'identity': [],
'indexOf': ['sortedIndex'],
@@ -120,16 +120,16 @@
'map': ['identity'],
'max': ['forEach'],
'memoize': [],
'merge': ['isArray', 'isPlainObject'],
'merge': ['forOwn', 'isArray', 'isPlainObject'],
'min': ['forEach'],
'mixin': ['forEach', 'functions'],
'noConflict': [],
'object': [],
'omit': ['indexOf', 'isArguments'],
'omit': ['forIn', 'indexOf', 'isArguments'],
'once': [],
'pairs': [],
'partial': ['isFunction'],
'pick': [],
'pick': ['forIn'],
'pluck': [],
'random': [],
'range': [],
@@ -141,7 +141,7 @@
'shuffle': ['forEach'],
'size': ['keys'],
'some': ['identity'],
'sortBy': ['identity'],
'sortBy': ['forEach', 'identity'],
'sortedIndex': ['identity'],
'tap': ['mixin'],
'template': ['escape'],
@@ -1247,11 +1247,6 @@
source = source.replace(reFunc, '$1' + getFunctionSource(lodash[methodName]) + ';\n');
});
// replace `callee` in `_.merge` with `merge`
source = source.replace(matchFunction(source, 'merge'), function(match) {
return match.replace(/\bcallee\b/g, 'merge');
});
if (isUnderscore) {
// remove "compiled template cleanup" from `_.template`
source = source.replace(/(?:\s*\/\/.*)*\n *source *=.+?isEvaluating.+?reEmptyStringLeading[\s\S]+?\);/, '');