You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deepEqual should return false for different complex objects.
What actually happens
It returns true for two different complex objects. After some investigation, it is because the Object.keys() or Object.getOwnPropertySymbols return empty arrays:
Run all the tests with npm run test and see that the test is passed, whereas it should have failed:
I have seen that the other fixes for the other deepEqual issues have been fixed with some special handling. Maybe it would be better to have a fail-safe mechanism to make the deepEqual return false when it is not possible to extract keys.properties from a complex object, instead of considering it as true ?
The text was updated successfully, but these errors were encountered:
What did you expect to happen?
deepEqual
should returnfalse
for different complex objects.What actually happens
It returns
true
for two different complex objects. After some investigation, it is because theObject.keys()
orObject.getOwnPropertySymbols
return empty arrays:samsam/lib/deep-equal.js
Line 132 in 1b141a7
How to reproduce
Clone the samsam repository, add in the following test in the ``deep-equal.test.js` file:
Run all the tests with
npm run test
and see that the test ispassed, whereas it should have failed
:I have seen that the other fixes for the other deepEqual issues have been fixed with some special handling. Maybe it would be better to have a fail-safe mechanism to make the deepEqual return
false
when it is not possible to extract keys.properties from a complex object, instead of considering it astrue
?The text was updated successfully, but these errors were encountered: