Remove chainability from _.forEach in the lodash underscore build.

Former-commit-id: 1db7daafacddcf78492643d6c6301af706b92150
This commit is contained in:
John-David Dalton
2012-10-24 19:49:26 -07:00
parent 7457001275
commit 447e43e8f4
3 changed files with 17 additions and 10 deletions

View File

@@ -1327,6 +1327,11 @@
});
}());
// remove chainability from `_.forEach`
source = source.replace(matchFunction(source, 'forEach'), function(match) {
return match.replace(/return result([};\s]+)$/, '$1');
});
// unexpose "exit early" feature from `_.forEach`, `_.forIn`, and `_.forOwn`
_.each(['forEach', 'forIn', 'forOwn'], function(methodName) {
source = source.replace(matchFunction(source, methodName), function(match) {