mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Ensure _.merge assigns typed arrays directly. [closes #1453]
This commit is contained in:
@@ -2584,7 +2584,7 @@
|
||||
if (isArray(srcValue) || isTypedArray(srcValue)) {
|
||||
newValue = isArray(oldValue)
|
||||
? oldValue
|
||||
: ((isObject(oldValue) && isArrayLike(oldValue)) ? copyArray(oldValue) : []);
|
||||
: ((isObject(oldValue) && isArrayLike(oldValue)) ? copyArray(oldValue) : srcValue);
|
||||
}
|
||||
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
||||
newValue = isArguments(oldValue)
|
||||
|
||||
@@ -12237,7 +12237,7 @@
|
||||
|
||||
function Foo() {}
|
||||
|
||||
var values = [new Foo, new Boolean, new Date, Foo, new Number, new String, new RegExp],
|
||||
var values = [new Foo, new Boolean, new Date, Foo, new Number, new String, new RegExp, new (Uint8Array || noop)],
|
||||
expected = _.map(values, _.constant(true));
|
||||
|
||||
var actual = _.map(values, function(value) {
|
||||
|
||||
Reference in New Issue
Block a user