From 447e43e8f409d267663c88c257610ef3c6b26649 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 24 Oct 2012 19:49:26 -0700 Subject: [PATCH] Remove chainability from `_.forEach` in the `lodash underscore` build. Former-commit-id: 1db7daafacddcf78492643d6c6301af706b92150 --- build.js | 5 +++++ lodash.underscore.min.js | 4 ++-- test/test-build.js | 18 ++++++++++-------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/build.js b/build.js index 2bfe33dbd..b654d8fb1 100755 --- a/build.js +++ b/build.js @@ -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) { diff --git a/lodash.underscore.min.js b/lodash.underscore.min.js index de12e73ff..786ca016a 100644 --- a/lodash.underscore.min.js +++ b/lodash.underscore.min.js @@ -2,8 +2,8 @@ Lo-Dash 0.9.0 lodash.com/license Underscore.js 1.4.2 underscorejs.org/LICENSE */ -;(function(e,t){function s(e,t,n){var r;if(!e)return e;var t=p(t,n),i=e.length,n=-1;if("number"==typeof i)for(;++nn||e===t)return 1;if(en||e===t)return 1;if(e