diff options
Diffstat (limited to 'src/Scope.js')
| -rw-r--r-- | src/Scope.js | 7 |
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); |
