mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Fix _.transform test fail in Safari 8.
This commit is contained in:
@@ -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 = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user