diff options
| author | Misko Hevery | 2010-02-05 14:13:19 -0800 |
|---|---|---|
| committer | Misko Hevery | 2010-02-05 14:13:19 -0800 |
| commit | 6d75afe6d2ea26bb412becd1e8f7cab8031eaab4 (patch) | |
| tree | 980df6860e2d93eb528bfd59841b6da2f4a87e2b /test/BinderTest.js | |
| parent | 5eb440c22bb87b1d69c14193954620b9f1cec023 (diff) | |
| download | angular.js-6d75afe6d2ea26bb412becd1e8f7cab8031eaab4.tar.bz2 | |
fixed memory leak on repeaters
Diffstat (limited to 'test/BinderTest.js')
| -rw-r--r-- | test/BinderTest.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/BinderTest.js b/test/BinderTest.js index f10ed9b1..a3f1eac5 100644 --- a/test/BinderTest.js +++ b/test/BinderTest.js @@ -373,6 +373,8 @@ BinderTest.prototype.testRepeaterUpdateBindings = function(){ var a = compile('<ul><LI ng-repeat="item in model.items" ng-bind="item.a"/></ul>'); var form = a.node; var items = [{a:"A"}, {a:"B"}]; + var initialDataCount = _(jQuery.cache).size(); + assertTrue("" + initialDataCount, initialDataCount > 0); a.scope.set('model', {items:items}); a.binder.updateView(); @@ -398,6 +400,12 @@ BinderTest.prototype.testRepeaterUpdateBindings = function(){ '<li ng-bind="item.a" ng-repeat-index="0">A</li>' + '<li ng-bind="item.a" ng-repeat-index="1">B</li>' + '</ul>', form.sortedHtml()); + + items.shift(); + items.shift(); + a.binder.updateView(); + var currentDataCount = _(jQuery.cache).size(); + assertEquals("I have leaked " + (currentDataCount - initialDataCount), initialDataCount, currentDataCount); }; BinderTest.prototype.testRepeaterContentDoesNotBind = function(){ |
