angular/angular.js — pull request #3303 by nspaeth (2013-07-22 18:20:20+00:00)
Title: feat(copy, equals): copy and equals can now handle cyclic structures.

* Copy can now accurately copy cyclic structures.
* Equals can now accurately assess equality of cyclic structures.
* This should enable watching of cyclic objects.

Eg: copy and equals should work as expected in the following:
```
var obj = {name: "value"};
obj['nested'] = {self: obj};

var cpy = copy(obj);
expect(equals(obj, copy)).toBe(true);
expect(obj['nested']['self']).toBe(obj);
```

However, this is NOT graph copy.
Eg.
```
var obj = {name: "value"};
nested = {level2: "level2"};
obj['nested1'] = nested;
obj['nested2'] = nested;
var cpy = copy(obj);
expect(equals(obj, copy).toBe(true);

//This will fail. Although they were the same
//in the original object, they are distinct copies now.
expect(cpy['nested1']).toBe(cpy['nested2']);
```