aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaulo Scardine2013-06-09 23:16:26 -0300
committerPete Bacon Darwin2013-07-11 22:07:15 +0100
commita4ec297925f052bf9ea1aba9f584eaaf7472fb93 (patch)
tree8fe4cffef94120963fa19e445afd2a79fee197ad /src
parent93d7e60d43c23c2c7658c3f3e0d500f325083702 (diff)
downloadangular.js-a4ec297925f052bf9ea1aba9f584eaaf7472fb93.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 1025bbd7..733cec20 100644
--- a/src/ng/rootScope.js
+++ b/src/ng/rootScope.js
@@ -393,7 +393,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'