From a4ec297925f052bf9ea1aba9f584eaaf7472fb93 Mon Sep 17 00:00:00 2001 From: Paulo Scardine Date: Sun, 9 Jun 2013 23:16:26 -0300 Subject: fix(scope): watches can be safely unregistered inside watch handlers Closes #2915 --- src/ng/rootScope.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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' -- cgit v1.2.3