From bb78c0ea6d3856335387df56e6e60e2da52effbe Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 20 Jul 2015 09:57:03 -0700 Subject: [PATCH] Provide correct `argsCount` hint to `customizer` functions of clone methods. --- lodash.src.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 78abcb668..509029ea8 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -8447,7 +8447,7 @@ * otherwise they are assigned by reference. If `customizer` is provided it's * invoked to produce the cloned values. If `customizer` returns `undefined` * cloning is handled by the method instead. The `customizer` is bound to - * `thisArg` and invoked with two argument; (value [, index|key, object]). + * `thisArg` and invoked with up to three argument; (value [, index|key, object]). * * **Note:** This method is loosely based on the * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). @@ -8503,7 +8503,7 @@ isDeep = false; } return typeof customizer == 'function' - ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1)) + ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 3)) : baseClone(value, isDeep); } @@ -8511,7 +8511,7 @@ * Creates a deep clone of `value`. If `customizer` is provided it's invoked * to produce the cloned values. If `customizer` returns `undefined` cloning * is handled by the method instead. The `customizer` is bound to `thisArg` - * and invoked with two argument; (value [, index|key, object]). + * and invoked with up to three argument; (value [, index|key, object]). * * **Note:** This method is loosely based on the * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). @@ -8554,7 +8554,7 @@ */ function cloneDeep(value, customizer, thisArg) { return typeof customizer == 'function' - ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) + ? baseClone(value, true, bindCallback(customizer, thisArg, 3)) : baseClone(value, true); } @@ -8749,8 +8749,8 @@ * Performs a deep comparison between two values to determine if they are * equivalent. If `customizer` is provided it's invoked to compare values. * If `customizer` returns `undefined` comparisons are handled by the method - * instead. The `customizer` is bound to `thisArg` and invoked with three - * arguments: (value, other [, index|key]). + * instead. The `customizer` is bound to `thisArg` and invoked with up to + * three arguments: (value, other [, index|key]). * * **Note:** This method supports comparing arrays, booleans, `Date` objects, * numbers, `Object` objects, regexes, and strings. Objects are compared by