From 038a743e6f49c347a38edc0e54dcbb175905a475 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 7 May 2010 12:09:14 -0700 Subject: xhr bulk fixes --- src/Scope.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Scope.js') diff --git a/src/Scope.js b/src/Scope.js index 1b93418f..9a20c214 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) { @@ -129,8 +129,8 @@ function createScope(parent, services, existing) { function watcher(){ var value = watch.call(instance); if (last !== value) { - instance.$tryEval(listener, exceptionHandler, value, last); last = value; + instance.$tryEval(listener, exceptionHandler, value, last); } } instance.$onEval(PRIORITY_WATCH, watcher); -- cgit v1.2.3 From 0305b6746e2c50960b042c5d687794e030930f8b Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 7 May 2010 13:43:54 -0700 Subject: change everything over to jasmine --- src/Scope.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Scope.js') diff --git a/src/Scope.js b/src/Scope.js index 9a20c214..687d3628 100644 --- a/src/Scope.js +++ b/src/Scope.js @@ -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) { last = value; - instance.$tryEval(listener, exceptionHandler, value, last); + instance.$tryEval(listener, exceptionHandler, value, lastValue); } } instance.$onEval(PRIORITY_WATCH, watcher); -- cgit v1.2.3