This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Bug in angular.equals following #7618 #7724
Closed
Description
Following #7618 it is now possible to use objects which contains circular references (thanks for adding this). This test uses the Jasmine object equality check to verify that the copy
of an object that contains circular references has indeed worked.
However, two such objects should also be angular.equals
. Currently, this is not possible as the stack explodes:
it('should handle circular references when circularRefs is turned on', function () {
var a = {b: {a: null}, self: null, selfs: [null, null, [null]]};
a.b.a = a;
a.self = a;
a.selfs = [a, a.b, [a]];
var aCopy = copy(a, null);
expect(aCopy).toEqual(a);
expect(equals(a, aCopy)).toBeTruthy(); // ** EXPLODES **
});
A fix similar to this does the job. Let me know if you want me to formulate a PR for this.
Thanks