From 5458b007d174ac404622dda703f51523bbb96de6 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 28 Aug 2014 00:09:16 -0700 Subject: [PATCH] Cleanup default assignment of placeholders. --- lodash.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lodash.js b/lodash.js index cefd78a29..53992eef1 100644 --- a/lodash.js +++ b/lodash.js @@ -9321,12 +9321,6 @@ /*--------------------------------------------------------------------------*/ - // ensure `new lodashWrapper` is an instance of `lodash` - lodashWrapper.prototype = lodash.prototype; - - // assign default placeholders - bind.placeholder = bindKey.placeholder = curry.placeholder = curryRight.placeholder = partial.placeholder = partialRight.placeholder = lodash; - // add functions that return wrapped values when chaining lodash.after = after; lodash.assign = assign; @@ -9561,12 +9555,18 @@ */ lodash.VERSION = VERSION; + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + // add "Chaining" functions to the wrapper lodash.prototype.chain = wrapperChain; - lodash.prototype.toJSON = wrapperValueOf; lodash.prototype.toString = wrapperToString; - lodash.prototype.value = wrapperValueOf; - lodash.prototype.valueOf = wrapperValueOf; + lodash.prototype.toJSON = lodash.prototype.value = lodash.prototype.valueOf = wrapperValueOf; + + // assign default placeholders + arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { + lodash[methodName].placeholder = lodash; + }); // add `Array` functions that return unwrapped values arrayEach(['join', 'pop', 'shift'], function(methodName) {