added an extra check in isEqual to test for falsy against truthy values (so as to short circuit before trying to look for properties on null)

This commit is contained in:
Jeremy Ashkenas
2009-12-09 11:17:30 -05:00
parent 3eb9c28039
commit 99564138e8

View File

@@ -424,6 +424,8 @@
if (atype != btype) return false;
// Basic equality test (watch out for coercions).
if (a == b) return true;
// One is falsy and the other truthy.
if ((!a && b) || (a && !b)) return false;
// One of them implements an isEqual()?
if (a.isEqual) return a.isEqual(b);
// Check dates' integer values.