Remove compiling from _.reject and consolidate iterator option objects.

Former-commit-id: 10eb78c0c4cdfc35317b9ad263768df60f70db40
This commit is contained in:
John-David Dalton
2012-10-14 13:51:51 -07:00
parent 2257c5e547
commit d6ca0199b7
4 changed files with 77 additions and 82 deletions

View File

@@ -135,7 +135,7 @@
'range': [],
'reduce': ['forEach'],
'reduceRight': ['forEach', 'keys'],
'reject': ['identity'],
'reject': ['filter'],
'rest': [],
'result': ['isFunction'],
'shuffle': ['forEach'],
@@ -1191,8 +1191,8 @@
// simplify DOM node check from `_.isEqual`
source = source.replace(/(if *\(className *!= *objectClass).+?noNodeClass[\s\S]+?{/, '$1) {');
// remove "exit early" feature from `_.each`
source = source.replace(/( +)var baseIteratorOptions *=[\s\S]+?\n\1.+?;/, function(match) {
// remove "exit early" feature from `_.forEach`, `_.forIn`, and `_.forOwn`
source = source.replace(/( +)var forEachIteratorOptions *=[\s\S]+?\n\1.+?;/, function(match) {
return match.replace(/if *\(callback[^']+/, 'callback(value, index, collection)');
});