aboutsummaryrefslogtreecommitdiffstats
path: root/src/Scope.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/Scope.js')
-rw-r--r--src/Scope.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Scope.js b/src/Scope.js
index 3e225653..cd4eb8ea 100644
--- a/src/Scope.js
+++ b/src/Scope.js
@@ -106,20 +106,23 @@ function createScope(parent, Class) {
$get: bind(instance, getter, instance),
$set: bind(instance, setter, instance),
- $eval: function(exp) {
+ $eval: function $eval(exp) {
if (isDefined(exp)) {
return expressionCompile(exp).apply(instance, slice.call(arguments, 1, arguments.length));
} else {
foreach(evalList, function(eval) {
instance.$tryEval(eval.fn, eval.handler);
});
+ var dirty = false;
foreach(watchList, function(watch) {
var value = instance.$tryEval(watch.watch, watch.handler);
if (watch.last !== value) {
+ dirty = true;
instance.$tryEval(watch.listener, watch.handler, value, watch.last);
watch.last = value;
}
});
+ if (dirty) $eval();
}
},