Skip to content

Commit 168f237

Browse files
committed
test(watcher): issue #119
1 parent ce15834 commit 168f237

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/spec/provider/watcher.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ describe('filterWatcherProvider', function() {
2222
expect(spy.callCount).toEqual(1);
2323
}));
2424

25+
it('should not crash in circular structure situations',
26+
inject(function(filterWatcher, $document, $window, $rootScope) {
27+
var o1 = { a: 1, b: 2 };
28+
var o2 = { a: 1, b: 2 };
29+
o1.own = o1;
30+
o1.window = $window;
31+
o1.document = $document;
32+
o1.scope = $rootScope;
33+
o1.trait = o2;
34+
o2.own = o2;
35+
(function memoizedOnly(n) {
36+
return filterWatcher.isMemoized('fName',n) || stub.fn(n);
37+
})(o1);
38+
}));
39+
2540
it('should get the result from cache if it\'s memoize',
2641
inject(function(filterWatcher, $rootScope) {
2742
var scope = $rootScope.$new();

0 commit comments

Comments
 (0)