From b54e28deb7612ba3f670aaf85579f57ce37ba514 Mon Sep 17 00:00:00 2001 From: Johannes Scharlach Date: Thu, 28 Jul 2016 22:00:18 +0200 Subject: [PATCH] Prevent failing circular reference detection. (#2543) --- lodash.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lodash.js b/lodash.js index 792cf41c6..3baa8f2e4 100644 --- a/lodash.js +++ b/lodash.js @@ -2415,9 +2415,6 @@ // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); }); - if (!isFull) { - stack['delete'](value); - } return result; } @@ -3412,6 +3409,7 @@ // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } @@ -6116,6 +6114,7 @@ // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined, mergeDefaults, stack); + stack['delete'](srcValue); } return objValue; }