Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

[Scope] Issue with scope.unwatch() not working #787

Closed
vicb opened this issue Mar 22, 2014 · 1 comment
Closed

[Scope] Issue with scope.unwatch() not working #787

vicb opened this issue Mar 22, 2014 · 1 comment

Comments

@vicb
Copy link
Contributor

vicb commented Mar 22, 2014

Consider the following TC:

      iit(r'should be possible to remove every watch',
          (RootScope rootScope, FilterMap filters) {
        rootScope.context['foo'] = 'bar';
        var watch1 = rootScope.watch('(foo|json)+"bar"', (v, p) => null,
        filters: filters);
        var watch2 = rootScope.watch('(foo|json)+"bar"', (v, p) => null,
        filters: filters);

        expect(() => watch1.remove()).not.toThrow();
        expect(() => watch2.remove()).not.toThrow();
      });

expect(() => watch2.remove()).not.toThrow(); would throw with Test failed: Caught 'package:angular/change_detection/watch_group.dart': Failed assertion: line 826 pos 12: 'mode != _MODE_DELETED_' is not true.

As we are watching the same expression twice, removing it once removes both. Note: it is not an issue with simple expressions like foo only

vicb added a commit to vicb/angular.dart that referenced this issue Mar 22, 2014
relates to "[Scope] Issue with scope.unwatch() not working dart-archive#787"

The test is disabled because of GH dart-archive#787. The bug existed before
this PR but what only not triggered. The usage of the stringify
filter do trigger the bug.
@vicb
Copy link
Contributor Author

vicb commented Mar 22, 2014

Whenever this gets fixed, please unxit this test from #788.

@vicb vicb closed this as completed in 84781ef Mar 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant