diff options
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js index 127be95d..e5f35bba 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -624,6 +624,7 @@ function copy(source, destination){ * * * Both objects or values pass `===` comparison. * * Both objects or values are of the same type and all of their properties pass `===` comparison. + * * Both values are NaN. (In JavasScript, NaN == NaN => false. But we consider two NaN as equal) * * During a property comparision, properties of `function` type and properties with names * that begin with `$` are ignored. @@ -634,11 +635,11 @@ function copy(source, destination){ * @param {*} o1 Object or value to compare. * @param {*} o2 Object or value to compare. * @returns {boolean} True if arguments are equal. - * */ function equals(o1, o2) { if (o1 === o2) return true; if (o1 === null || o2 === null) return false; + if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN var t1 = typeof o1, t2 = typeof o2, length, key, keySet; if (t1 == t2 && t1 == 'object') { if (isArray(o1)) { |
