From 1bdf74951a9cb4cf96a1b2fbcbcb16458c651428 Mon Sep 17 00:00:00 2001 From: Benjamin Tan Date: Tue, 25 Mar 2014 11:30:06 +0800 Subject: [PATCH] Simplify `_.chain` --- lodash.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lodash.js b/lodash.js index 6df39f374..a7077aece 100644 --- a/lodash.js +++ b/lodash.js @@ -784,7 +784,7 @@ * * @private * @param {*} value The value to wrap in a `lodash` instance. - * @param {boolean} [chainAll=false] A flag to enable chaining for all methods + * @param {boolean} [chainAll=false] A flag to enable chaining for all methods. * @returns {Object} Returns a `lodash` instance. */ function lodashWrapper(value, chainAll) { @@ -3446,9 +3446,7 @@ * // => 'pebbles is 1' */ function chain(value) { - value = new lodashWrapper(value); - value.__chain__ = true; - return value; + return new lodashWrapper(value, true); } /**