From 6d75afe6d2ea26bb412becd1e8f7cab8031eaab4 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 5 Feb 2010 14:13:19 -0800 Subject: fixed memory leak on repeaters --- test/BinderTest.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/BinderTest.js') 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(''); 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(){ '
  • A
  • ' + '
  • B
  • ' + '', 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(){ -- cgit v1.2.3