diff options
Diffstat (limited to 'test/ng')
| -rw-r--r-- | test/ng/parseSpec.js | 22 | 
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ng/parseSpec.js b/test/ng/parseSpec.js index 24f5c950..466be755 100644 --- a/test/ng/parseSpec.js +++ b/test/ng/parseSpec.js @@ -786,6 +786,28 @@ describe('parser', function() {                        '$parse', 'isecdom', 'Referencing DOM nodes in Angular expressions is ' +                        'disallowed! Expression: a.b.doc.on("click")');              })); + +            // Issue #4805 +            it('should NOT throw isecdom when referencing a Backbone Collection', function() { +              // Backbone stuff is sort of hard to mock, if you have a better way of doing this, +              // please fix this. +              var fakeBackboneCollection = { +                children: [{}, {}, {}], +                find: function() {}, +                on: function() {}, +                off: function() {}, +                bind: function() {} +              }; +              scope.backbone = fakeBackboneCollection; +              expect(function() { scope.$eval('backbone'); }).not.toThrow(); +            }); + +            it('should NOT throw isecdom when referencing an array with node properties', function() { +              var array = [1,2,3]; +              array.on = array.attr = array.prop = array.bind = true; +              scope.array = array; +              expect(function() { scope.$eval('array'); }).not.toThrow(); +            });            });          });  | 
