Ensure that _.transform checks that object is an object before using it as the accumulator [[Prototype]].

This commit is contained in:
John-David Dalton
2014-04-28 08:39:35 -07:00
parent 68702ca43f
commit 2c4657355f
2 changed files with 8 additions and 3 deletions

View File

@@ -6945,9 +6945,10 @@
if (isArr) {
accumulator = [];
} else {
var ctor = object && object.constructor,
proto = ctor && ctor.prototype;
if (isObject(object)) {
var ctor = object.constructor,
proto = ctor && ctor.prototype;
}
accumulator = baseCreate(proto);
}
}