Optimize _.forEach, _.forIn, and _.forOwn.

Former-commit-id: 5d3b83ec0d5240ee14a86421994de86f311089fd
This commit is contained in:
John-David Dalton
2012-11-24 23:02:44 -06:00
parent d2d1d42d0f
commit 221e0e550c
6 changed files with 50 additions and 48 deletions

View File

@@ -1689,7 +1689,9 @@
], function(data) {
if (!data.flag) {
source = source.replace(matchFunction(source, data.methodName), function(match) {
return match.replace(/(callback), *thisArg/g, '$1');
return match
.replace(/(callback), *thisArg/g, '$1')
.replace(/^ *callback *=.+/m, 'callback || (callback = identity);')
});
}
});