Make angular.equals support objects with circular references

Per #7724