Move lodash instance check up in lodash function and tweak chaining benchmark.

Former-commit-id: 799ae05e5180ee87bb2a5249be3e442ed0425ef7
This commit is contained in:
John-David Dalton
2013-03-04 01:40:55 -08:00
parent 9f19c302d8
commit 35bd7c55d0
9 changed files with 24 additions and 24 deletions

View File

@@ -196,12 +196,12 @@
* @returns {Object} Returns a `lodash` instance.
*/
function lodash(value) {
if (value instanceof lodash) {
return value;
}
if (!(this instanceof lodash)) {
return new lodash(value);
}
if (value instanceof lodash) {
return value;
}
this.__wrapped__ = value;
}