Simplify null/undefined check in _.isEqual and edit _.cloneDeep docs.

Former-commit-id: 62455ba83df04318856fbc889743f44101b24fe3
This commit is contained in:
John-David Dalton
2013-01-25 00:20:55 -08:00
parent 0fc2ab4d41
commit 98eccf223a
5 changed files with 12 additions and 12 deletions

View File

@@ -653,7 +653,7 @@
*
* @private
* @param {Object} [options1, options2, ...] The compile options object(s).
* arrays - A boolean to specify support for iterating arrays and array-like objects.
* arrays - A string of code to determine if the iteratee is an array or array-like.
* useHas - A boolean to specify using `hasOwnProperty` checks in the object loop.
* args - A string of comma separated arguments the iteration function will accept.
* top - A string of code to execute before the iteration branches.
@@ -672,7 +672,7 @@
'shadowed': shadowed,
// iterator options
'arrays': "isArray(iteratee)",
'arrays': 'isArray(iteratee)',
'bottom': '',
'loop': '',
'top': '',
@@ -1129,7 +1129,7 @@
* constructors other than `Object` are cloned to plain `Object` objects.
*
* Note: This function is loosely based on the structured clone algorithm.
* See http://www.w3.org/TR/html5/common-dom-interfaces.html#internal-structured-cloning-algorithm.
* See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm.
*
* @static
* @memberOf _
@@ -1366,9 +1366,9 @@
// treat `+0` vs. `-0` as not equal
return a !== 0 || (1 / a == 1 / b);
}
// a strict comparison is necessary because `null == undefined`
// exit early for unlike `null` or `undefined` values
if (a == null || b == null) {
return a === b;
return false;
}
// compare [[Class]] names
var className = toString.call(a),