-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Bug in angular.equals following #7618 #7724
Comments
Should have included a practical example of the impact of this bug in my first post. With it("should watch circular reference objects", inject(function($rootScope) {
var a, spy;
spy = jasmine.createSpy();
$rootScope.$watch("name", spy, true);
$rootScope.$digest();
spy.reset();
expect(spy).not.wasCalled();
$rootScope.$digest();
expect(spy).not.wasCalled();
a = {};
a.x = 5;
a.a = a;
$rootScope.name = a;
$rootScope.$digest();
return expect(spy).wasCalledWith(a, undefined, $rootScope);
})); This fails with a |
Yes, do send a PR. Here's my take on what you've already done:
Go ahead and send a PR. If you have any questions or can't make it, let me know. |
Great. Will pull together a PR tomorrow (taking into account your points) unless you need it before? Indeed what's the timeline for |
Created as #7839 In response to your points:
Very happy to defer to a superior implementation however! |
I responded here: #7839 (comment) |
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:A fix similar to this does the job. Let me know if you want me to formulate a PR for this.
Thanks
The text was updated successfully, but these errors were encountered: