Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Cannot compare copied objects accurately #6333

Closed
Griffinz opened this issue Feb 19, 2014 · 2 comments
Closed

Cannot compare copied objects accurately #6333

Griffinz opened this issue Feb 19, 2014 · 2 comments

Comments

@Griffinz
Copy link

With the changes to copy() from: #1875

hashkeys are no longer copied from the source. However when comparing two objects with angular.equals(o1,o2), hashkeys are still taken in to account.

Can hashkeys be ignored by equals()? Since hashkeys are omitted from copy(), the same rule should be applied to equals().

Expected behavior: angular.equals(foo, copy(foo)) === true;

@caitp
Copy link
Contributor

caitp commented Feb 20, 2014

@Griffinz: angular.equals() ignores all properties beginning with $, and all properties whose values are functions, when both arguments are objects. Therefore, I'm not quite sure what you're getting at, can you post a reproduction demonstrating your problem, or write a failing test? I think this might be a problem if they are array-like objects

...Nope, I'm wrong, it seems to work just fine with arrays.

@caitp
Copy link
Contributor

caitp commented Feb 20, 2014

Because the issue tracker is so packed lately, and as far as I can tell this is invalid, I think I need to close this. But if you can demonstrate a situation where this doesn't work as expected, please open another issue with a detailed reproduction. Thanks~~

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants