Simplify iteratorTemplate, createIterator, and _.keys.

Former-commit-id: 89c6d5a0311944e86fa4fca330328e903ce18958
This commit is contained in:
John-David Dalton
2012-11-06 21:59:42 -08:00
parent 482e013887
commit 23a0507439
5 changed files with 78 additions and 84 deletions

View File

@@ -64,10 +64,10 @@
/** Used to track function dependencies */
var dependencyMap = {
'after': [],
'bind': ['isFunction'],
'bind': ['isFunction', 'isObject'],
'bindAll': ['bind', 'functions'],
'chain': ['mixin'],
'clone': ['extend', 'forEach', 'forOwn', 'isArguments', 'isPlainObject'],
'clone': ['extend', 'forEach', 'forOwn', 'isArguments', 'isObject', 'isPlainObject'],
'compact': [],
'compose': [],
'contains': ['indexOf', 'isString', 'some'],
@@ -84,7 +84,7 @@
'find': ['some'],
'first': [],
'flatten': ['isArray'],
'forEach': ['identity'],
'forEach': ['identity', 'isString'],
'forIn': ['identity', 'isArguments'],
'forOwn': ['identity', 'isArguments'],
'functions': ['forIn', 'isFunction'],
@@ -113,10 +113,10 @@
'isRegExp': [],
'isString': [],
'isUndefined': [],
'keys': ['forOwn', 'isArguments'],
'keys': ['forOwn', 'isArguments', 'isObject'],
'last': [],
'lastIndexOf': [],
'lateBind': ['isFunction'],
'lateBind': ['isFunction', 'isObject'],
'map': ['forEach', 'isArray'],
'max': ['forEach', 'isArray', 'isString'],
'memoize': [],
@@ -128,7 +128,7 @@
'omit': ['forIn', 'indexOf'],
'once': [],
'pairs': ['forOwn'],
'partial': ['isFunction'],
'partial': ['isFunction', 'isObject'],
'pick': ['forIn'],
'pluck': ['forEach'],
'random': [],
@@ -1244,7 +1244,7 @@
source = removeKeysOptimization(source);
// remove `prototype` [[Enumerable]] fix from `_.keys`
source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(.+?propertyIsEnumerable[\s\S]+?\n\1}/, '');
source = source.replace(/(?:\s*\/\/.*)*(\s*return *).+?propertyIsEnumerable[\s\S]+?: */, '$1');
// remove `prototype` [[Enumerable]] fix from `iteratorTemplate`
source = source