aboutsummaryrefslogtreecommitdiffstats
path: root/src/Scope.js
diff options
context:
space:
mode:
authorMisko Hevery2010-05-10 10:36:06 -0700
committerMisko Hevery2010-05-10 10:36:06 -0700
commitf5027cc375cf29d8a78679297d9f6bdca9567eb7 (patch)
treef415af2b615656562c1d1ac10fe9b4aab83b54c7 /src/Scope.js
parent4542716370ac52f385795f509436104a2a3501d2 (diff)
parent664f1c56876f00b885272c39f759641271eef1dc (diff)
downloadangular.js-f5027cc375cf29d8a78679297d9f6bdca9567eb7.tar.bz2
Merge branch 'master' of github.com:angular/angular.js
Diffstat (limited to 'src/Scope.js')
-rw-r--r--src/Scope.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Scope.js b/src/Scope.js
index 1b93418f..687d3628 100644
--- a/src/Scope.js
+++ b/src/Scope.js
@@ -97,7 +97,7 @@ function createScope(parent, services, existing) {
$set: bind(instance, setter, instance),
$eval: function $eval(exp) {
- if (isDefined(exp)) {
+ if (exp) {
return expressionCompile(exp).apply(instance, slice.call(arguments, 1, arguments.length));
} else {
foreach(evalLists.sorted, function(list) {
@@ -127,10 +127,11 @@ function createScope(parent, services, existing) {
var watch = expressionCompile(watchExp),
last;
function watcher(){
- var value = watch.call(instance);
+ var value = watch.call(instance),
+ lastValue = last;
if (last !== value) {
- instance.$tryEval(listener, exceptionHandler, value, last);
last = value;
+ instance.$tryEval(listener, exceptionHandler, value, lastValue);
}
}
instance.$onEval(PRIORITY_WATCH, watcher);