Fix _.transform test fail in Safari 8.

This commit is contained in:
John-David Dalton
2016-02-23 10:26:19 -08:00
parent 9c162624fe
commit 45d2fb8a30

View File

@@ -9969,8 +9969,8 @@
*/ */
function isFunction(value) { function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array constructors, and // in Safari 8 which returns 'object' for typed array and weak map constructors,
// PhantomJS 1.9 which returns 'function' for `NodeList` instances. // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value) : ''; var tag = isObject(value) ? objectToString.call(value) : '';
return tag == funcTag || tag == genTag; return tag == funcTag || tag == genTag;
} }
@@ -11977,7 +11977,7 @@
if (isArr) { if (isArr) {
accumulator = isArray(object) ? new Ctor : []; accumulator = isArray(object) ? new Ctor : [];
} else { } else {
accumulator = typeof Ctor == 'function' ? baseCreate(getPrototypeOf(object)) : {}; accumulator = isFunction(Ctor) ? baseCreate(getPrototypeOf(object)) : {};
} }
} else { } else {
accumulator = {}; accumulator = {};