Use typeof for function checks instead of isFunction.

This commit is contained in:
John-David Dalton
2016-02-22 21:36:27 -08:00
parent cc4b49226b
commit c1f8e31775

View File

@@ -5127,7 +5127,7 @@
* @returns {Object} Returns the initialized clone. * @returns {Object} Returns the initialized clone.
*/ */
function initCloneObject(object) { function initCloneObject(object) {
return (isFunction(object.constructor) && !isPrototype(object)) return (typeof object.constructor == 'function' && !isPrototype(object))
? baseCreate(getPrototypeOf(object)) ? baseCreate(getPrototypeOf(object))
: {}; : {};
} }
@@ -5276,7 +5276,7 @@
*/ */
function isPrototype(value) { function isPrototype(value) {
var Ctor = value && value.constructor, var Ctor = value && value.constructor,
proto = (isFunction(Ctor) && Ctor.prototype) || objectProto; proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto; return value === proto;
} }
@@ -12001,7 +12001,7 @@
if (isArr) { if (isArr) {
accumulator = isArray(object) ? new Ctor : []; accumulator = isArray(object) ? new Ctor : [];
} else { } else {
accumulator = isFunction(Ctor) ? baseCreate(getPrototypeOf(object)) : {}; accumulator = typeof Ctor == 'function' ? baseCreate(getPrototypeOf(object)) : {};
} }
} else { } else {
accumulator = {}; accumulator = {};