From 66838094474a3087fd8e956a6c372c3afc552ffd Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 16 Jan 2015 02:08:01 -0800 Subject: [PATCH] Adjust handling of typed arrays and `arguments` objects in `baseMergeDeep`. --- lodash.src.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 75f1f20f3..a1ea1acf5 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -2522,9 +2522,11 @@ if (isCommon) { result = srcValue; if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) { - result = isArray(value) ? value : []; - } else if (isPlainObject(srcValue)) { - result = isPlainObject(value) ? value : {}; + result = isArray(value) ? value : arrayCopy(value); + } else if (isPlainObject(srcValue) || isArguments(srcValue)) { + result = isArguments(value) + ? arrayToObject(value) + : (isPlainObject(value) ? value : {}); } } // Add the source value to the stack of traversed objects and associate