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