diff options
| author | Paulo Scardine | 2013-06-09 23:16:26 -0300 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-07-11 22:04:00 +0100 |
| commit | 8bd6619b7efa485b020fec96c76047e480469871 (patch) | |
| tree | 00bfe8e71844a17d5ac384926fa39eb826ffc082 /src/ng/rootScope.js | |
| parent | 4e96334b5c2a18204cd82fa121e2290906277b39 (diff) | |
| download | angular.js-8bd6619b7efa485b020fec96c76047e480469871.tar.bz2 | |
fix(scope): watches can be safely unregistered inside watch handlers
Closes #2915
Diffstat (limited to 'src/ng/rootScope.js')
| -rw-r--r-- | src/ng/rootScope.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index 4db38804..f95d1c91 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -521,7 +521,7 @@ function $RootScopeProvider(){ watch = watchers[length]; // Most common watches are on primitives, in which case we can short // circuit it with === operator, only when === fails do we use .equals - if ((value = watch.get(current)) !== (last = watch.last) && + if (watch && (value = watch.get(current)) !== (last = watch.last) && !(watch.eq ? equals(value, last) : (typeof value == 'number' && typeof last == 'number' |
