This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -413,7 +413,6 @@ class RootWatchGroup extends WatchGroup {
413
413
Watch dirtyWatch = _dirtyWatchHead;
414
414
_dirtyWatchHead = null ;
415
415
RootWatchGroup root = _rootGroup;
416
- root._removeCount = 0 ;
417
416
try {
418
417
while (dirtyWatch != null ) {
419
418
count++ ;
@@ -430,6 +429,7 @@ class RootWatchGroup extends WatchGroup {
430
429
}
431
430
} finally {
432
431
_dirtyWatchTail = null ;
432
+ root._removeCount = 0 ;
433
433
}
434
434
if (processStopwatch != null ) processStopwatch..stop ()..increment (count);
435
435
return count;
Original file line number Diff line number Diff line change @@ -740,6 +740,18 @@ void main() {
740
740
rootScope.apply ();
741
741
expect (log).toEqual (['root destroy' , 'root2 destroy' ]);
742
742
}));
743
+
744
+
745
+ it ('should not call reaction fn when destroyed' , inject ((RootScope scope) {
746
+ var testScope = scope.createChild ({});
747
+ bool called = false ;
748
+ testScope.watch ('items' , (_, __) {
749
+ called = true ;
750
+ });
751
+ testScope.destroy ();
752
+ scope.apply ();
753
+ expect (called).toBeFalsy ();
754
+ }));
743
755
});
744
756
745
757
You can’t perform that action at this time.
0 commit comments