aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaulo Scardine2013-06-09 23:16:26 -0300
committerPete Bacon Darwin2013-07-11 22:04:00 +0100
commit8bd6619b7efa485b020fec96c76047e480469871 (patch)
tree00bfe8e71844a17d5ac384926fa39eb826ffc082 /src
parent4e96334b5c2a18204cd82fa121e2290906277b39 (diff)
downloadangular.js-8bd6619b7efa485b020fec96c76047e480469871.tar.bz2
fix(scope): watches can be safely unregistered inside watch handlers
Closes #2915
Diffstat (limited to 'src')
-rw-r--r--src/ng/rootScope.js2
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'